Skip to navigation

nemo_automodel.components.models.flint.packing

View as Markdown

Flint text-token ownership across TE context and pipeline parallelism.

Module Contents

Functions

NameDescription
_prepare_inputs_for_cpChoose a shared text sharder while preserving PP’s global-id boundary.

API

nemo_automodel.components.models.flint.packing._prepare_inputs_for_cp(
batch: dict[str, typing.Any],
num_chunks: int
) -> dict[str, typing.Any]

Choose a shared text sharder while preserving PP’s global-id boundary.

Parameters:

model
FlintForCausalLM

Native model, possibly one pipeline stage, with optional CP mesh.

batch
dict[str, Any]

Global token tensors [B,S] and optional document lengths [B,N].

num_chunks
int

Number of independent pipeline microbatch token spaces.

Returns: dict[str, Any]

A model-owned sharder and padding metadata. Packed local indices have