IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

BatchProcessor

BatchProcessor​

class max.pipelines.lib.interfaces.BatchProcessor(config, runtime)

source

Bases: ABC, Generic[ContextT, InputsT]

Batches pipeline contexts into model inputs and parses execution outputs.

Parameters:

get_symbolic_inputs()​

abstract get_symbolic_inputs(*, kv_params, device_refs)

source

Returns non-KV graph input types in execution order.

Parameters:

Return type:

list[TensorType | BufferType]

prepare_initial_token_inputs()​

abstract prepare_initial_token_inputs(replica_batches, kv_cache_inputs=None, return_n_logits=1)

source

Prepares inputs for the first execution step of a batch.

Parameters:

Return type:

InputsT

process_outputs()​

abstract process_outputs(outputs)

source

Maps raw Model.execute buffers to ModelOutputs.

Parameters:

outputs (Sequence[Buffer | object])

Return type:

ModelOutputs