Skip to content

[CodeStyle][task 1] enable Ruff UP032 rule with . except python/paddle/base - #57409

Merged
luotao1 merged 8 commits into
PaddlePaddle:developfrom
Liyulingyue:up32_2
Sep 22, 2023
Merged

luotao1 merged 8 commits into
PaddlePaddle:developfrom
Liyulingyue:up32_2

Conversation

@Liyulingyue

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

Others

Description

#57367 task1

@Liyulingyue

Copy link
Copy Markdown
Collaborator Author

@gouzil

@gouzil

gouzil commented Sep 16, 2023

Copy link
Copy Markdown
Collaborator

你这也没修呀

ruff check . --statistics
871	UP032	[*] Use f-string instead of `format` call

@SigureMo SigureMo changed the title [CodeStyle][task 1] enable Ruff UP0032 rule with . except python/paddle/base [CodeStyle][task 1] enable Ruff UP032 rule with . except python/paddle/base Sep 16, 2023
@Liyulingyue

Copy link
Copy Markdown
Collaborator Author

@gouzil

@gouzil

gouzil commented Sep 18, 2023

Copy link
Copy Markdown
Collaborator

LGTM, 可以等UP018或者UP028的冲突来 rerun ci

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 18, 2023
@luotao1

luotao1 commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator

需要解决冲突

@Liyulingyue

Liyulingyue commented Sep 21, 2023 •

Copy link
Copy Markdown
Collaborator Author

@gouzil @SigureMo @luotao1 麻烦看看~

Comment on lines 505 to 500

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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这玩意是不是可以直接str一下

Comment on lines -558 to +552
os.environ['PADDLE_TRAINER_ID'] = '{}'.format(
sorted_endpoints.index(self.curr_host)
)
os.environ[
'PADDLE_TRAINER_ID'
] = f'{sorted_endpoints.index(self.curr_host)}'

Copy link
Copy Markdown
Collaborator

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)}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

同上

Comment on lines -129 to +137
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
)

Copy link
Copy Markdown
Collaborator

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}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个文件下的基本都可以写死吧

@gouzil

gouzil commented Sep 21, 2023

Copy link
Copy Markdown
Collaborator

其余LGTM,在下一个pr修改优化,@SigureMo

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTMeow 🐾

等 CI 通过即可

@luotao1
luotao1 merged commit f092028 into PaddlePaddle:develop Sep 22, 2023
@Liyulingyue
Liyulingyue deleted the up32_2 branch September 23, 2023 16:09
Frida-a pushed a commit to Frida-a/Paddle that referenced this pull request Oct 14, 2023
…le/base` (PaddlePaddle#57409)

* update up032

* update up032

* Update api_gen.py

* Update api_gen.py

* Update sampcd_processor_utils.py
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 16, 2023
…le/base` (PaddlePaddle#57409)

* update up032

* update up032

* Update api_gen.py

* Update api_gen.py

* Update sampcd_processor_utils.py
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
…le/base` (PaddlePaddle#57409)

* update up032

* update up032

* Update api_gen.py

* Update api_gen.py

* Update sampcd_processor_utils.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants