{"record":{"id":"0e4d1ddcfa5d7c45","repo":"huggingface/transformers","slug":"not-supported-filetype","errorCode":null,"errorMessage":"not supported filetype","messagePattern":"not supported filetype","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/audio_utils.py","lineNumber":173,"sourceCode":"        b\"caff\": \"caf\",\n        b\".snd\": \"au\",\n        b\"#!AMR\": \"amr\",\n        b\"wvpk\": \"wv\",\n        b\".SoX\": \"sox\",\n        b\"XoS.\": \"sox\",\n        b\"Creative Voice File\": \"voc\",\n        b\"\\x64\\xa3\\x01\\x00\": \"sf\",\n        b\"\\x00\\x01\\xa3\\x64\": \"sf\",\n        b\"\\x0b\\x77\": \"ac3\",\n        b\"\\x00\\x00\\x01\\xba\": \"mpg\",\n        b\"FLV\": \"flv\",\n        b\"ID3\": \"mp3\",\n    }\n    for sig, filetype in signatures.items():\n        if head.startswith(sig):\n            return filetype\n\n    raise ValueError(\"not supported filetype\")\n\n\ndef _resolve_audio_source(audio: str, timeout: float | None = None) -> \"str | bytes\":\n    \"\"\"Resolve an audio source string to a local file path or raw bytes for a decoder.\n\n    Accepts `http(s)://` URLs (fetched with retry), local file paths (returned unchanged),\n    and base64 strings (optionally wrapped as a `data:...` URI).\n    \"\"\"\n    if audio.startswith((\"http://\", \"https://\")):\n        return _fetch_audio_bytes(audio, timeout=timeout)\n    if os.path.isfile(audio):\n        return audio\n    # Not a URL or a local path — assume base64, optionally wrapped as a `data:<media-type>;base64,` URI\n    if audio.startswith(\"data:\"):\n        audio = audio.split(\",\", 1)[1]\n    try:\n        return base64.b64decode(audio)\n    except Exception as e:","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/audio_utils.py#L155-L191","documentation":"`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.","triggerScenarios":"`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).","commonSituations":"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.","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"],"exampleFix":"# before\nmodel = AutoModelForCausalLM.from_pretrained(\n    \"deepseek-ai/DeepSeek-V3\", device_map=\"auto\"  # 2+ GPUs in one process\n)  # -> RuntimeError at forward\n\n# after\n# option A: accelerate TP/EP (one GPU per process)\n# accelerate launch --num_processes 8 run_infer.py\n# option B: grouped_mm experts\nmodel.set_experts_implementation(\"grouped_mm\")","handlingStrategy":"validation","validationCode":"cuda_ids = torch.cuda.device_count()\nif cuda_ids > 1:  # single process, multiple devices\n    experts_impl = \"grouped_mm\"            # safe in-process\n    # or plan real TP/EP with accelerate instead of device_map=\"auto\"\ndevice_map = \"auto\" if cuda_ids == 1 else None","typeGuard":null,"tryCatchPattern":"try:\n    out = model(input_ids)\nexcept RuntimeError as e:\n    if \"multiple CUDA devices\" in str(e):\n        model.set_experts_implementation(\"grouped_mm\")\n        out = model(input_ids)\n    else:\n        raise","preventionTips":["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"],"tags":["deepgemm","multi-gpu","device-map","moe","parallelism"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}