Skip to content

[Bug] Fix out-of-range token id crashing tp=1 VocabParallelEmbedding#27482

Merged
hnyls2002 merged 4 commits into
mainfrom
lsyin/fix-radix-vocab-oob
Jun 7, 2026
Merged

[Bug] Fix out-of-range token id crashing tp=1 VocabParallelEmbedding#27482
hnyls2002 merged 4 commits into
mainfrom
lsyin/fix-radix-vocab-oob

Conversation

@hnyls2002

@hnyls2002 hnyls2002 commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • gen_radix_tree builds requests with random.randint(0, 32000) (inclusive), which can emit token id 32000 -- out of range for a 32000-vocab model (valid 0..31999)
  • At tp=1, VocabParallelEmbedding.forward does not mask input ids, so the bad id reaches F.embedding and crashes with a vectorized_gather_kernel device-side assert
  • Flaky (single-GPU only; the generator is unseeded, ~1.2% of runs); surfaces in CI as a GPU coredump in TestEagleLlama2Retract.test_radix_attention

Fix

  • gen_radix_tree: random.randint(0, 31999) -- fix the off-by-one
  • VocabParallelEmbedding.forward: gated maybe_detect_oob on the input ids, so an out-of-range or negative (unmasked sentinel) id surfaces as a located assert instead of a silent OOB / coredump
  • maybe_detect_oob: assert lower and upper bounds separately so the message names which one failed

CI States

Latest PR Test (Base): 🚫 Run #27084365414
Latest PR Test (Extra): ❌ Run #27084365398

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@hnyls2002 hnyls2002 changed the title Fix out-of-range token id in radix-attention test; assert OOB ids at embedding [Bug] Fix out-of-range token id crashing tp=1 VocabParallelEmbedding Jun 7, 2026
@hnyls2002

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci extra

@hnyls2002 hnyls2002 merged commit 0ce3db3 into main Jun 7, 2026
58 of 79 checks passed
@hnyls2002 hnyls2002 deleted the lsyin/fix-radix-vocab-oob branch June 7, 2026 06:00
monkeyLoveding pushed a commit to monkeyLoveding/sglang_open that referenced this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant