> This page is for version Latest.
> For other versions, use one of these documentation indexes:
> - Nightly (default): https://docs.nvidia.com/nemo/automodel/nightly/llms.txt
> - Latest: https://docs.nvidia.com/nemo/automodel/latest/llms.txt
> - 0.7.0 · 26.10: https://docs.nvidia.com/nemo/automodel/v0.7/llms.txt
> - 0.5.0 · 26.06: https://docs.nvidia.com/nemo/automodel/v0.5/llms.txt
> - 0.4.0 · 26.04: https://docs.nvidia.com/nemo/automodel/v0.4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.

# nemo_automodel.components.models.glm5_next.backend

Runtime backend configuration owned by GLM-5.3-Flash.

## Module Contents

### Classes

| Name                                                                                                 | Description                                                        |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`Glm5NextBackendConfig`](#nemo_automodel-components-models-glm5_next-backend-Glm5NextBackendConfig) | Select mHC Sinkhorn independently of the sparse-attention backend. |

### Data

[`Glm5NextIndexerBackend`](#nemo_automodel-components-models-glm5_next-backend-Glm5NextIndexerBackend)

[`Glm5NextSinkhornBackend`](#nemo_automodel-components-models-glm5_next-backend-Glm5NextSinkhornBackend)

### API

```python
class nemo_automodel.components.models.glm5_next.backend.Glm5NextBackendConfig(
    attn: nemo_automodel.components.models.common.utils.AttentionBackend = 'te' if HAVE_TE and torch.c...,
    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...,
    nccl_ep: nemo_automodel.components.moe.config.NcclEpConfig = NcclEpConfig(),
    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',
    mok: nemo_automodel.components.models.common.utils.MoKBackendConfig = MoKBackendConfig(),
    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,
    te_fp8: nemo_automodel.components.models.common.utils.TEFp8Config | None = None,
    te_nvfp4: nemo_automodel.components.models.common.utils.TENvfp4Config | None = None,
    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,
    cuda_graph: nemo_automodel.components.models.common.utils.CudaGraphConfig = CudaGraphConfig(),
    sinkhorn: nemo_automodel.components.models.glm5_next.backend.Glm5NextSinkhornBackend = 'torch',
    indexer: nemo_automodel.components.models.glm5_next.backend.Glm5NextIndexerBackend = 'torch'
)
```

Dataclass

**Bases:** [BackendConfig](/nemo/automodel/latest/nemo-automodel/nemo_automodel/components/models/common/utils#nemo_automodel-components-models-common-utils-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.

---

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

```python
nemo_automodel.components.models.glm5_next.backend.Glm5NextBackendConfig.from_backend(
    backend: nemo_automodel.components.models.common.BackendConfig
) -> nemo_automodel.components.models.glm5_next.backend.Glm5NextBackendConfig
```

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.

```python
nemo_automodel.components.models.glm5_next.backend.Glm5NextIndexerBackend = Literal['torch', 'cudnn']
```

```python
nemo_automodel.components.models.glm5_next.backend.Glm5NextSinkhornBackend = Literal['torch', 'tilelang']
```