Skip to content

Commit 500a1e2

Browse files
committed
style: apply ruff formatting to test_smoothquant_distributed
Signed-off-by: David Zheng <dqzheng1996@gmail.com>
1 parent 12110f6 commit 500a1e2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/llmcompressor/modifiers/transform/smoothquant/test_smoothquant_distributed.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def test_reduce_activation_scales_noop_single_gpu():
5454
"llmcompressor.modifiers.transform.smoothquant.base.is_distributed",
5555
return_value=False,
5656
),
57-
patch(
58-
"llmcompressor.modifiers.transform.smoothquant.base.dist"
59-
) as mock_dist,
57+
patch("llmcompressor.modifiers.transform.smoothquant.base.dist") as mock_dist,
6058
):
6159
modifier._reduce_activation_scales()
6260
mock_dist.all_reduce.assert_not_called()
@@ -88,9 +86,7 @@ def test_reduce_activation_scales_2n_calls_for_n_layers():
8886
"llmcompressor.modifiers.transform.smoothquant.base.is_distributed",
8987
return_value=True,
9088
),
91-
patch(
92-
"llmcompressor.modifiers.transform.smoothquant.base.dist"
93-
) as mock_dist,
89+
patch("llmcompressor.modifiers.transform.smoothquant.base.dist") as mock_dist,
9490
patch(
9591
"llmcompressor.modifiers.transform.smoothquant.base.wait_for_comms",
9692
side_effect=lambda h: collected.extend(h),
@@ -270,9 +266,9 @@ def test_smoothquant_distributed_weights_match_single_gpu(tmp_path):
270266
text=True,
271267
cwd=tmp_path,
272268
)
273-
assert r.returncode == 0, (
274-
f"DDP run failed:\nstdout:\n{r.stdout}\nstderr:\n{r.stderr}"
275-
)
269+
assert (
270+
r.returncode == 0
271+
), f"DDP run failed:\nstdout:\n{r.stdout}\nstderr:\n{r.stderr}"
276272

277273
ddp = torch.load(ddp_out, weights_only=True)
278274

0 commit comments

Comments
 (0)