Skip to navigation

nemo_automodel.components.models.glm5_next.backend

View as MarkdownOpen in Claude

Runtime backend configuration owned by GLM-5.3-Flash.

Module Contents

Classes

NameDescription
Glm5NextBackendConfigSelect mHC Sinkhorn independently of the sparse-attention backend.

Data

Glm5NextIndexerBackend

Glm5NextSinkhornBackend

API

class nemo_automodel.components.models.glm5_next.backend.Glm5NextBackendConfig(
sparse_attn: typing.Literal['generic', 'msa'] = 'generic',
linear: typing.Literal['torch', 'te', 'quack'] = 'te' if HAVE_TE and torch.c...,
rms_norm: typing.Literal['torch', 'torch_fp32', 'te', 'quack'] = 'torch_fp32',
rope: typing.Literal['torch', 'quack', 'triton'] = 'torch',
rope_fusion: bool = HAVE_TE and torch.cuda.is_a...,
experts: typing.Literal['torch', 'te', 'gmm', 'torch_mm', 'torch_mm_mxfp8'] = 'torch_mm' if torch.cuda.is...,
dispatcher: typing.Literal['torch', 'deepep', 'hybridep', 'uccl_ep', 'nccl_ep', 'mok'] = 'deepep' if HAVE_DEEP_EP an...,
te_grouped_tensor: bool = False,
dispatcher_num_sms: int = 20,
dispatcher_share_token_dispatcher: bool = True,
dispatcher_async_dispatch: bool = False,
dispatcher_capacity_factor: float | None = None,
dispatcher_equal_token_counts: bool = False,
dispatcher_recompute_cache: str = 'none',
dispatcher_hybridep_permute_fusion: bool = False,
dispatcher_hybridep_compact_routing: bool = False,
dispatcher_hybridep_num_sms_preprocessing: int | None = None,
dispatcher_hybridep_num_blocks_permute: int | None = None,
dispatcher_hybridep_num_blocks_unpermute: int | None = None,
dispatcher_hybridep_max_tokens_per_rank: int | None = None,
enable_deepep: bool | None = None,
fake_balanced_gate: bool = False,
fake_gate_noise: float = 0.0,
enable_hf_state_dict_adapter: bool = True,
enable_fsdp_optimizations: bool = False,
gate_precision: str | torch.dtype | None = None,
compile_attn: bool = False,
compile_situ: bool = False,
compile_norm: bool = False,
compile_hc: bool = False,
shared_expert_overlap: bool = False,
compile_router_weight: bool = False,
benchmark_static_routing: bool = False,
)
Dataclass

Bases: BackendConfig

Select mHC Sinkhorn independently of the sparse-attention backend.

indexer
Glm5NextIndexerBackend = 'torch'

Score generation for KPool selection. The cuDNN option keeps BF16 projections and PyTorch top-k, and requires CUDA and cuDNN DSA.

sinkhorn
Glm5NextSinkhornBackend = 'torch'

"torch" preserves eager FP32 normalization. "tilelang" requires CUDA and the optional TileKernels package; an unavailable kernel raises instead of silently falling back to PyTorch.

nemo_automodel.components.models.glm5_next.backend.Glm5NextBackendConfig.__post_init__() -> None
classmethod

Return a private GLM config carrying backend’s values.

The model accepts the shared BackendConfig, which has no sinkhorn or indexer field; those take their "torch" defaults here, once, so layers read them directly. Every shared field is copied by value, and __post_init__ re-validates it.

Parameters:

backend
BackendConfig

A shared BackendConfig or a Glm5NextBackendConfig.

Returns: Glm5NextBackendConfig

A new Glm5NextBackendConfig; a Glm5NextBackendConfig input is shallow-copied.

nemo_automodel.components.models.glm5_next.backend.Glm5NextIndexerBackend = Literal['torch', 'cudnn']
nemo_automodel.components.models.glm5_next.backend.Glm5NextSinkhornBackend = Literal['torch', 'tilelang']