flashinfer.fused_moe.MoEWeightPack

class flashinfer.fused_moe.MoEWeightPack(native_views: ~typing.Dict[str, ~typing.Dict[str, ~torch.Tensor]] = <factory>)

Long-lived weight container with per-backend native materializations.

Each backend’s native weight layout (quantized, swizzled, MMA-ordered, etc.) is stored under its backend_key. Populated once at model-load / layer-init via prepare_for(key, view); read on every call via get_view(key).

Holding multiple materializations is intentional — that’s the memory cost the user pays for cross-backend autotune. Each view is the exact kwargs dict that runner’s forward expects for weight-side arguments.

__init__(native_views: ~typing.Dict[str, ~typing.Dict[str, ~torch.Tensor]] = <factory>) None

Methods

__init__([native_views])

get_view(backend_key)

prepare_for(backend_key, view)

Register a backend-native weight view.

Attributes

native_views