Skip to content

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Jun 17, 2025

PR Category

Execute Infrastructure

PR Types

New features

Description

动转静 run program op 支持传递 cuda_graph_statecuda_graph_dispatch_key,以确保 CudaGraphInstruction 能够感知 cuda_graph_state 的变化

本 PR 会和 #73393 联调

另外降低 value 获取 name 开销,将所有 name 获取统一移到 python 端,移除 value 传递到 cpp 端的操作(目前 fx 还没有删掉)

Copy link

paddle-bot bot commented Jun 17, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@SigureMo SigureMo changed the title [Dy2St] Support pass cuda graph state and dispatch key in run program op [Dy2St][3.13] Support pass cuda graph state and dispatch key in run program op Jun 18, 2025
@SigureMo SigureMo requested a review from Copilot June 19, 2025 17:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces new support for passing cuda graph state and dispatch key parameters to the run program op. Key changes include:

  • Adding a new IntEnum (CUDAGraphState) to represent the different cuda graph states.
  • Updating attribute preparation and caching logic to include cuda graph state and dispatch key.
  • Propagating the new parameters in various op function bindings and interpreter interfaces.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/paddle/jit/dy2static/utils.py Added CUDAGraphState IntEnum for cuda graph states.
python/paddle/jit/dy2static/pir_partial_program.py Refactored attribute preparation and run implementation to include cuda graph state and dispatch key.
paddle/fluid/pybind/pir.cc Bound a new helper to retrieve fake value names.
paddle/fluid/pybind/op_function_common.cc Added new attribute definitions for cuda graph state and dispatch key.
paddle/fluid/framework/{new_executor/,executor_cache.} Updated interpreter and caching logic to handle new cuda graph parameters.
paddle/fluid/eager/to_static/{run_program_op_node.h,run_program_op_func.h} Integrated cuda graph state support through new attribute extraction and usage.
Comments suppressed due to low confidence (1)

paddle/fluid/pybind/op_function_common.cc:1257

  • [nitpick] Consider adding inline comments for the new 'cuda_graph_state' and 'cuda_graph_dispatch_key' attributes to document their expected values in accordance with the CUDAGraphState enum, which will help future maintainability.
      {"cuda_graph_state", CastPyArg2AttrLong},

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SigureMo SigureMo changed the title [Dy2St][3.13] Support pass cuda graph state and dispatch key in run program op [Dy2St][3.13] Support pass cuda graph state and dispatch key in run program op and move get value name to python side Jun 20, 2025
@SigureMo SigureMo requested review from zrr1999 and gouzil as code owners June 20, 2025 05:30
zyfncg
zyfncg previously approved these changes Jun 20, 2025
zhangbo9674
zhangbo9674 previously approved these changes Jun 20, 2025
@SigureMo
Copy link
Member Author

skip-reason: 执行器已经 review 过,后续更新无相关变动

@SigureMo SigureMo merged commit 613186b into PaddlePaddle:develop Jun 21, 2025
67 of 72 checks passed
@SigureMo SigureMo deleted the dy2st/support-pass-cudagraph-state-and-dispatch-key-in-run-program-op branch June 21, 2025 13:29
@SigureMo SigureMo changed the title [Dy2St][3.13] Support pass cuda graph state and dispatch key in run program op and move get value name to python side [Dy2St] Support pass cuda graph state and dispatch key in run program op and move get value name to python side Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants