vllm.model_executor.layers.quantization.utils.humming
¶
Humming quantization integration.
Modules:
-
activation–MoE activation expressions for Humming input processing.
-
linear–Prepare and execute Humming linear layers.
-
moe–Configure, prepare weights for, and assemble Humming MoE kernels.
-
schema–Map Humming schemas and handle shared checkpoint quantization settings.
Functions:
-
convert_linear_layer_to_humming_standard–Rename/reshape a linear layer's quantized params (the canonical MPLinear
-
convert_to_humming_moe_kernel_format–Convert MoE weights from checkpoint format to Humming kernel format.
-
select_humming_moe_experts–Select the primary Humming MoE Experts class
convert_linear_layer_to_humming_standard(layer, name_map)
¶
Rename/reshape a linear layer's quantized params (the canonical MPLinear
layout: weight_packed int32 + weight_scale) into the parameter names
and layout humming's weight schema expects (weight / weight_scale).
Source code in vllm/model_executor/layers/quantization/utils/humming/linear.py
convert_to_humming_moe_kernel_format(layer, quant_config=None, sublayer_configs=None, weight_schema=None, input_schema=None, force_weight_schema=None, allow_input_schema_fallback=True)
¶
Convert MoE weights from checkpoint format to Humming kernel format.
This function processes weights for each sublayer (w13, w2) by: 1. Converting from checkpoint format to humming format if needed 2. Force requanting if a different quantization schema is specified 3. Preparing layer metadata for the Humming kernel 4. Transforming weights for inference
Parameters:
-
(layer¶RoutedExperts) –The RoutedExperts layer containing weights to process
-
(quant_config¶dict | None, default:None) –Optional quantization config dict. Required if weight_schema or input_schema are None. Used to build schemas via BaseWeightSchema.from_config().
-
(sublayer_configs¶dict[str, Any] | None, default:None) –Optional configuration dict for each sublayer (w13, w2). Each config must have "shape_n" and "shape_k" keys. If None, configs are built from layer.moe_config properties.
-
(weight_schema¶Any | None, default:None) –Optional initial weight quantization schema. If None, built from quant_config.
-
(input_schema¶Any | None, default:None) –Optional initial input quantization schema. If None, built from quant_config or env vars.
-
(force_weight_schema¶Any | None, default:None) –Optional schema to force requantization to
-
(allow_input_schema_fallback¶bool, default:True) –Whether incompatible input schemas may be replaced.
Side effects
- Modifies layer parameters in place
- Sets layer.weight_schemas and layer.input_schemas
- Sets layer.humming_configs for quant config construction
Source code in vllm/model_executor/layers/quantization/utils/humming/moe.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 | |
select_humming_moe_experts(config, weight_key, activation_key)
¶
Select the primary Humming MoE Experts class Note: Shape-specific fallbacks may still occur at runtime.