-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[CodeStyle][task 1] enable Ruff UP032 rule with . except python/paddle/base
#57409
Conversation
你这也没修呀 ruff check . --statistics
871 UP032 [*] Use f-string instead of `format` call |
python/paddle/base
LGTM, 可以等 |
需要解决冲突 |
os.environ['PADDLE_TRAINER_ID'] = '{}'.format( | ||
host_endpoints.index(self.curr_host) | ||
) | ||
os.environ[ | ||
'PADDLE_TRAINER_ID' | ||
] = f'{host_endpoints.index(self.curr_host)}' | ||
hosts = ','.join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这玩意是不是可以直接str一下
os.environ['PADDLE_TRAINER_ID'] = '{}'.format( | ||
sorted_endpoints.index(self.curr_host) | ||
) | ||
os.environ[ | ||
'PADDLE_TRAINER_ID' | ||
] = f'{sorted_endpoints.index(self.curr_host)}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
assert fwd_op_id in self._op_fp16_dict, "{}".format( | ||
str(op) | ||
) | ||
assert fwd_op_id in self._op_fp16_dict, f"{str(op)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
item_str = '{{:.{}e}}'.format( | ||
DEFAULT_PRINT_OPTIONS.precision | ||
).format(np_var) | ||
item_str = f'{{:.{DEFAULT_PRINT_OPTIONS.precision}e}}'.format( | ||
np_var | ||
) | ||
elif np.ceil(np_var) == np_var: | ||
item_str = f'{np_var:.0f}.' | ||
else: | ||
item_str = '{{:.{}f}}'.format( | ||
DEFAULT_PRINT_OPTIONS.precision | ||
).format(np_var) | ||
item_str = f'{{:.{DEFAULT_PRINT_OPTIONS.precision}f}}'.format( | ||
np_var | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两处有点奇怪需要单独看一下
"received tensor_version:{} != wrapper_version_snapshot:{}".format( | ||
1, 0 | ||
), | ||
f"received tensor_version:{1} != wrapper_version_snapshot:{0}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件下的基本都可以写死吧
其余LGTM,在下一个pr修改优化,@SigureMo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMeow 🐾
等 CI 通过即可
…le/base` (PaddlePaddle#57409) * update up032 * update up032 * Update api_gen.py * Update api_gen.py * Update sampcd_processor_utils.py
…le/base` (PaddlePaddle#57409) * update up032 * update up032 * Update api_gen.py * Update api_gen.py * Update sampcd_processor_utils.py
…le/base` (PaddlePaddle#57409) * update up032 * update up032 * Update api_gen.py * Update api_gen.py * Update sampcd_processor_utils.py
PR types
Others
PR changes
Others
Description
#57367 task1