2noise/ChatTTS · error · ValueError

dtype '{dtype}' is not supported in ROCm. Supported dtypes a

Error message

dtype '{dtype}' is not supported in ROCm. Supported dtypes are {rocm_supported_dtypes}

What it means

vLLM-style engine config rejects float32 on ROCm (HIP) builds: the ROCm kernels in this fork only support a subset of dtypes, and float32 is explicitly excluded via _ROCM_NOT_SUPPORTED_DTYPE. The check happens in ModelConfig.__init__ while resolving the 'dtype' argument (default 'auto') against the torch dtype. The error message lists the dtypes that ARE allowed on ROCm.

Source

Thrown at ChatTTS/model/velocity/configs.py:470

                torch_dtype = torch.float16
            else:
                torch_dtype = config_dtype
        else:
            if dtype not in _STR_DTYPE_TO_TORCH_DTYPE:
                raise ValueError(f"Unknown dtype: {dtype}")
            torch_dtype = _STR_DTYPE_TO_TORCH_DTYPE[dtype]
    elif isinstance(dtype, torch.dtype):
        torch_dtype = dtype
    else:
        raise ValueError(f"Unknown dtype: {dtype}")

    if is_hip() and torch_dtype == torch.float32:
        rocm_supported_dtypes = [
            k
            for k, v in _STR_DTYPE_TO_TORCH_DTYPE.items()
            if (k not in _ROCM_NOT_SUPPORTED_DTYPE)
        ]
        raise ValueError(
            f"dtype '{dtype}' is not supported in ROCm. "
            f"Supported dtypes are {rocm_supported_dtypes}"
        )

    # Verify the dtype.
    if torch_dtype != config_dtype:
        if torch_dtype == torch.float32:
            # Upcasting to float32 is allowed.
            pass
        elif config_dtype == torch.float32:
            # Downcasting from float32 to float16 or bfloat16 is allowed.
            pass
        else:
            # Casting between float16 and bfloat16 is allowed with a warning.
            logger.warning(f"Casting {config_dtype} to {torch_dtype}.")

    return torch_dtype

View on GitHub (pinned to 77b89ee281)

Solutions

  1. Pass a supported dtype such as dtype='float16' or dtype='bfloat16' when constructing the engine/model.
  2. If you relied on 'auto', explicitly set a half-precision dtype because the resolved dtype became float32 on your ROCm build.
  3. Verify you actually intended ROCm: on NVIDIA hardware is_hip() is False and float32 works; a ROCm torch build on an NVIDIA machine triggers this falsely - install a CUDA build instead.

Example fix

# before
engine = LLM(model=path, dtype='float32')

# after
engine = LLM(model=path, dtype='float16')
Defensive patterns

Strategy: validation

Validate before calling

import torch
from ChatTTS.model.velocity.configs import _ROCM_NOT_SUPPORTED_DTYPE, _STR_DTYPE_TO_TORCH_DTYPE

def resolve_rocm_dtype(dtype):
    if not torch.version.hip:
        return dtype
    allowed = {k for k in _STR_DTYPE_TO_TORCH_DTYPE if k not in _ROCM_NOT_SUPPORTED_DTYPE}
    return dtype if dtype in allowed else 'float16'

Try / catch

try:
    engine = LLM(model=path, dtype=dtype)
except ValueError as e:
    if 'not supported in ROCm' in str(e):
        engine = LLM(model=path, dtype='float16')
    else:
        raise

Prevention

When it happens

Trigger: Calling the engine/model constructor on an AMD GPU with dtype='float32' or torch.float32 (or a config whose resolved auto dtype is float32) while is_hip() is True.

Common situations: Running vLLM-derived code on AMD MI GPUs; user copies a CUDA float32 recipe to an ROCm box; ChatTTS velocity engine loaded with explicit float32 for reproducibility.

Related errors


AI-assisted analysis of 2noise/ChatTTS@77b89ee281 (2026-08-26). Data as JSON: /api/errors/ae9ca89972e18f0a. Report an issue: GitHub.