kernels benchmark pulls from the old model repos and says every gpu is cpu
Maintainers usually reply within 1 day
@drbh is already working on this.
Since Oct 26, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Read cli/benchmark.py and inspect collect_machine_info() and the snapshot_download call. Check how _backend() represents CUDA and ROCm, then review the benchmark download options for selecting the kernel repo and limiting files to benchmarks/. Done means benchmarks load scripts from the requested kernel revision and machine info reports the detected GPU and backend.
Written by the indexing model from the issue text.
Description
Description
was running kernels benchmark on an a100 a v100 and an mi100 and ran into two things. both are still there on main 78e14e6 and in 0.17.2
first one is it grabs the benchmark scripts from the old model repo. the snapshot_download call in cli/benchmark.py doesnt pass repo_type so it ends up in models--kernels-community--... and any version that only exists on the kernel repo just 404s. v1 still works but it runs the old copy of the scripts, relu v1 is e804dc4 on the model repo and b5ed5f6 on the kernel repo. so once the model repos go away (#757) every benchmark will break. it also downloads every build variant just to read benchmarks/, for relu that was 73 variants and 32 MB
second one is collect_machine_info() does _backend() in {"cuda", "rocm"} but _backend() gives back a CUDA(version=...) or ROCm(...) object so it never matches and always lands in the cpu branch. every run on a linux gpu saves "gpu": "N/A", "backend": "CPU" and thats the same payload --upload sends. the ROCm label from #902 never gets reached either
Steps to reproduce
$ kernels benchmark kernels-community/paged-attention@v2 --warmup 2 --iterations 5 --output pa.json
Downloading kernels-community/paged-attention@v2...
...
huggingface_hub.errors.RevisionNotFoundError: 404 Client Error.
Revision Not Found for url: https://huggingface.co/api/models/kernels-community/paged-attention/revision/v2.
Invalid rev id: v2
this next one is main on the a100. 0.17.2 gave the same machineInfo on the v100 and the mi100 too
$ kernels benchmark kernels-community/relu@v1 --warmup 2 --iterations 5 --output relu.json
...
GPU N/A
PyTorch 2.14.1+cu130
...
$ python -c "import json; print(json.load(open('relu.json'))['machineInfo'])"
{'gpu': 'N/A', 'backend': 'CPU', 'pytorchVersion': '2.14.1+cu130', 'os': 'Linux 5.14.0-570.37.1.el9_6.x86_64', 'cpu': 'x86_64'}
$ python -c "from kernels.backends import _backend; print(_backend(), _backend() in {'cuda', 'rocm'})"
CUDA(version=<Version('13.0')>) False
Expected behavior
scripts come from the kernel repo at that version, only benchmarks/ gets downloaded, and the result says what it actually ran on like NVIDIA A100-PCIE-40GB and CUDA 13.0
Environment
- kernels version: main 78e14e6 built from source, also 0.17.2 from pypi
- Python version: 3.12.14
- PyTorch version: 2.14.1+cu130, 2.14.1+cu126, 2.14.1+rocm7.2
- CUDA version: 13.0 and 12.6, ROCm 7.2
- GPU model: A100-PCIE-40GB, V100-PCIE-32GB, MI100
- OS: AlmaLinux 9.6
Additional context
looks like a two line fix. I patched main on the a100 and relu@v1 and paged-attention@v2 both run and verify, they show NVIDIA A100-PCIE-40GB and CUDA 13.0, and the cache is 56 KB and 194 KB
- backend_name = _backend()
+ backend_name = _backend().name
- repo_path = Path(str(_get_hf_api().snapshot_download(repo_id=repo_id, revision=revision)))
+ repo_path = Path(
+ str(
+ _get_hf_api().snapshot_download(
+ repo_id=repo_id, repo_type="kernel", revision=revision, allow_patterns=["benchmarks/**"]
+ )
+ )
+ )
happy to open a PR with a test if that sounds ok
- Dominant language
- Python
- Stars
- 781
- Forks
- 141
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 57
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/kernels
-
kernels-common: hash_variant loads entire file into memory, causing high RSS on large .so filesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
huggingface/kernels#956 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
huggingface/kernels#949 ·
Maintainers usually reply within 1 day
-
Add `kernels describe-api` to the "use layers" cookbookPossibly taken @ariG23498 claimed this 18 days ago. Open
huggingface/kernels#906 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Support multiple upstreams (make `upstream` a list)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 58/100
huggingface/kernels#850 ·
Maintainers usually reply within 1 day
-
Document kernels cache a bit moreMay be free again @sayakpaul claimed this 41 days ago, and no pull request is open. Open
huggingface/kernels#838 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in huggingface/kernels
Similar issues
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
conda-forge/vc-feedstock#132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
limitlessprojects/Go-Hybrid#3342 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
UKGovernmentBEIS/inspect_ai#6268 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
LSSTDESC/rail_sompz#42 ·
-
All tests fail with 'EXITED with status 3' on pytest 9.2.0 (TestReport._id is not marshallable)Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
pytest-dev/pytest-forked#113 ·