vllm.model_executor.layers.fused_moe.experts.fused_humming_moe
¶
Fused MoE utilities for Humming.
Classes:
BatchedHummingGroupedExperts
¶
Bases: HummingExpertsBase
Methods:
-
apply–Standard apply implementation for Humming batched grouped experts.
apply(output, hidden_states, w1, w2, topk_weights, topk_ids, activation, global_num_experts, expert_map, a1q_scale, a2_scale, workspace13, workspace2, expert_tokens_meta, apply_router_weight_on_input)
¶
Standard apply implementation for Humming batched grouped experts.
Note: Humming kernels handle weights internally through the layer
object, so w1, w2, a2_scale are unused. a1q_scale is None on the usual
path (Humming quantizes the w13 input itself); for block-FP8 activations
it carries the scale computed before dispatch, which is forwarded to
process_input so Humming skips the redundant w13 quantization. The
output is written into the output tensor the modular kernel supplies.
HummingExpertsBase
¶
Bases: FusedMoEExpertsModular
Methods:
-
prepare_buffers–Views of the intermediate buffers in the workspaces. The final
Attributes:
-
expects_unquantized_inputs(bool) –Whether the prepare/finalize step should defer input quantization to
expects_unquantized_inputs
property
¶
Whether the prepare/finalize step should defer input quantization to the experts (by setting defer_input_quant=True and passing unquantized inputs).
Humming normally quantizes inputs internally via HummingExpertsBase.process_input() in apply(), so we defer quantization (return True) to avoid quantizing twice -- once in prepare and once in Humming's apply().
The exception is block-FP8 (group-128) activations, which are quantized before the dispatch to save interconnect bandwidth (see _prequantizes_dispatch_activation): for those we must NOT defer.
_init_buffer_layout()
¶
Precompute the M-independent part of get_buffer_metas.
_prequantizes_dispatch_activation()
¶
Whether the prepare/finalize step should quantize activations before the (EP all-to-all) dispatch instead of leaving it to Humming.
This is enabled only for block-FP8 (group-128) activations: quantizing to FP8 before dispatch sends FP8 rather than BF16 over the interconnect, and Humming then consumes the pre-quantized FP8 + scale directly (see the apply() methods, which forward the dispatch scale into HummingExpertsBase.process_input, which is a no-op when an input scale is already supplied). The scale layout produced by vLLM's block-FP8 quantization ([M, K // 128] float32, row-major) matches what the Humming WGMMA grouped GEMM expects.
prepare_buffers(workspace1, workspace2, M, topk, activation)
¶
Views of the intermediate buffers in the workspaces. The final
output (output, or down_output when batched) is supplied by the
modular kernel, so no view is made for it.
HummingGroupedExperts
¶
Bases: HummingExpertsBase
Methods:
-
apply–Standard apply implementation for Humming grouped experts.
apply(output, hidden_states, w1, w2, topk_weights, topk_ids, activation, global_num_experts, expert_map, a1q_scale, a2_scale, workspace13, workspace2, expert_tokens_meta, apply_router_weight_on_input)
¶
Standard apply implementation for Humming grouped experts.
Note: Humming kernels handle weights internally through the layer
object, so w1, w2, a2_scale are unused. a1q_scale is None on the usual
path (Humming quantizes the w13 input itself); for block-FP8 activations
it carries the scale computed before dispatch. It is permuted alongside
the tokens by moe_permute and forwarded to may_quant_input so Humming
skips the redundant w13 quantization. The output is written into the
output tensor the modular kernel supplies.
HummingIndexedExperts
¶
Bases: HummingExpertsBase
Methods:
-
apply–Standard apply implementation for Humming indexed experts.
apply(output, hidden_states, w1, w2, topk_weights, topk_ids, activation, global_num_experts, expert_map, a1q_scale, a2_scale, workspace13, workspace2, expert_tokens_meta, apply_router_weight_on_input)
¶
Standard apply implementation for Humming indexed experts.
Note: Humming kernels handle weights internally through the layer
object, so w1, w2, a2_scale are unused. a1q_scale is None on the usual
path (Humming quantizes the w13 input itself); for block-FP8 activations
it carries the scale computed before dispatch, which is forwarded to
process_input so Humming skips the redundant w13 quantization. The
output is written into the output tensor the modular kernel supplies.
_humming_fp8_weight_schema(layer, weight, weight_scale)
¶
Build the humming weight schema from the canonical on-device fp8/mxfp8 tensors (scale dtype/shape, block size), not the producing quant method.