nemo_curator.backends.xenna.adapter
Module Contents
Classes
Functions
API
Bases: BaseStageAdapter, Stage
Adapts ProcessingStage to Xenna. Args: stage: ProcessingStage to adapt
Runtime environment for this stage.
Get the resources required for this stage.
Get the batch size for this stage.
Process batch of tasks with automatic performance tracking. Args: tasks: List of tasks to process Returns: List of processed tasks or None
Setup the stage per worker - Xenna-specific signature. This method is called by Xenna with its specific types. We convert them to our generic types and delegate to the base adapter. Args: worker_metadata: Xenna’s WorkerMetadata object
Setup the stage on a node - Xenna-specific signature. This method is called by Xenna with its specific types. We convert them to our generic types and delegate to the base adapter. Args: node_info: Xenna’s NodeInfo object worker_metadata: Xenna’s WorkerMetadata object
When we run a pipeline in Xenna, since we wrap using XennaStageAdapter, the stage name is shown as XennaStageAdapter. This is not what we want. So we create a dynamic subclass with the original stage’s name. This ensures that when Xenna calls type(adapter).name, it returns the original stage’s class name rather than ‘XennaStageAdapter’. Args: stage (ProcessingStage): ProcessingStage to adapt
Returns: XennaStageAdapter
XennaStageAdapter instance with the wrapped stage’s class name