Skip to content

[CodeStyle][Ruff] Introduce rule B005 and fix discovered bugs#72896

Merged
SigureMo merged 2 commits into
PaddlePaddle:developfrom
gouzil:ruff/add_B005
May 23, 2025
Merged

[CodeStyle][Ruff] Introduce rule B005 and fix discovered bugs#72896
SigureMo merged 2 commits into
PaddlePaddle:developfrom
gouzil:ruff/add_B005

Conversation

@gouzil
Copy link
Copy Markdown
Member

@gouzil gouzil commented May 22, 2025

@gouzil gouzil requested a review from SigureMo as a code owner May 22, 2025 16:38
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 22, 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.

# TODO (JZ-LIANG) revise this for uniform mixed parallelism
param_name = (
output_name.strip("@GRAD@MERGED")
output_name.removeprefix("@GRAD@MERGED").removesuffix(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这里 removesuffix 就好,因为老 IR 里这些一定是后缀,或者说这里可以改成

param_name = output_name.removesuffix("@MERGED").removesuffix("@GRAD")

这样就好了,也不用加什么 if

@paddle-bot paddle-bot Bot added the contributor External developers label May 22, 2025
@SigureMo SigureMo changed the title [CodeStyle][Ruff] add B005 rule [CodeStyle][Ruff] Introduce rule B005 and fix discovered bugs May 23, 2025
@SigureMo
Copy link
Copy Markdown
Member

skip-reason: codestyle only

@SigureMo SigureMo merged commit 5d76b02 into PaddlePaddle:develop May 23, 2025
52 of 56 checks passed
@SigureMo SigureMo deleted the ruff/add_B005 branch May 23, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants