Files
FreeToken/python/freetoken/layers/__init__.py
T
Xiaoze Fan 189c8ad0c3 feat(moe): serve NVFP4 and MXFP4 experts fused through the expert banks (#601)
* feat(moe): serve NVFP4 and MXFP4 experts fused through the expert banks

Resident experts skip the state dict and load through the offload expert-bank loader (HF pieces or FTW banks) into per-layer GPU banks, so fused serves bf16, fp8_block, NVFP4 and MXFP4 alike. Unified-memory GPUs auto-select fused for these formats and ignore offload-only flags with a warning.

BREAKING CHANGE: ft checkpoint always writes MoE experts as banks; an FTW converted with --moe-backend fused or triton (dense experts) no longer loads and must be reconverted.

* docs(moe): name only GB10 / DGX Spark for unified memory
2026-10-04 13:51:55 -07:00

63 lines
1.4 KiB
Python

from .activation import (
GATED_ACTIVATIONS,
gated_act_and_mul,
gelu_and_mul,
gelu_tanh_and_mul,
silu_and_mul,
swiglu_clamp_and_mul,
swigluoai_and_mul,
)
from .base import BaseOP, OPList, StateLessOP
from .embedding import ParallelLMHead, VocabParallelEmbedding
from .linear import (
LinearColParallelMerged,
LinearOProj,
LinearQKVMerged,
LinearReplicated,
LinearRowParallel,
)
from .moe import MoELayer, OffloadMoELayer, iter_moe_layers, make_moe_layer
from .norm import (
GatedRMSNorm,
GemmaPlusOneRMSNorm,
GemmaPlusOneRMSNormFused,
GemmaRMSNorm,
LayerNorm,
RMSNorm,
RMSNormFused,
)
from .rotary import get_rope, set_rope_device
__all__ = [
"silu_and_mul",
"gelu_and_mul",
"gelu_tanh_and_mul",
"swigluoai_and_mul",
"swiglu_clamp_and_mul",
"gated_act_and_mul",
"GATED_ACTIVATIONS",
"BaseOP",
"StateLessOP",
"OPList",
"VocabParallelEmbedding",
"ParallelLMHead",
"LinearColParallelMerged",
"LinearRowParallel",
"LinearOProj",
"LinearQKVMerged",
"LayerNorm",
"RMSNorm",
"RMSNormFused",
"GatedRMSNorm",
"GemmaRMSNorm",
"GemmaPlusOneRMSNorm",
"GemmaPlusOneRMSNormFused",
"get_rope",
"set_rope_device",
"LinearReplicated",
"MoELayer",
"OffloadMoELayer",
"iter_moe_layers",
"make_moe_layer",
]