Skip to content
Merged
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
8 changes: 4 additions & 4 deletions test/python/test_mhas_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_sdpa_random_fwd_unified_L1(env_info, test_no, request, cudnn_handle):
# # L0 bprop tests
# # ==================================

@pytest.mark.parametrize("test_no", generate_test_seeds(num_tests=256, rng_seed=844), ids=lambda p: f"test{p[0]}")
@pytest.mark.parametrize("test_no", generate_test_seeds(num_tests=384, rng_seed=844), ids=lambda p: f"test{p[0]}")
@pytest.mark.L0
def test_sdpa_random_bwd_L0(env_info, test_no, request, cudnn_handle):

Expand All @@ -189,7 +189,7 @@ def test_sdpa_random_bwd_L0(env_info, test_no, request, cudnn_handle):
with RandomizationContext(
batches=RandomBatchSize(min=8, max=16),
s_q_s_kv = RandomSequenceLength(s_q_min=1, s_q_max=4096, s_kv_min=1, s_kv_max=4096, s_q_distribution={"s_q=1":0, "s_q=s_kv":5, "s_q=random":10, "s_q>s_kv":3}),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=192, d_v_min=1, d_v_max=128, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=256, d_v_min=1, d_v_max=256, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Format the changed calls with Black’s 160-character limit.

These modified RandomHiddenDimSize(...) calls exceed the configured line length. Reformat the arguments consistently in all three locations.

Proposed formatting
-        d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=256, d_v_min=1, d_v_max=256, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
+        d_qk_d_v=RandomHiddenDimSize(
+            d_qk_min=1,
+            d_qk_max=256,
+            d_v_min=1,
+            d_v_max=256,
+            head_dim_distribution={"d_qk=d_v": 5, "d_qk=random": 1},
+            with_high_probability=[(64, 64), (128, 128), (192, 128), (256, 256)],
+        ),

Apply the same formatting to Lines 481 and 654.

As per coding guidelines, **/*.{py,ipynb} files must be formatted with Black using a line length of 160.

Also applies to: 481-481, 654-654

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/python/test_mhas_v2.py` at line 192, Reformat the three modified
RandomHiddenDimSize(...) calls, including the occurrences near lines 192, 481,
and 654, with Black using a 160-character line length. Keep all arguments and
values unchanged while applying consistent Black formatting.

Source: Coding guidelines

head_count=RandomHeadGenerator(min=1, max=8, head_group_options=(1, 4, 1)),
data_type=RandomChoice({torch.float16 : 1, torch.bfloat16 : 2}),
with_sliding_mask=SlidingWindowMaskGenerator(causal=10, left_window_only=5, right_window_only=5, band_around_diag=10, no_mask=10),
Expand Down Expand Up @@ -478,7 +478,7 @@ def test_sdpa_random_bwd_ragged_L0(env_info, test_no, request, cudnn_handle):
with RandomizationContext(
batches=RandomBatchSize(min=8, max=16),
s_q_s_kv = RandomSequenceLength(s_q_min=1, s_q_max=4096, s_kv_min=1, s_kv_max=4096, s_q_distribution={"s_q=1":0, "s_q=s_kv":5, "s_q=random":10, "s_q>s_kv":3}),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=192, d_v_min=1, d_v_max=128, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=256, d_v_min=1, d_v_max=256, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
head_count=RandomHeadGenerator(min=1, max=8, head_group_options=(1, 4, 1)),
data_type=RandomChoice({torch.float16 : 1, torch.bfloat16 : 2}),
with_sliding_mask=SlidingWindowMaskGenerator(causal=10, left_window_only=5, right_window_only=5, band_around_diag=10, no_mask=10),
Expand Down Expand Up @@ -651,7 +651,7 @@ def test_sdpa_random_bwd_bias_L0(env_info, test_no, request, cudnn_handle):
with RandomizationContext(
batches=RandomBatchSize(min=8, max=16),
s_q_s_kv = RandomSequenceLength(s_q_min=1, s_q_max=4096, s_kv_min=1, s_kv_max=4096, s_q_distribution={"s_q=1":0, "s_q=s_kv":5, "s_q=random":10, "s_q>s_kv":3}),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=192, d_v_min=1, d_v_max=128, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
d_qk_d_v=RandomHiddenDimSize(d_qk_min=1, d_qk_max=256, d_v_min=1, d_v_max=256, head_dim_distribution={"d_qk=d_v":5, "d_qk=random":1}, with_high_probability=[(64,64), (128,128), (192,128), (256,256)]),
head_count=RandomHeadGenerator(min=1, max=8, head_group_options=(1, 4, 1)),
data_type=RandomChoice({torch.float16 : 1, torch.bfloat16 : 2}),
with_sliding_mask=SlidingWindowMaskGenerator(no_mask=10),
Expand Down