Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Run `quantpreflight explain QPF006` for the details of any rule.
| :--- | :--- |
| Formats | AWQ, GPTQ, Compressed-Tensors, FP8, NVFP4, MXFP4, Marlin, AutoRound, bitsandbytes, BitNet, MLX, GGUF, Safetensors |
| Engines | vLLM, SGLang, TensorRT-LLM, llama.cpp |
| NVIDIA GPUs | T4, A10G, A100-40GB, A100, L4, L40S, RTX4090, H100, H200, B200, RTX5090, GB10 |
| NVIDIA GPUs | T4, A10G, RTXA6000, A40, A100-40GB, A100, L4, L40S, RTX4090, H100, H200, B200, RTX5090, GB10 |
| AMD GPUs | MI250X, MI300X, MI325X |
| Model families | Llama, Mistral, Qwen, DeepSeek, Gemma, Phi, GLM, Mamba and hybrids, with a generic fallback for the rest |

Expand Down
9 changes: 7 additions & 2 deletions src/quantpreflight/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from dataclasses import dataclass
from importlib import metadata
import re
import shutil
import subprocess

Expand All @@ -29,9 +30,13 @@ def _squash(text: str) -> str:

def match_gpu_name(name: str, arch: str | None = None) -> str | None:
"""Match a device name such as `NVIDIA L40S` to a GPU profile, falling back to its architecture."""
# Longest names first, so an L40S isn't read as an L4
# Longest names first, so an L40S isn't read as an L4. For short IDs
# require a whole model token: an RTX A4000 must not match an A40.
normalized_name = _squash(name)
tokens = set(re.findall(r"[A-Z0-9]+", name.upper()))
for gpu_id in sorted(load_gpu_profiles(), key=len, reverse=True):
if _squash(gpu_id) in _squash(name):
normalized_id = _squash(gpu_id)
if normalized_id in (tokens if len(normalized_id) <= 3 else normalized_name):
return gpu_id
if arch:
try:
Expand Down
26 changes: 26 additions & 0 deletions src/quantpreflight/hardware/gpus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@ supports_fp8_block_scale = false
supports_nvfp4 = false
supports_marlin = true

[[gpus]]
id = "RTXA6000"
aliases = ["rtx-a6000", "rtx a6000", "nvidia rtx a6000"]
vendor = "nvidia"
arch = "sm_86"
compute_capability = 86
vram_gb = 48.0
supports_bf16 = true
supports_fp8_w8a8 = false
supports_fp8_block_scale = false
supports_nvfp4 = false
supports_marlin = true

[[gpus]]
id = "A40"
aliases = ["nvidia a40"]
vendor = "nvidia"
arch = "sm_86"
compute_capability = 86
vram_gb = 48.0
supports_bf16 = true
supports_fp8_w8a8 = false
supports_fp8_block_scale = false
supports_nvfp4 = false
supports_marlin = true

[[gpus]]
id = "A100-40GB"
aliases = ["a100-40g", "a100_40gb"]
Expand Down
5 changes: 5 additions & 0 deletions tests/test_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
("NVIDIA GeForce RTX 4090", "sm_89", "RTX4090"),
("NVIDIA GeForce RTX 3090", "sm_86", "A10G"),
("NVIDIA A10", "sm_86", "A10G"),
("NVIDIA RTX A6000", "sm_86", "RTXA6000"),
("NVIDIA A40", "sm_86", "A40"),
("NVIDIA A40-48GB", None, "A40"),
("NVIDIA RTX A4000", "sm_86", "A10G"),
("NVIDIA RTX A4000", None, None),
("NVIDIA A100-SXM4-40GB", "sm_80", "A100"),
("NVIDIA H100 80GB HBM3", "sm_90", "H100"),
("NVIDIA GeForce RTX 5090", "sm_120", "RTX5090"),
Expand Down