unslothai/unsloth · error · ValueError

base_precision={base_precision!r} is not supported for minim

Error message

base_precision={base_precision!r} is not supported for minimax-h3: its packed sequence mixes video, audio and text through one set of linears, so the activation range fp8 was measured against does not apply. Use 'nf4', 'int8', 'bf16', or 'auto'.

What it means

MiniMax-H3 packs video, audio and text tokens through one shared set of transformer linears, so the per-family activation range the fp8 module filter was calibrated against does not describe it. Training with fp8 or mxfp8 quantization on that family could silently clip the forward pass, so the trainer fails fast instead.

Source

Thrown at studio/backend/core/training/diffusion_train_common.py:1125

            if repo_is_prequantized(self.base_model):
                raise ValueError(
                    f"base_precision={base_precision!r} needs a dense base repo, but "
                    f"'{self.base_model}' is already bitsandbytes-quantized. Pick the "
                    f"family's dense (bf16) base repo for this mode, or use nf4/auto."
                )
            if self.mixed_precision != "bf16":
                raise ValueError(
                    f"base_precision={base_precision!r} trains in bf16 compute; set "
                    f"mixed_precision to bf16."
                )
            # Refuse a scheme this family's DiT is known to corrupt, and also one the training bar holds back while
            # inference allows it: qwen-image fp8 now renders inside the accuracy gate, but no one has measured whether a
            # LoRA converges against fp8-frozen linears, so it fails fast here rather than silently training on faith.
            # MiniMax-H3 runs all three modalities through one set of linears, so the
            # per-family activation range the fp8 module filter was measured against does not
            # describe it. Refuse the float8 modes rather than train against a clipped forward.
            if resolved_family == "minimax-h3" and base_precision in ("fp8", "mxfp8"):
                raise ValueError(
                    f"base_precision={base_precision!r} is not supported for minimax-h3: its "
                    f"packed sequence mixes video, audio and text through one set of linears, "
                    f"so the activation range fp8 was measured against does not apply. Use "
                    f"'nf4', 'int8', 'bf16', or 'auto'."
                )
            # _family_train_denied, not _family_denied: it is the strict superset (every inference
            # deny plus the training-only ones), so importing the narrower helper here would let a
            # scheme cleared only for rendering reach a trainer.
            from core.inference.diffusion_transformer_quant import _family_train_denied

            if _family_train_denied(resolved_family, base_precision):
                raise ValueError(
                    f"base_precision={base_precision!r} is not validated for training "
                    f"{resolved_family}. Use 'nf4', 'int8', 'bf16', or 'auto'."
                )
        # flow_shift: None resolves to the family default ("auto" only for qwen-image, whose scheduler skips its static shift under use_dynamic_shifting); an explicit value is validated and kept.
        flow_shift = self.flow_shift
        if flow_shift is None:

View on GitHub (pinned to 203007d190)

Solutions

  1. Use base_precision='nf4', 'int8', 'bf16', or 'auto' for MiniMax-H3 training.
  2. If fp8 memory savings are required, train a different family (e.g. qwen-image) that validates fp8, or wait until MiniMax-H3 fp8 is measured.

Example fix

# before
cfg = DiffusionLoraConfig(base_model='MiniMax/MiniMax-H3', base_precision='fp8', mixed_precision='bf16')
# after
cfg = DiffusionLoraConfig(base_model='MiniMax/MiniMax-H3', base_precision='nf4')
Defensive patterns

Strategy: validation

Validate before calling

FP8_OK = {'qwen-image', 'flux', 'sdxl'}  # illustrative; keep in sync with the deny tables
def assert_family_precision(family, base_precision):
    if family == 'minimax-h3' and str(base_precision).lower() in ('fp8', 'mxfp8'):
        return 'nf4'  # or raise
    return base_precision

Prevention

When it happens

Trigger: Starting a training run with resolved_family == 'minimax-h3' and base_precision in ('fp8', 'mxfp8'), with mixed_precision='bf16' and a dense base repo (both earlier gates passed).

Common situations: Reusing a qwen-image or flux fp8 recipe against a MiniMax-H3 base; assuming fp8 support is uniform across DiT families after inference-side fp8 shipped.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/0b6788e4df9f729d. Report an issue: GitHub.