nemo_curator.backends.base
nemo_curator.backends.base
Module Contents
Classes
Functions
API
Executor for a pipeline.
Execute the pipeline.
Adapts ProcessingStage to an execution backend, if needed.
Assign a deterministic task_id (parent id + own segment) to every
emitted task. Runs once per stage on every backend, so process vs
process_batch makes no difference; ids are re-derived at each stage
boundary, so one object passing through N stages gets N ids.
- single input → fan-out: each output is
parent_<seg> len(output) == len(input)→ positional 1:1:parent_i_<seg>; aNoneTaskslot means inputiwas filtered (kept for alignment, then dropped from the result)- any other cardinality → a random
"r"-prefixed uuid (non-deterministic, ancestry-not-tracked; seeTask.task_id)
seg is the content id (get_deterministic_id()) for a source stage,
else the positional index. A stage that both filters and fans out in one
batch can’t be mapped positionally and falls to the "r" case — return
one value (or None) per input to stay positional.
Source stage: each output is a source partition; its _source_id is
Task.get_source_id(). Drop already-completed sources; each survivor fires +1.
Process a batch of tasks.
Parameters:
List of tasks to process
Returns: list[Task]
list[Task]: List of processed tasks
Setup the stage once per actor.
Parameters:
Information about the worker
Setup the stage on a node.
Parameters:
Information about the node
Information about the worker
Teardown the stage once per actor.
Generic node information for setup_on_node calls across backends. Simplified to match Xenna’s structure.
Generic worker metadata for setup_on_node calls across backends. Simplified to match Xenna’s structure. The allocation field can contain backend-specific allocation information.
A payload-less marker (NoneTask/FailedTask), stripped before the next stage.