LykosAI/StabilityMatrix · error · InvalidOperationException

Windows ROCm bitsandbytes is only supported on Python 3.12.x

Error message

Windows ROCm bitsandbytes is only supported on Python 3.12.x (detected version: {pyVersion}).

What it means

ExecuteBitsAndBytesAsync in InstallWindowsRocmPackageCommandStep enforces that the bitsandbytes wheels for Windows ROCm are built only against Python 3.12. Before downloading anything it calls EnsureRocmCompatibility() and then verifies the detected venv Python version is exactly 3.x with minor 12; otherwise it throws InvalidOperationException with the detected version embedded. This is a hard guard because the ROCm bitsandbytes wheels simply do not exist for other Python minor versions on Windows.

Solutions

  1. Recreate the package venv with Python 3.12 ( Stability Matrix: delete/rename the venv folder and let the package reinstall, or pick a Python 3.12 download in package preferences), then rerun the ROCm install step.
  2. Check the detected version in the exception message against `python --version` inside the package's venv and align the interpreter to 3.12.x.
  3. If 3.12 is impossible, install bitsandbytes ROCm manually via pip with a wheel matching your Python, bypassing this step.
  4. Report/request support for your Python version if upstream publishes matching ROCm wheels later.

Example fix

// before: venv built with 3.11, step throws
var pyVersion = await venvRunner.GetPythonVersionAsync();
// venvRunner: Python 3.11.9  -> InvalidOperationException

// after: recreate venv with Python 3.12
var pyVersion = await venvRunner.GetPythonVersionAsync();
// venvRunner: Python 3.12.4  -> check passes, bitsandbytes installs
Defensive patterns

Strategy: validation

Validate before calling

var pyVersion = await venvRunner.GetPythonVersionAsync(ct);
if (pyVersion.Major != 3 || pyVersion.Minor != 12)
    throw new InvalidOperationException(
        $"Windows ROCm bitsandbytes requires Python 3.12.x; venv has {pyVersion}. Recreate the venv with Python 3.12 before running the ROCm step.");

Type guard

bool IsPython312(Version v) => v.Major == 3 && v.Minor == 12;

Try / catch

try
{
    await step.ExecuteAsync(progress, ct);
}
catch (InvalidOperationException ex) when (ex.Message.Contains("Python 3.12"))
{
    logger.LogWarning(ex, "ROCm bitsandbytes step skipped: venv Python not 3.12.x");
    // surface guidance: recreate venv with Python 3.12
}

Prevention

When it happens

Trigger: Calling ExecuteAsync on an InstallWindowsRocmPackageCommandStep (the Windows ROCm package-modification step) whose target package venv runs a Python other than 3.12.x — e.g. a ComfyUI or SD package venv created with 3.10, 3.11, or 3.13 — reaches ExecuteBitsAndBytesAsync and hits the pyVersion.Major/Minor check.

Common situations: User installed a package with a default venv pinned to Python 3.10/3.11 (common for older Stability Matrix packages) and then runs the Windows ROCm AMD setup; user upgraded their Python or recreated the venv with a newer interpreter; the venv was rebuilt by a package update to 3.13 while the ROCm step still assumes 3.12 wheels.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/a038e0ff6a8a34c1. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Core/Models/PackageModification/InstallWindowsRocmPackageCommandStep.cs:213

                AttnQkInt8PerBlockCausalUrl,
                progress
            )
            .ConfigureAwait(false);
        await DownloadAndReplaceFileAsync(sageAttentionDir, "quant_per_block.py", QuantPerBlockUrl, progress)
            .ConfigureAwait(false);
    }

    private async Task ExecuteBitsAndBytesAsync(
        IPyVenvRunner venvRunner,
        PyVersion pyVersion,
        IProgress<ProgressReport>? progress
    )
    {
        EnsureRocmCompatibility();

        if (pyVersion.Major != 3 || pyVersion.Minor != 12)
        {
            throw new InvalidOperationException(
                $"Windows ROCm bitsandbytes is only supported on Python 3.12.x (detected version: {pyVersion})."
            );
        }

        progress?.Report(
            new ProgressReport(-1f, "Installing bitsandbytes for Windows ROCm...", isIndeterminate: true)
        );
        await venvRunner.PipInstall(BitsAndBytesWheelUrl).ConfigureAwait(false);
    }

    private async Task ExecuteFlashAttentionAsync(
        IPyVenvRunner venvRunner,
        IProgress<ProgressReport>? progress
    )
    {
        EnsureRocmCompatibility();

        progress?.Report(

View on GitHub (pinned to af93d6ef57)