Skip to content

[Dy2St] Update no_need_buffer names if original_name no need buffer #71476

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

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Mar 7, 2025

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

#71099,之前认为只有 new_nameno_need_buffer_names 里需要删,因为 original_name 在 Program 理论上已经找不到了,但 fwd_mapbwd_map 是在 rename 前获取的,因此还是找得到的,这会导致 original_name 仍然在 no_need_buffer_names,那么这个 var 仍然会被 gc

@SigureMo SigureMo requested a review from Copilot March 7, 2025 03:27
Copy link

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

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.

PR Overview

This pull request addresses a bug in the handling of buffer names during the renaming process, ensuring that both original and new names are removed from the no_need_buffer_names when they are present.

  • Fixes bug where original_name was not removed from no_need_buffer_names even if it was found in fwd_map and bwd_map.
  • Updates the removal logic to check for an intersection between {original_name, new_name} and no_need_buffer_names.

Reviewed Changes

File Description
python/paddle/jit/dy2static/pir_partial_program.py Updated the condition to remove both original and new buffer names from the no_need_buffer_names set

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

@SigureMo SigureMo requested a review from gouzil March 7, 2025 03:28
@SigureMo SigureMo changed the title [Dy2St] Update no_need_buffer names if original_name no need buffer [Dy2St][3.13] Update no_need_buffer names if original_name no need buffer Mar 7, 2025
@SigureMo SigureMo changed the title [Dy2St][3.13] Update no_need_buffer names if original_name no need buffer [Dy2St] Update no_need_buffer names if original_name no need buffer Mar 7, 2025
@SigureMo SigureMo merged commit b099288 into PaddlePaddle:develop Mar 8, 2025
33 of 34 checks passed
@SigureMo SigureMo deleted the dy2st/update-no-need-buffer-names-after-rename-values-re branch March 8, 2025 03:52
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
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.

2 participants