Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][Dy2St] Move scope cache to cpp side #71506

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Mar 8, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

#71505,为逻辑优化,将 scope cache 逻辑移到 C++,以和执行器使用相同的 cache 计算逻辑

@SigureMo SigureMo requested a review from Copilot March 8, 2025 20:54

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the dy2static partial program implementation by moving the scope cache logic to the C++ side, while also cleaning up unused CUDA graph configuration.

  • Replaces _legacy_C_ops.pir_run_program with _C_ops.run_program.
  • Removes CUDA graph vector initialization and related attribute settings.
  • Renames the backward function from _append_backward_desc to _append_backward.

Reviewed Changes

File Description
python/paddle/jit/dy2static/pir_partial_program.py Scope cache logic moved to C++ side; cleanup of CUDA graph-related code and renaming of backward function.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

python/paddle/jit/dy2static/pir_partial_program.py:717

  • Confirm that the updated _C_ops.run_program API no longer requires the CUDA graph vector argument. Its removal here could lead to unexpected behavior if the C++ implementation still expects this parameter.
_C_ops.run_program(

python/paddle/jit/dy2static/pir_partial_program.py:1115

  • Verify that removing the CUDA graph capture mode attributes does not inadvertently remove required configurations for environments that rely on CUDA graph functionalities.
if self._cuda_graph_capture_mode:
Copy link

paddle-bot bot commented Mar 8, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant