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

[CodeStyle][Ruff][BUAA][B-[1-6]] Fix ruff Q004 diagnostic for 6 files in Paddle #67231

Merged
merged 6 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(
if offload:
assert (
self._pfp16
), "Only support offload strategy while using \'Adam\', \'AdamW\' and \'Momentum\' optimizer with AMP/Pure FP16"
), "Only support offload strategy while using 'Adam', 'AdamW' and 'Momentum' optimizer with AMP/Pure FP16"

self.offload = offload # Using for offload
self.offload_device = "cpu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def replace_training_script(self):
cur_endpoint = endpoints[idx // poprun_args.nproc_per_host]
rank_in_node = idx % poprun_args.nproc_per_host
poprun_command.append(
f'--instance-mpi-local-args={idx}:\"-x PADDLE_TRAINER_ID={idx} -x PADDLE_CURRENT_ENDPOINT={cur_endpoint} -x PADDLE_RANK_IN_NODE={rank_in_node}\"'
f'--instance-mpi-local-args={idx}:"-x PADDLE_TRAINER_ID={idx} -x PADDLE_CURRENT_ENDPOINT={cur_endpoint} -x PADDLE_RANK_IN_NODE={rank_in_node}"'
)

# executor
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/prim_op_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def init(self):
def init_checker(self):
assert hasattr(
self.op_test, 'prim_op_type'
), "if you want to test comp op, please set prim_op_type with \'prim\' or \'comp\' in setUp function."
), "if you want to test comp op, please set prim_op_type with 'prim' or 'comp' in setUp function."
assert self.op_test.prim_op_type in [
"comp",
"prim",
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_collective_4(self):
config_path = os.path.join(config_dir.name, 'auto_parallel_config.json')
with open(config_path, 'w') as wobj:
wobj.write(
'{\"tuner_save_path\":\"parallel_strategy.pkl\",\"tuner_load_path\":\"parallel_strategy.pkl\",\"tuner_run_mode\":\"tuner_and_run\"}'
'{"tuner_save_path":"parallel_strategy.pkl","tuner_load_path":"parallel_strategy.pkl","tuner_run_mode":"tuner_and_run"}'
)
port = random.randrange(6000, 8000)
args = "--job_id test4 --devices 0,1 --log_dir {} --auto_parallel_config {}"
Expand Down
2 changes: 1 addition & 1 deletion tools/externalError/spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parsing(externalErrorDesc):
m_message = m_message.replace(list_a[idx], list_shape[idx])

m_message = m_message.replace(
'<h6 class=\"deprecated_header\">Deprecated</h6>', ''
'<h6 class="deprecated_header">Deprecated</h6>', ''
)

res_span = r'(<span class=.*?</span>)'
Expand Down
2 changes: 1 addition & 1 deletion tools/jetson_infer_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def set_diff_value(file, atol="1e-5", inplace_atol="1e-7"):
+ atol
+ ",inplace_atol="
+ inplace_atol
+ ",/g\' "
+ ",/g' "
+ file
)

Expand Down