sgl-project/sglang · error · ValueError
keyframe_frame_indices must be omitted when keyframe cond…
Error message
keyframe_frame_indices must be omitted when keyframe cond is not included
What it means
Raised in packed-sequence construction when keyframe_frame_indices is provided but the conditions contain no keyframe cond. Only keyframe conditions may carry keyframe_frame_indices; remove it or add the keyframe condition.
Solutions
- Pass keyframe_frame_indices=None whenever include_keyframe_cond=False
- In config handling, derive indices from the include flag
- Add a config lint rejecting the combination
Example fix
# before seq = minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=[0, 8]) # after seq = minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=None)
Defensive patterns
Strategy: validation
Validate before calling
if not include_keyframe_cond:
assert keyframe_frame_indices is None, 'indices must be omitted when cond disabled' Try / catch
except ValueError as e: drop indices and rebuild the sequence
Prevention
- Derive indices from the include flag in config code
When it happens
Trigger: Calling minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=[0]) — indices present while keyframe conditioning is off.
Common situations: Config merging that defaults indices in regardless of mode; disabling keyframe cond late without clearing the indices setting.
Related errors
- adaln out_features mismatch
- H3 conditioning projection expects encoder width
- H3 conditioning projection must output width
- inverse_indices must be
- MiniMax H3 attention heads must be divisible by TP size
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/ae15799ae9affa1d.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/packed_sequence.py:45
MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES,
)
_INTERP = 32
_T_GROUP = 5
_FRAME_PER_TOKEN = (1, 4, 4, 4, 4)
_FRAME_RESCALE = 5.0 / 3.0
_PATCH_H = 2
_PATCH_W = 2
def _keyframe_cond_frame_indices(
*,
include_keyframe_cond: bool,
keyframe_frame_indices: list[int] | tuple[int, ...] | None,
) -> list[int]:
if not include_keyframe_cond:
if keyframe_frame_indices is not None:
raise ValueError(
"keyframe_frame_indices must be omitted when keyframe cond is not included"
)
return []
if keyframe_frame_indices is None:
raise ValueError("strict fl2va packed layout requires keyframe_frame_indices")
if any(
isinstance(value, bool) or not isinstance(value, int)
for value in keyframe_frame_indices
):
raise ValueError(
"strict fl2va packed layout requires integer keyframe_frame_indices"
)
out = list(keyframe_frame_indices)
if tuple(out) not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:
raise ValueError(
"strict fl2va packed layout requires keyframe_frame_indices in "
f"{MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got {out!r}"
)View on GitHub (pinned to 0132848349)