Repository navigation
kernel-builder: update ocloc to 26.44, add [general.xpu] cri-grf-size, smaller XPU builds - #1017
jiqing-feng wants to merge 7 commits into
Conversation
Pass ocloc -internal_options (e.g. -cl-intel-512-GRF-per-thread) to the spir64_gen (cri) AOT image only. Kernels that set an explicit grf_size property keep it; the option only changes the default for the rest. Applies to kernels built for CRI-only (__SYCL_TARGET_INTEL_GPU_CRI__); pvc/bmg images are untouched since the option segfaults ocloc there.
Precompiled images no longer embed a SPIR-V copy (-exclude_ir), and the symbol tables are stripped after linking. With cri-grf-size, spir64_gen now comes before the intel_gpu_* aliases, since the SYCL runtime takes the last matching image.
[general.xpu] cri-grf-size, smaller XPU builds
There was a problem hiding this comment.
Thanks for the PR!
I have gone back and forth on whether this should be represented as a generic compiler option or not. For now I have landed on the build.toml option being ok, even if it is very specific. Small future changes in kernel-builder are not as risky as in kernels, so let's do it.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. Pages changed in this PR: |
Coverage report —
|
| Name | Stmts | Miss | Cover | Missing |
|---|---|---|---|---|
| src/kernels/__init__.py | 14 | 0 | 100% | |
| src/kernels/_internals/_system.py | 6 | 1 | 83% | 10 |
| src/kernels/_internals/_versions.py | 130 | 13 | 90% | 53, 59-60, 63-64, 165-170, 199, 219 |
| src/kernels/_internals/archs.py | 56 | 1 | 98% | 94 |
| src/kernels/_internals/backends.py | 256 | 51 | 80% | 43, 103, 163, 172, 181, 206, 215, 224, 248, 295, 311, 315, 319-350, 358, 381-401 |
| src/kernels/_internals/compat.py | 10 | 1 | 90% | 5 |
| src/kernels/_internals/deps.py | 70 | 1 | 99% | 56 |
| src/kernels/_internals/digest.py | 58 | 5 | 91% | 71-73, 136-137 |
| src/kernels/_internals/hf_hub.py | 66 | 2 | 97% | 22, 24 |
| src/kernels/_internals/importer.py | 114 | 6 | 95% | 18, 227, 232, 235, 249-250 |
| src/kernels/_internals/install.py | 21 | 7 | 67% | 76-100 |
| src/kernels/_internals/layer/__init__.py | 7 | 0 | 100% | |
| src/kernels/_internals/layer/_interval_tree.py | 103 | 4 | 96% | 23, 52, 147, 150 |
| src/kernels/_internals/layer/device.py | 48 | 12 | 75% | 42, 47-49, 91, 96-98, 101, 149, 152, 156 |
| src/kernels/_internals/layer/func.py | 99 | 3 | 97% | 106, 344, 421 |
| src/kernels/_internals/layer/globals.py | 5 | 0 | 100% | |
| src/kernels/_internals/layer/inspect.py | 27 | 0 | 100% | |
| src/kernels/_internals/layer/kernelize.py | 84 | 6 | 93% | 306, 314-315, 328, 344-346 |
| src/kernels/_internals/layer/layer.py | 329 | 11 | 97% | 288, 478, 639-640, 661, 669, 680, 715, 719, 732, 888 |
| src/kernels/_internals/layer/mode.py | 14 | 0 | 100% | |
| src/kernels/_internals/layer/repos.py | 136 | 36 | 74% | 32, 35-42, 73, 86, 90, 99-100, 103, 106-109, 116-117, 120, 123-126, 133-134, 137, 140-143, 150-151, 154, 157-160, 235 |
| src/kernels/_internals/load.py | 96 | 1 | 99% | 363 |
| src/kernels/_internals/locking.py | 89 | 64 | 28% | 35-83, 91-98, 102-125, 137, 152-159, 165-175, 179-186 |
| src/kernels/_internals/python_deps.py | 58 | 6 | 90% | 59-60, 64-65, 101, 104 |
| src/kernels/_internals/resolver.py | 185 | 1 | 99% | 253 |
| src/kernels/_internals/status.py | 50 | 2 | 96% | 25, 79 |
| src/kernels/_internals/validate.py | 105 | 7 | 93% | 9, 102, 173, 196-197, 233-234 |
| src/kernels/_internals/variants.py | 435 | 11 | 97% | 232, 264, 518-519, 561-564, 566, 749-755 |
| src/kernels/_internals/verify.py | 102 | 6 | 94% | 44, 176-178, 266-267 |
| src/kernels/benchmarks.py | 2 | 0 | 100% | |
| src/kernels/hf_hub.py | 2 | 2 | 0% | 1-3 |
| src/kernels/load.py | 2 | 2 | 0% | 1-3 |
| src/kernels/lock.py | 2 | 2 | 0% | 1-3 |
| src/kernels/metadata.py | 2 | 0 | 100% | |
| src/kernels/resolve.py | 3 | 0 | 100% | |
| src/kernels/validate.py | 2 | 0 | 100% | |
| TOTAL | 2788 | 264 | 91% |
1 empty file skipped.
Updated by the Test kernels workflow on commit b771dde87d8aae2f7f268a81cb359f70886a7fc3.
|
Thanks for the review! Pushed a commit with the cargo fmt fix for the Rustfmt failure. The E2E failures (Init, build, and upload kernel and Clean up test repos) look unrelated to this PR. The workflow needs HF_HUB_CI_TOKEN and CACHIX_AUTH_TOKEN, and secrets aren't available to pull_request runs from forks. The recent E2E runs on other fork PRs (#1040, #1042, #1047) fail the same way, while runs on main and same-repo branches pass. Everything else passes, including the CUDA and XPU build/test jobs. |
[general.xpu] cri-grf-size, smaller XPU builds[general.xpu] cri-grf-size, smaller XPU builds
What it does
1. Per-kernel GRF size on CRI. A kernel can choose how many registers per thread (128, 256 or 512) its CRI build uses:
Attention kernels on CRI need 512 registers to run at full speed, and the current compiler cannot set 512 per kernel, so it is set at build time (vllm-xpu-kernels does the same). Only CRI builds are affected; other GPUs are unchanged.
2. Smaller XPU builds, for all XPU kernels:
-exclude_ir). The separatespir64image is kept for GPUs without a precompiled image.cri-grf-size, the image order is fixed so CRI, PVC and B60 each load their own precompiled image.3. ocloc 26.22 → 26.44 (IGC 2.43.9). ocloc 26.22 miscompiles the CRI paged-decode kernel of kernels-community#1309 when it writes the output of empty sequences (DEVICE_LOST), which forced an extra host-side fix-up of those rows. With 26.44 the kernel handles them itself.
mainbuilder.sosizeTesting
Used by huggingface/kernels-community#1309. All flash-attn2 tests pass on CRI and B60, no regressions.