nemo_automodel.components.models.hy_v4_flash.flops
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 mostindex_topk / index_kpool - 1closed 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_topkonly project their token keys; - the MoE router, latent projections,
top_krouted 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
API
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.