{"record":{"id":"81fc1068fa6cd4d4","repo":"unslothai/unsloth","slug":"base-precision-mode-r-is-not-available-on-this-h","errorCode":null,"errorMessage":"base_precision={mode!r} is not available on this host: torchao is the non-functional Windows-ROCm stub. Use base_precision='nf4', 'bf16', or 'auto'.","messagePattern":"base_precision=(.+?) is not available on this host: torchao is the non-functional Windows-ROCm stub\\. Use base_precision='nf4', 'bf16', or 'auto'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/training/diffusion_dit_trainer.py","lineNumber":557,"sourceCode":"    mode = (cfg.base_precision or \"nf4\").strip().lower()\n    if mode != \"auto\":\n        if mode in (\"bf16\", \"int8\", \"fp8\", \"mxfp8\") and device != \"cuda\":\n            raise ValueError(\n                f\"base_precision={mode!r} needs a CUDA GPU; this host has none. \"\n                f\"Use base_precision='nf4' or 'auto'.\"\n            )\n        # int8 has no runtime fallback, so an explicit int8 against a missing torchao (or the Windows-ROCm stub) would leave the\n        # transformer dense with compile disabled. The auto pick and /info gate on a FUNCTIONAL torchao; do the same here.\n        if mode == \"int8\" and not has_functional_torchao():\n            raise ValueError(\n                \"base_precision='int8' needs a functional torchao install; this host's \"\n                \"torchao is missing or the non-functional Windows-ROCm stub. Use \"\n                \"base_precision='nf4', 'bf16', or 'auto'.\"\n            )\n        # The stub answers torchao.float8 / torchao.prototype.mx_formats with a no-op that reports success, so the run would report fp8 while training bf16.\n        # Keyed on the stub, not has_functional_torchao(): that probes int8's symbols, and a real-but-partial torchao must still reach the arch checks below.\n        if mode in (\"fp8\", \"mxfp8\") and is_stubbed(\"torchao\"):\n            raise ValueError(\n                f\"base_precision={mode!r} is not available on this host: torchao is the \"\n                \"non-functional Windows-ROCm stub. Use base_precision='nf4', 'bf16', or 'auto'.\"\n            )\n        # mxfp8 needs Blackwell (sm100+): its MX GEMM raises at the first training step, after a full dense load. Re-check here to fail fast for a stale client.\n        if mode == \"mxfp8\" and device == \"cuda\":\n            try:\n                import torch\n                blackwell = torch.cuda.get_device_capability() >= (10, 0)\n            except Exception:  # noqa: BLE001 -- probe failure -> treat as unsupported, fail fast\n                blackwell = False\n            if not blackwell:\n                raise ValueError(\n                    \"base_precision='mxfp8' needs a Blackwell (sm100+) GPU; this GPU is older. \"\n                    \"Use base_precision='bf16', 'int8', 'nf4', or 'auto'.\"\n                )\n        return mode\n    # auto may only resolve to the dense modes when the run uses bf16 compute, mirroring the normalized() rule for explicit dense modes; otherwise stay on the nf4 floor.\n    if getattr(cfg, \"mixed_precision\", \"bf16\") != \"bf16\":","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/training/diffusion_dit_trainer.py#L539-L575","documentation":"Raised by _resolve_base_precision() when base_precision is 'fp8' or 'mxfp8' and is_stubbed(\"torchao\") is True. The Windows-ROCm stub answers torchao.float8 / torchao.prototype.mx_formats with a no-op that reports success, so without this guard the run would claim fp8 while actually training bf16. The check is keyed on the stub specifically (not has_functional_torchao) so a real-but-partial torchao install still proceeds to the later architecture checks.","triggerScenarios":"Explicitly setting base_precision='fp8' or 'mxfp8' on a Windows-ROCm host whose torchao is the stub package; a stale or direct client sending an fp8/mxfp8 request that /info would never advertise on such a host.","commonSituations":"Windows + AMD ROCm environments that ship the no-op torchao stub; reinstalling torch over a stubbed environment; configs exported from an NVIDIA host reused on a ROCm box.","solutions":["Switch base_precision to 'nf4', 'bf16', or 'auto', which are the modes actually available on this host.","If you need real fp8/mxfp8, run on a supported CUDA host with a genuine torchao install (and for mxfp8, a Blackwell GPU).","Uninstall the stub and install a genuine torchao if one exists for your platform, then retry."],"exampleFix":"# before\ncfg.base_precision = \"fp8\"  # torchao is the Windows-ROCm stub\n\n# after\ncfg.base_precision = \"bf16\"  # functional on this host without torchao","handlingStrategy":"validation","validationCode":"from importlib.util import find_spec\n\ndef torchao_stubbed() -> bool:\n    spec = find_spec(\"torchao\")\n    return spec is None or spec.origin is None or \"stub\" in (spec.origin or \"\")","typeGuard":null,"tryCatchPattern":"try:\n    mode = _resolve_base_precision(cfg, spec, device)\nexcept ValueError as e:\n    if \"Windows-ROCm stub\" in str(e):\n        cfg.base_precision = \"bf16\"\n        mode = _resolve_base_precision(cfg, spec, device)\n    else:\n        raise","preventionTips":["On Windows-ROCm hosts, restrict the precision picker to nf4/bf16/auto.","Trust the /info endpoint's advertised modes rather than hardcoding a client-side list."],"tags":["torchao","rocm","windows","quantization"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}