> 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.hy_v4_flash.flops

Model FLOPs of Hy4-flash, in the repository's convention (6 x MACs, causal-aware, recompute excluded).

Registered through `HYV4FlashConfig.flops_formula` so no shared utility names this model. Counted per token:

* the expanded MLA linears of every layer (the absorbed kernel's extra work is hardware FLOPs, not model FLOPs);
* the QK^T and PV products over `min(i + 1, window)` keys in sliding layers and, in sparse layers, over the query's
  own partial pool plus at most `index_topk / index_kpool - 1` closed pools;
* the frozen compressed indexer on sparse layers, forward only (2 x MACs: a hard top-k has no gradient); documents
  no longer than `index_topk` only project their token keys;
* the MoE router, latent projections, `top_k` routed experts and the shared expert (a dense MLP in layer 0);
* two hyper-connection sites per layer and the head, the Engram projections, and the fp32 `lm_head`.

The vision tower, table gathers, hashing, norms, RoPE and gating are not counted.

## Module Contents

### Functions

| Name                                                                                         | Description                                                              |
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`hy_v4_flash_flops`](#nemo_automodel-components-models-hy_v4_flash-flops-hy_v4_flash_flops) | Model FLOPs of one training step of `gbs` sequences of `seq_len` tokens. |

### API

```python
nemo_automodel.components.models.hy_v4_flash.flops.hy_v4_flash_flops(
    config: nemo_automodel.components.models.hy_v4_flash.config.HYV4FlashConfig | nemo_automodel.components.models.hy_v4_flash.config.HYV4FlashTextConfig,
    gbs: int = 1,
    seq_len: int | None = None
) -> float
```

Model FLOPs of one training step of `gbs` sequences of `seq_len` tokens.

`config` is the composite or the text configuration; `seq_len` defaults to `max_position_embeddings`.
Trainable GEMMs and attention products count 6 x MACs, the frozen indexer 2 x MACs.