sgl-project/sglang · error · ValueError
DFLASH requires explicit layer_ids for aux hidden capture.
Error message
DFLASH requires explicit layer_ids for aux hidden capture.
What it means
DFLASH aux-hidden capture on Qwen3-Next requires explicit layer ids; None is rejected before enabling capture_aux_hidden_states.
Source
Thrown at python/sglang/srt/models/qwen3_next.py:1285
self.capture_aux_hidden_states = True
if layer_ids is None:
num_layers = self.config.num_hidden_layers
self.model.set_eagle3_layers_to_capture(
[
2,
num_layers // 2,
num_layers - 3,
]
) # Specific layers for EAGLE3 support
else:
self.model.set_eagle3_layers_to_capture([val + 1 for val in layer_ids])
def set_dflash_layers_to_capture(self, layer_ids: list[int]):
if not self.pp_group.is_last_rank:
return
if layer_ids is None:
raise ValueError(
"DFLASH requires explicit layer_ids for aux hidden capture."
)
self.capture_aux_hidden_states = True
self.model.set_dflash_layers_to_capture([val + 1 for val in layer_ids])
EntryClass = Qwen3NextForCausalLM
View on GitHub (pinned to 0132848349)
Solutions
- Set explicit capture layers (--dflash-capture-layers or equivalent)
- Ensure the spec-decoding worker computes and forwards layer indices
Example fix
# before model.set_dflash_layers_to_capture(None) # after model.set_dflash_layers_to_capture([0, 2, 4])
Defensive patterns
Strategy: validation
Validate before calling
assert layer_ids, "DFLASH requires --dflash-capture-layers"
Prevention
- Set explicit capture layer ids in the DFLASH/spec config
When it happens
Trigger: Calling Qwen3NextForCausalLM.set_dflash_layers_to_capture(None) on the last pipeline rank while setting up DFLASH speculative decoding.
Common situations: DFLASH enabled without a capture-layer list in server args or speculative config for Qwen3-Next.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- DFLASH speculative decoding only supports CUDA and NPU devic
- Currently DFLASH speculative decoding does not support dp at
- Currently DFLASH speculative decoding only supports pp_size
- DFLASH speculative decoding requires setting --speculative-d
- DFLASH requires --speculative-dflash-block-size to be positi
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/dc7bfcdbbd701ecc.
Report an issue: GitHub.