huggingface/transformers · error · ValueError
not supported filetype
Error message
not supported filetype
What it means
`deepgemm_fp8_fp4_experts_forward` refuses to run when the model spans more than one CUDA device in a single process (`_deepgemm_disabled` was set at load time by the FP8 quantizer). DeepGEMM kernels are bound to a single CUDA context and would corrupt results across devices, so multi-GPU `device_map='auto'` + DeepGEMM experts is hard-disabled at load.
Source
Thrown at src/transformers/audio_utils.py:173
b"caff": "caf",
b".snd": "au",
b"#!AMR": "amr",
b"wvpk": "wv",
b".SoX": "sox",
b"XoS.": "sox",
b"Creative Voice File": "voc",
b"\x64\xa3\x01\x00": "sf",
b"\x00\x01\xa3\x64": "sf",
b"\x0b\x77": "ac3",
b"\x00\x00\x01\xba": "mpg",
b"FLV": "flv",
b"ID3": "mp3",
}
for sig, filetype in signatures.items():
if head.startswith(sig):
return filetype
raise ValueError("not supported filetype")
def _resolve_audio_source(audio: str, timeout: float | None = None) -> "str | bytes":
"""Resolve an audio source string to a local file path or raw bytes for a decoder.
Accepts `http(s)://` URLs (fetched with retry), local file paths (returned unchanged),
and base64 strings (optionally wrapped as a `data:...` URI).
"""
if audio.startswith(("http://", "https://")):
return _fetch_audio_bytes(audio, timeout=timeout)
if os.path.isfile(audio):
return audio
# Not a URL or a local path — assume base64, optionally wrapped as a `data:<media-type>;base64,` URI
if audio.startswith("data:"):
audio = audio.split(",", 1)[1]
try:
return base64.b64decode(audio)
except Exception as e:View on GitHub (pinned to a597f97485)
Solutions
- Use true multi-process parallelism (TP/EP via accelerate: `accelerate launch` with a parallelism config, one device per process)
- Or run the model on a single GPU (enough memory) so DeepGEMM stays enabled
- Or explicitly choose `experts_implementation='grouped_mm'` which is safe across devices in one process
Example fix
# before
model = AutoModelForCausalLM.from_pretrained(
"deepseek-ai/DeepSeek-V3", device_map="auto" # 2+ GPUs in one process
) # -> RuntimeError at forward
# after
# option A: accelerate TP/EP (one GPU per process)
# accelerate launch --num_processes 8 run_infer.py
# option B: grouped_mm experts
model.set_experts_implementation("grouped_mm") Defensive patterns
Strategy: validation
Validate before calling
cuda_ids = torch.cuda.device_count()
if cuda_ids > 1: # single process, multiple devices
experts_impl = "grouped_mm" # safe in-process
# or plan real TP/EP with accelerate instead of device_map="auto"
device_map = "auto" if cuda_ids == 1 else None Try / catch
try:
out = model(input_ids)
except RuntimeError as e:
if "multiple CUDA devices" in str(e):
model.set_experts_implementation("grouped_mm")
out = model(input_ids)
else:
raise Prevention
- Use accelerate TP/EP (one process per GPU) for multi-GPU DeepGEMM MoE
- Prefer single-GPU or explicit parallelism over device_map='auto' sharding for these models
- Check device_count and quantizer notes before selecting deepgemm experts
When it happens
Trigger: `from_pretrained(..., device_map='auto')` sharding a DeepSeek-style FP4/FP8 MoE model over 2+ GPUs in one process, with the deepgemm experts implementation selected (default for supported checkpoints).
Common situations: Fitting a 671B model on 2–8 GPUs via device_map auto on a single node instead of tensor/expert parallel; notebooks pipelines that shard across visible GPUs.
Related errors
- function {activation_string} not found in ACT2FN mapping {li
- Incorrect audio source. Must be a valid URL starting with `h
- Incorrect format used for `audio`. Should be a numpy array o
- Unknown backend {backend!r}; expected 'auto', 'torchcodec',
- The audio source is a '{filetype}' file, which librosa canno
AI-assisted analysis of huggingface/transformers@a597f97485 (2026-08-14).
Data as JSON: /api/errors/0e4d1ddcfa5d7c45.
Report an issue: GitHub.