Execution platforms¶
Execution platforms isolate hardware-specific capability detection, worker selection, patches, kernels, and configuration adjustments.
External platforms use Operator.register_oot(Implementation) before model construction and implement forward_oot. Overrides preserve the operator's constructor, parameters, and outputs; forward_native is the default fallback. Diffusion attention implementations dispatch external platforms to forward_oot the same way. Only SDPAImpl provides it so far; resolution rejects an explicitly selected backend whose implementation does not.
Candidate invariants¶
PLATFORM-INV-001: Capabilities are explicit¶
Rule: Hardware-dependent behavior MUST be guarded by platform selection or capability detection and MUST fail clearly when unsupported.
PLATFORM-INV-002: Portable code remains portable¶
Rule: Platform-neutral modules MUST NOT import a vendor implementation directly when a common selection interface exists.
PLATFORM-INV-003: Overrides are minimal¶
Rule: A platform implementation SHOULD override only behavior that differs from the common or upstream implementation.
Safe-change guide¶
Validate common import paths without the target accelerator and run focused tests in a fresh uv environment on every affected device platform.
MiniMax H3 image NPU adapter¶
The NPU model-patch hook defaults the image pipeline to single-tile VAE decoder graphs and the native FP32 encoder. Reduced encoder precision and tile batching are approximate and require explicit configuration. Multiple decoder streams remain an alternative to batching. Graph disable/eager overrides retain native VAE execution, and explicit batching/stream or FP32/batching conflicts are rejected. Implicit graphs fall back to native VAE execution with a warning when NPUGraph APIs are unavailable, TASK_QUEUE_ENABLE=2, or ASCEND_LAUNCH_BLOCKING=1. Explicit graph enablement rejects these conditions before installing wrappers. Environment variables must be fixed before NPU runtime initialization. Other platforms and pipelines retain their existing behavior. Graph buffers belong to the VAE instance, and weight relocation invalidates its captures. User configuration and precision limits are documented in the Ascend image guide.
H3 deterministic execution defaults on and restores the caller's enabled and warn-only modes when forward returns or raises. NPU internal formats and JIT compilation are disabled for graph-enabled forwards and restored on exit as well; setup does not modify them. npu_disable_internal_format and npu_disable_jit_compile independently apply the same forward-scoped settings to graph-off controls. Both options default to false. All three settings apply to the worker's full forward, including the DiT; runtime controls also work with determinism disabled. This preserves caller settings after failed initialization and inline engine teardown. Graph replica outputs are copied on the producer stream before reuse, then joined to the consumer stream.
AdaLN host staging defaults on only for the NPU H3 image pipeline when its projection cache is enabled, weights are unquantized and DiT offload/HSDP is absent. Explicit minimax_h3_adaln_offload=false keeps weights resident; existing CUDA SM120 defaults and other pipeline defaults are unchanged.