Raises:
NotImplementedError: If model parallelism or pipeline batch sharing is enabled.
"""
parallel_sizes = {
"tp_size": int(getattr(mesh_context, "tp_size", 1)),
"cp_size": int(getattr(mesh_context, "cp_size", 1)),
"pp_size": int(getattr(mesh_context, "pp_size", 1)),
}
unsupported_sizes = {name: size for name, size in parallel_sizes.items() if size != 1}
if unsupported_sizes:
raise NotImplementedError(
"The temporary VLM batch path requires TP=CP=PP=1, but got "
+ ", ".join(f"{name}={size}" for name, size in unsupported_sizes.items())
)
if pp_shared_data:
raise NotImplementedError("The temporary VLM batch path does not support pp_shared_data")
self.device = device
self.processor = VLMBatchProcessor()
def __call__(
self,
data_iterator: Any,
*,
external_batch: Mapping[str, Any] | None = None,