Repository navigation
[Perf] dsv41: Fuse request-window layout construction - #45726
Conversation
|
/rerun-test test_deepseek_v4.py test_encoder_swa_replay.py test_dsv4_compressed_pools.py test_deepseek_v41_flash_gb300_encoder_bcg.py test_deepseek_v41_flash_gb300_dp4ep4.py |
|
🚀 🚀 🚀 🚀 ⛔ |
|
/rerun-test test_dsv41_request_window_copy.py test_deepseek_v41_flash_gb300_tp2ep2.py test_deepseek_v41_flash_gb300_dp2ep2.py test_deepseek_v41_flash_gb300_encoder_bcg.py test_deepseek_v41_flash_gb300_trtllm_bounded_bcg.py |
|
🚀 🚀 |
… the kernels and return the layout fields by name; use the hip helper
Motivation
Eager request-window layout construction launches many small kernels to build attention indices, valid lengths, history metadata and commit masks. Fuse the pointwise work after the existing request-group scans to reduce launch overhead and temporary tensors.
Modifications
Accuracy Tests
Before the review cleanup, local validation on GB300 using
test_dsv41_window_layout.pypassed both tests: 64 shape/dtype/floor/padding combinations plus graph replay with changing request groups. Every output field is compared exactly with the CPU reference. The existingtest_dsv41_request_window_copy.pypasses all four tests. Repository pre-commit checks pass.The standalone layout test was removed following review; the results above describe validation of the unchanged implementation at
fc63b690ea. No full model accuracy score is claimed by this draft.Speed Tests and Profiling
The benchmark used only generated request IDs and positions, with no model or dataset. Its script was removed from the final diff following review and remains available at commit
fc63b690eaasbenchmark/kernels/bench_dsv41_window_layout.py. To reproduce, extract that historical script and run it against each checkout:GB300, PyTorch 2.14.1+cu130 and Triton 3.8.0, eager wall time after warmup, 100 calls per sample and five samples per checkout. Input positions start at 8192; the benchmark fixes the window to 128 and supplies a floor tensor. Baseline is
780a5b1accd; candidate isfc63b690ea. Measurements are medians:These are metadata-construction timings, not end-to-end serving speedups. Baseline samples ranged from 0.874–0.905 ms/call (4096 rows) and 0.873–0.905 ms/call (32768 rows); fused samples ranged from 0.397–0.444 and 0.414–0.452 ms/call, respectively.
Checklist
CI States
Latest PR Test (Base): ❌ Run #39738861962
Latest PR Test (Extra): ❌ Run #39738861835
Latest PR Test (AMD ROCm 10): ❌ Run #39738861839