kernels benchmark does not support XPU
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Description
Expected the XPU to be discovered and used for benchmarking for kernels that have XPU versions.
Steps to reproduce
# Will open PR to add kernels[xpu] soon
uv pip install --index https://download.pytorch.org/whl/xpu "torch==2.12+xpu"
uv pip install "kernels[benchmark]"
source .venv/bin/activate
kernels benchmark kernels-community/flash-attn2 --version 1
Traceback (most recent call last):
File "/dan/projects/kernels/.venv/bin/kernels", line 10, in <module>
sys.exit(main())
^^^^^^
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/cli/__init__.py", line 87, in main
args.func(args)
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/cli/__init__.py", line 165, in run_benchmark
benchmark.run_benchmark(
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/cli/benchmark.py", line 751, in run_benchmark
results, kernel_sha = run_benchmark_script(
^^^^^^^^^^^^^^^^^^^^^
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/cli/benchmark.py", line 650, in run_benchmark_script
results, kernel_sha = run_benchmark_class(
^^^^^^^^^^^^^^^^^^^^
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/cli/benchmark.py", line 501, in run_benchmark_class
setup_fn()
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/kernels/benchmarks/attention.py", line 75, in setup_large
self.q = torch.randn(B, S, H, D, device="cuda", dtype=torch.float16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/dan/projects/kernels/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py", line 484, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
Expected behavior
Measure performance.
Environment
- kernels 0.15.2
- python 3.12.13
- torch 2.12.0+xpu
- triton-xpu 3.7.1
- Linux
Additional context
No response
- 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
-
kernels benchmark pulls from the old model repos and says every gpu is cpuPossibly taken @drbh claimed this 8 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
huggingface/kernels#914 · 1 comment · 1 assignee ·
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 19 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
All issues in huggingface/kernels
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4237 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jejjohnson/gaussx#721 ·
Maintainers usually reply within 1 day
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']Possibly taken @jasonmontleon claimed this 4 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 94/100
rpm-software-management/mock#1834 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
elastic/elastic-otel-python#683 ·
Maintainers usually reply within 1 day
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesOpenfollow-up
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day