{"record":{"id":"492b4cadf46a62f9","repo":"huggingface/transformers","slug":"no-baseline-with-name-name-in-results-dir","errorCode":null,"errorMessage":"No baseline with name '{name}' in {RESULTS_DIR}","messagePattern":"No baseline with name '(.+?)' in (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"benchmark_v2/benchmark_scripts/continuous_batching_overall.py","lineNumber":298,"sourceCode":"        \"\"\"Save all entries to a timestamped JSON file keyed by name.\"\"\"\n        RESULTS_DIR.mkdir(parents=True, exist_ok=True)\n        filename = RESULTS_DIR / f\"{name}__{int(time.time())}.json\"\n        payload = {\n            \"model_id\": self.model_id,\n            \"attn_impl\": self.attn_impl,\n            \"entries\": [asdict(e) for e in self.entries],\n        }\n        with open(filename, \"w\") as f:\n            json.dump(payload, f, indent=2)\n        print(f\"\\nResults saved to {filename}\")\n        return filename\n\n    @classmethod\n    def load_most_recent(cls, name: str) -> \"BenchmarkResults\":\n        \"\"\"Load the most recent JSON file matching name.\"\"\"\n        candidates = sorted(RESULTS_DIR.glob(f\"{name}__*.json\"))\n        if not candidates:\n            raise FileNotFoundError(f\"No baseline with name '{name}' in {RESULTS_DIR}\")\n        data = json.loads(candidates[-1].read_text())\n        instance = cls(\n            model_id=data.get(\"model_id\"),\n            attn_impl=data.get(\"attn_impl\"),\n        )\n        instance.entries = [BenchmarkEntry(**e) for e in data[\"entries\"]]\n        print(f\"Loaded baseline from {candidates[-1]}\")\n        return instance\n\n    # Display\n    def print_summary(self) -> None:\n        rows = [\n            {\n                \"label\": e.label,\n                \"samples\": e.num_samples,\n                \"avg_in\": f\"{e.avg_input_tokens:.1f}\",\n                \"max_new\": e.max_new_tokens,\n                \"time (s)\": _fmt(e.time_seconds, \".2f\"),","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/benchmark_v2/benchmark_scripts/continuous_batching_overall.py#L280-L316","documentation":"`load_deepgemm_kernel` tried to lazily download/import the `kernels-community/deep-gemm` hub kernel via `lazy_load_kernel(\"deep-gemm\")` and got `None`. This means the hub `kernels` machinery could not return a usable module — typically no prebuilt build matching your current torch/CUDA combination, or the `kernels` package is missing/outdated (the earlier `is_deepgemm_loadable(raise_error=True)` already passed, so the failure is at kernel fetch time).","triggerScenarios":"First forward pass through a DeepGEMM FP8/FP4 path (`experts_implementation='deepgemm'`, `fp8_linear` with DeepGEMM enabled) on a machine where `kernels`' hub resolution for `kernels-community/deep-gemm` finds no matching wheel for the installed torch+CUDA (e.g. torch nightly, CUDA 12.8 vs 12.6, or an exotic arch), or an offline environment where the download failed.","commonSituations":"Custom/local torch build with no published kernel wheel; air-gapped cluster without HF hub access; torch upgraded after kernels cache was populated; mismatched CUDA minor version between torch and the prebuilt deep-gemm kernels.","solutions":["Check that a `kernels` release matching your torch/CUDA exists and install a compatible version (`pip install -U kernels`, respecting the integration's min/max pins)","Verify torch/CUDA pairing (`python -c \"import torch; print(torch.__version__, torch.version.cuda)\"`) and, if unsupported, switch to a torch version for which deep-gemm builds are published (e.g. stable torch + CUDA 12.x)","Ensure network/credentials work for hub download (HF_TOKEN for gated/large files, https://huggingface.co reachable, or set HF_HUB_OFFLINE=0)","If the environment cannot be fixed, fall back: run experts with `model.set_experts_implementation('grouped_mm')` or disable the deepgemm path so Triton is used"],"exampleFix":"// before\nmodel.set_experts_implementation(\"deepgemm\")\nout = model(x)  # ImportError: Failed to load `kernels-community/deep-gemm`\n\n// after\n# fix env: pip install -U \"kernels==<compatible>\" and use a supported torch/CUDA pair\n# or opt out:\nmodel.set_experts_implementation(\"grouped_mm\")\nout = model(x)","handlingStrategy":"fallback","validationCode":"from transformers.integrations.deepgemm import is_deepgemm_loadable\n\nif not is_deepgemm_loadable(raise_error=False):\n    model.set_experts_implementation(\"grouped_mm\")  # avoid deep-gemm load","typeGuard":null,"tryCatchPattern":"try:\n    out = deepgemm_fp8_fp4_linear(x, w, w_sf)\nexcept ImportError as e:\n    if \"deep-gemm\" in str(e):\n        out = triton_fp8_linear(x, w, w_sf)  # documented fallback\n    else:\n        raise","preventionTips":["Pin the `kernels` version range required by your transformers release","Keep torch/CUDA on combinations that have published deep-gemm builds","Warm up the DeepGEMM path once at startup so load failures surface before training begins"],"tags":["deepgemm","kernels","cuda","torch","installation","network"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}