diff --git a/tests/unittest/_torch/attention/sparse/dsa/test_dsa_sparse_mla.py b/tests/unittest/_torch/attention/sparse/dsa/test_dsa_sparse_mla.py index f3a459d21b4e..ed3af070b2a4 100644 --- a/tests/unittest/_torch/attention/sparse/dsa/test_dsa_sparse_mla.py +++ b/tests/unittest/_torch/attention/sparse/dsa/test_dsa_sparse_mla.py @@ -777,6 +777,12 @@ def yarn_get_mscale(scale=1, mscale=1): * kv_cache_tokens_per_block * max_num_contexts ) + # The static token-sparse context FMHA may load KV rows beyond the selected ones, and its + # TMA descriptor does not bound rows to the pool. A pool sized only for these short + # sequences (a single 64-token block for context_sequence_lengths=[10]) can therefore be + # read past its end, which faults whenever the following address range is unmapped. Keep + # at least TopK rows in the pool, as any real deployment does. + max_tokens = max(max_tokens, SPARSE_TOPK) pretrained_config = SimpleNamespace( rms_norm_eps=1e-6,