From d6893e9b2587f3590a4a8eb93e9f14fa48b00bad Mon Sep 17 00:00:00 2001 From: andrewwhitecdw Date: Thu, 13 Aug 2026 17:36:13 -0500 Subject: [PATCH] fix: duplicate pad_between_seqs skips and wrong architecture direction - Deduplicate the pad_between_seqs eligibility checks in test_cp_with_flash_attention. - Restrict the FlashAttention v3 guard to exactly Hopper (sm90) so post-Hopper architectures are skipped with the correct diagnostic message. Signed-off-by: Andrew White --- tests/pytorch/attention/test_attention_with_cp.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/pytorch/attention/test_attention_with_cp.py b/tests/pytorch/attention/test_attention_with_cp.py index d7eb16b862..401c2e7297 100644 --- a/tests/pytorch/attention/test_attention_with_cp.py +++ b/tests/pytorch/attention/test_attention_with_cp.py @@ -316,19 +316,11 @@ def test_cp_with_flash_attention(cp_pool, dtype, model, qkv_format, cp_comm_type if pad_between_seqs: if qkv_format != "thd": pytest.skip("pad_between_seqs only applies to THD format!") - if not FlashAttentionUtils.v3_is_installed or get_device_compute_capability() > (9, 0): + if not FlashAttentionUtils.v3_is_installed or get_device_compute_capability() != (9, 0): pytest.skip("pad_between_seqs with CP requires Flash Attention v3 on Hopper (sm90)!") if cp_comm_type == "a2a+p2p": pytest.skip("pad_between_seqs is not yet supported with A2A+P2P CP comm type!") - if pad_between_seqs: - if qkv_format != "thd": - pytest.skip("pad_between_seqs only applies to THD format!") - if not FlashAttentionUtils.v3_is_installed: - pytest.skip("pad_between_seqs with CP requires Flash Attention v3!") - if cp_comm_type == "a2a+p2p": - pytest.skip("pad_between_seqs is not yet supported with A2A+P2P CP comm type!") - config = model_configs_flash_attn[model] config.context_parallel = True config.cp_comm_type = cp_comm_type