Skip to content

[None][fix] Resolve review feedback on the VisualGen VSA and SOL sparse attention PR - #11

Closed
heyuhhh wants to merge 3 commits into
user/yuhangh/update_vsafrom
user/yuhangh/pr18079-review-fixes
Closed

heyuhhh wants to merge 3 commits into
user/yuhangh/update_vsafrom
user/yuhangh/pr18079-review-fixes

Conversation

@heyuhhh

@heyuhhh heyuhhh commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up for NVIDIA#18079 that resolves the open review threads there. It targets the PR branch user/yuhangh/update_vsa, so merging it updates NVIDIA#18079 in place.

Threads resolved by this PR

Thread Change
weiminwang-nv, changes requested (review); coderabbit on l0_cpu.yml with +1 from BowenFu (thread) test_attention_vsa_kernels.py and test_sol_predictor_kernels.py are listed in l0_b200.yml; the SOL kernel suite is also listed in l0_cpu.yml for its cpu_only tests.
coderabbit, VSA cache capacity on pipeline_wan.py (thread) The 16-shape cap on the VSA metadata and route caches is gone. The CUDA Graph runner that captures these tensor addresses keeps one graph per shape without a cap, so the caches now grow the same way and are released with the graphs in cleanup. No new user-facing knob.
coderabbit, block_pool block sizes (thread) The Triton kernel masks the block boundary, so any block size matches the PyTorch fallback; non-positive sizes raise. The parity test covers block sizes 4, 9 and 64.
coderabbit, TRTLLM sparse execution assertion with +1 from BowenFu (thread) The ragged-input test records PrimsTSBlockSparseFmha.forward running instead of a non-None prediction.
coderabbit, CUDA gates on test_skip_softmax.py (thread) The capture test moved to test_trtllm_attention_metadata.py (B200 list) under an SM100/SM103 gate. Inside the cpu_only module it never ran in CI.
coderabbit, non-finite tensor timesteps (thread) inf, tensor nan and tensor inf cases added.
coderabbit, gate tensor values (thread) Both forwarded gates are compared against their local-head views.
coderabbit, SDPA fallback in test_wan_vsa_pipeline.py (thread) CuTe fine-stage launches are counted: the CuTe run must launch it, the SDPA reference must not.
coderabbit, annotations (thread), to_sparse_params return type (thread) and the four nitpicks (_compact_qkv, _predict, getattr, quoted annotation) Applied.

Threads already addressed by the current NVIDIA#18079 tip

  • SolParams should hold data only (heyuhhh): the helpers live on the backend since the rework.
  • Share SOLSparsePredictor (coderabbit): the predictor is a stateless functional operator now.
  • LTX-2 block-level timestep coverage (1, 2, 3) and the pipeline_ltx2_two_stages.py question (lfr-0531): the PR no longer touches the LTX-2 model or pipeline code; main carries the timestep threading via [TRTLLM-15917][feat] Integrate Sol-Attn sparse attention into VisualGen NVIDIA/TensorRT-LLM#18329, and the stubbed tests were removed.
  • Blank dense_layers (coderabbit): the field is list[int] now.
  • int8 SAGE guard (coderabbit) and the fmha_caches precondition key (coderabbit): already fixed in the refined commits.
  • VSA gate creation per backend (lfr-0531): AttentionConfig validates the backend/algorithm pairing; the model only checks the algorithm.

Test

B200 container, branch based on the current NVIDIA#18079 tip.

  • pre-commit run --files <changed files> clean.
  • CPU suites touched by the fixes (test_timestep_phase.py, test_sol_predictor_kernels.py, test_skip_softmax.py, test_trtllm_attention_metadata.py, test_attention_vsa.py, test_sol_attention.py, test_visual_gen_args.py, the three multi-GPU unit tests): 218 passed, 41 skipped.
  • GPU suites (test_sol_predictor_kernels.py, test_trtllm_attention_metadata.py including the moved capture test, test_attention_vsa_kernels.py, test_attention_vsa.py): 136 passed.
  • test_attention_integration.py -k vsa: 4 passed, including the block-sparse FMHA execution check.
  • test_wan_vsa_pipeline.py::TestWanVsa14B_PipelineCorrectness::test_cosine_similarity with LLM_MODELS_ROOT set: 1 passed; the CuTe run launched the CuTe fine stage and the SDPA reference did not.

The VSA metadata builder and route builder capped their shape caches at
16 entries and failed the request that introduced the 17th shape. The
CUDA Graph runner that captures the cached tensor addresses has no such
cap, so the limit only turned a new resolution/frame profile into a
runtime error. Drop the cap: both caches keep one entry per distinct
shape for as long as the graphs that reference them and are released
together with the graphs in cleanup.

Signed-off-by: yuhangh <58161490+heyuhhh@users.noreply.github.com>
The Triton block pooling kernel loaded tokens in fixed-width steps and
only masked against the sequence length, so a block size that is not a
multiple of the step width read into the next block. Mask the block
boundary as well, reject non-positive block sizes, and check the kernel
against the PyTorch fallback for block sizes below, not a multiple of,
and equal to the step width.

Signed-off-by: yuhangh <58161490+heyuhhh@users.noreply.github.com>
… checks

Add the VSA and SOL predictor kernel suites to the CPU and B200 test
lists. Move the TRTLLM skip-softmax CUDA Graph capture test out of the
cpu_only module into the TRTLLM metadata suite with an SM100 gate so it
runs on the GPU stage. Assert that TRTLLM VSA executes the block-sparse
FMHA rather than only predicting routes, check the forwarded VSA gate
values, verify that the Wan VSA pipeline reference takes the SDPA
fallback, and reject non-finite tensor timesteps. Annotate the helpers
and tests flagged during review and read the sparse algorithm
discriminator directly instead of through getattr.

Signed-off-by: yuhangh <58161490+heyuhhh@users.noreply.github.com>
@heyuhhh

heyuhhh commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded: the same changes landed as one commit (85b6b4d) directly on user/yuhangh/update_vsa, so NVIDIA#18079 carries them now.

@heyuhhh heyuhhh closed this Sep 20, 2026
@heyuhhh
heyuhhh deleted the user/yuhangh/pr18079-review-fixes branch September 20, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant