nemo_automodel.components.models.step5.flops
nemo_automodel.components.models.step5.flops
Effective Step-5 text FLOPs, including CSA’s forward-only discrete indexer.
Module Contents
Functions
API
Count independent documents; each length excludes physical pack padding.
Sum complete historical regions for document-local queries zero through length-1.
Count Step-5 text training GEMMs for independent, fully supervised documents.
The count includes trainable linear/attention forward and backward (6 x MACs) and the forward-only indexer (2 x MACs). Embedding lookup, norms, activations, rotary/softmax elementwise work, vision, MTP, optimizer work, kernel padding, masked indexer scores and activation recomputation are excluded. A CSA query at position t sees region_size * min(topk, floor(t / region_size)) historical tokens plus t % region_size + 1 tokens in its current region.
Parameters:
Actual complete text configuration, before pipeline layer partitioning.
Number of independent documents.
Tokens per document; defaults to max_position_embeddings.
Returns: float
Effective training FLOPs with all document tokens supervised.