vllm.models.minimax_m3.common.dspark
¶
MiniMax-M3.1 DSpark draft model.
The Qwen3 DSpark block drafter (context-KV precompute, non-causal query block,
Markov and confidence heads) built from MiniMax-M3 layers: Gemma RMSNorm
(x * (1 + w)) everywhere, partial RoPE, and a dense SwiGLU-OAI MLP. The
checkpoint ships no token embedding or LM head; both are shared with the target.
Classes:
-
MiniMaxM3DSparkMLP–Dense SwiGLU-OAI MLP: gate * sigmoid(alpha * gate) * (up + beta).
-
MiniMaxM3DSparkModel–
Functions:
-
dspark_qknorm_rope_kv_insert–The fused QK-norm/RoPE on
qkv, also storing the draft tokens' k/v.
MiniMaxM3DSparkMLP
¶
Bases: Module
Dense SwiGLU-OAI MLP: gate * sigmoid(alpha * gate) * (up + beta).
Source code in vllm/models/minimax_m3/common/dspark.py
MiniMaxM3DSparkModel
¶
Bases: Qwen3DSparkModel
Methods:
-
precompute_and_store_context_kv–One kernel norms, ropes and stores the context K/V of every layer,
Source code in vllm/models/minimax_m3/common/dspark.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | |
_context_kv_writer()
¶
The fused context K/V writer, or None where the base path runs.
Source code in vllm/models/minimax_m3/common/dspark.py
precompute_and_store_context_kv(context_states, context_positions, context_slot_mapping=None)
¶
One kernel norms, ropes and stores the context K/V of every layer, straight from the projection output.
Source code in vllm/models/minimax_m3/common/dspark.py
_gemma_rms_norm(hidden_size, eps)
¶
The target's Gemma RMSNorm (fused FlashInfer kernels on CUDA).
vLLM's GemmaRMSNorm hands the IR op an fp32 1 + w weight, which the
vllm_c kernel rejects for bf16 inputs, so every call ran the unfused native
path (about ten kernels).
Source code in vllm/models/minimax_m3/common/dspark.py
_shared_slot_mapping(slot_mapping)
¶
The context slot mapping when every draft layer shares it, else None (dummy runs, and drafts whose layers span several KV cache groups).
Source code in vllm/models/minimax_m3/common/dspark.py
dspark_qknorm_rope_kv_insert(qkv, q_norm_weight, k_norm_weight, cos_sin_cache, positions, num_heads, num_kv_heads, rotary_dim, eps, q_fp8_out, layer_name)
¶
The fused QK-norm/RoPE on qkv, also storing the draft tokens' k/v.
A custom op so the slot mapping is read when it runs: read in the compiled forward, it is fixed at trace time, when the draft layers have none.