Repository navigation
Conversation
…n all-NaN score row stays in range (sgl-project#105) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
/rerun-test -c test_basic_sanity_dflash.py |
|
Results for 🚀 ⛔ |
|
/tag-and-rerun-ci |
…riton interpreter Setting TRITON_INTERPRET inside the test module fails in CI's CPU suite once triton is already imported (tl.sum raises 'Cannot call @triton.jit'd outside of the scope of a kernel'). Move it next to the other speculative kernel tests and register it for base-b-kernel-unit on 1-gpu-large. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…anager.devin.ai/proxy/github.com/modal-projects/sglang into rohan/up/dflash2-all-nan-selector-row
Pick the first NaN if the row has one, else the first maximum, so mixed-NaN rows agree with _selector_walk_torch. Move NaN coverage into test_lilicorr_cuda.py as reference comparisons. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@kpham-sgl comments addressed here! |
|
/rerun-test test/registered/kernels/ops/speculative/test_lilicorr_cuda.py test/registered/kernels/ops/speculative/test_dflash_domino.py test/registered/e2e/models/test_glm53_flash_b200.py |
|
|
/rerun-test test/registered/kernels/ops/speculative/test_lilicorr_cuda.py test/registered/kernels/ops/speculative/test_dflash_domino.py test/registered/e2e/models/test_glm53_flash_b200.py |
|
🚀 🚀 |
Motivation
The greedy branch of
_selector_walk_kernel(kernels/ops/speculative/dflash.py) takesbest = tl.max(scores)and then the first offset wherescores == best. If a whole score row is NaN,bestis NaN, no element compares equal, andindexfalls through totop_k: one past the row, so the walk resolves to a neighbouring row's candidates.Modifications
_selector_walk_kernelnow makes the same pick astorch.argmax(and_selector_walk_torch): the first NaN if the row has one, else the first maximum.index < top_kfor every row, including all-NaN rows, and mixed-NaN rows match the reference.test/registered/kernels/ops/speculative/test_lilicorr_cuda.py:test_greedy_path_matches_the_reference_on_nan_scores(all-NaN and mixed-NaN rows), comparing tokens and q rows fromlilicorr_sample_pathagainst_selector_walk_torch.DSpark
DFlash-only:
DSparkWorkerV2does not usecandidate_selector/selector_walk_triton, so DSpark is unaffected.Accuracy Tests
CUDA test (
test_lilicorr_cuda.py, registered on1-gpu-large); results from CI. The kernel was also checked against_selector_walk_torchunderTRITON_INTERPRET=1for all-NaN, mixed-NaN, finite, tied and-infrows (all match).Speed Tests and Profiling
No hot-path change beyond the fix itself; not separately benchmarked.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #37372296257
Latest PR Test (Extra): ❌ Run #37372295607
Latest PR Test (AMD ROCm 10): ❌ Run #37372296288