{"record":{"id":"f65fdc751e1a5e4c","repo":"huggingface/transformers","slug":"unsupported-config-file-format-args-config-file","errorCode":null,"errorMessage":"Unsupported config file format: {args.config_file}","messagePattern":"Unsupported config file format: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"benchmark_v2/run_benchmarks.py","lineNumber":109,"sourceCode":"    if any(arg is None for arg in [args.batch_size, args.sequence_length, args.num_tokens_to_generate]):\n        raise ValueError(\n            \"All of the arguments --batch-size, --sequence-length, and --num-tokens-to-generate are required\"\n        )\n\n    # We cannot compute ITL if we don't have at least two measurements\n    if any(n <= 1 for n in args.num_tokens_to_generate):\n        raise ValueError(\"--num_tokens_to_generate arguments should be larger than 1\")\n\n    # If a config file is provided, read it and use the configs therein. They will still be adapted to the given arguments.\n    if args.config_file is not None:\n        if args.config_file.endswith(\".json\"):\n            with open(args.config_file, \"r\") as f:\n                config_as_dicts = [json.load(f)]\n        elif args.config_file.endswith(\".jsonl\"):\n            with open(args.config_file, \"r\") as f:\n                config_as_dicts = [json.loads(line) for line in f if line.startswith(\"{\")]\n        else:\n            raise ValueError(f\"Unsupported config file format: {args.config_file}\")\n        configs = [BenchmarkConfig.from_dict(config) for config in config_as_dicts]\n    else:\n        # Otherwise, get the configs for the given coverage level\n        configs = get_config_by_level(args.level)\n\n    # Adapt the configs to the given arguments\n    configs = adapt_configs(\n        configs,\n        args.warmup,\n        args.iterations,\n        args.batch_size,\n        args.sequence_length,\n        args.num_tokens_to_generate,\n        not args.no_gpu_monitoring,\n    )\n\n    if args.enable_tp:\n        for config in configs:","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/benchmark_v2/run_benchmarks.py#L91-L127","documentation":"`deepgemm_fp8_fp4_linear` rejects `activation_scale is not None`. DeepGEMM performs per-token (dynamic, per-row) activation quantization via `per_token_cast_to_fp8`; a static per-tensor activation scale (from `activation_scheme='static'` checkpoints) is fundamentally incompatible with its kernels, so it raises `NotImplementedError` and expects callers to route static activations through the Triton fallback.","triggerScenarios":"Calling the DeepGEMM linear with a checkpoint quantized under `activation_scheme=\"static\"` (calibrated per-tensor input scales), where the caller passes `activation_scale` into `deepgemm_fp8_fp4_linear`.","commonSituations":"DeepSeek-V2-style static-FP8 checkpoints (calibrated `input_scale`) run with the DeepGEMM linear; generic integration code that always forwards `activation_scale` when present.","solutions":["Route static-activation models through the Triton FP8 linear instead of DeepGEMM (the intended fallback)","Re-quantize with `activation_scheme=\"dynamic\"` so no per-tensor activation scale exists","In integration code, gate on `activation_scheme == \"static\"` before choosing the DeepGEMM path"],"exampleFix":"# before\noutput = deepgemm_fp8_fp4_linear(x, w, w_scale, activation_scale=static_scale)\n\n# after\nif activation_scale is not None:\n    output = fp8_linear_torch(x, w, w_scale, activation_scale)   # Triton/default path\nelse:\n    output = deepgemm_fp8_fp4_linear(x, w, w_scale)","handlingStrategy":"validation","validationCode":"if activation_scale is not None:  # static per-tensor scheme\n    output = fp8_linear_triton(x, w, w_sf, activation_scale)\nelse:\n    output = deepgemm_fp8_fp4_linear(x, w, w_sf)","typeGuard":null,"tryCatchPattern":"try:\n    out = deepgemm_fp8_fp4_linear(x, w, w_sf, activation_scale=scale)\nexcept NotImplementedError:\n    out = fp8_linear_triton(x, w, w_sf, activation_scale)","preventionTips":["Route by activation_scheme before choosing the kernel path","Prefer dynamic activation quantization for DeepGEMM deployments"],"tags":["deepgemm","fp8","static-quantization","activations"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}