libxe2: kv_store and attn_paged, correctness first

The paged cache in libref's and libr4d's layout. attn_paged runs one work-group a (query row, head)
in libref's order: each key's dot summed over d serially by its lane, the max over the group, then
weights by chunk in local memory with the sum and every acc[d] accumulated in key order, exp in
double. Scores are recomputed rather than kept, since 131072 keys of them do not fit local memory.
Masks, sliding windows, ragged batches and fp8 descales are libref's. kv_store skips a slot past
the cache instead of refusing the launch, which would need the host to read device memory.

rad-kbench against libref: fixture 178/178, MiniCPM5-2B 160/160 (rel_l2 0).

docs/SYCL_PROGRESS.md: the HIP build compiles (785/785 targets for gfx1201 in the ROCm 10.1
container) at the commit holding every core-side change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-23 16:12:32 +02:00
1 parent 649178eb59
commit ed76fc8aaa
4 files changed
+298 -5

No files matched your search

+17 -5
View File
@@ -34,9 +34,8 @@ from it alone.
brought up and compared against the host backend on until the real containers exist.
Optionally, `HuggingFaceTB/SmolLM2-135M` (real bf16 llama weights, head_dim 64, tied embeddings)
could be converted as a real-weights check; that needs the user's OK, since it is a conversion.
3. **No ROCm on this machine** (`hipcc` absent, no `/opt/rocm`), and `sudo` needs a password. The user
authorized installing what is needed; the HIP compile check runs in docker instead
(`rocm/dev-ubuntu-24.04:10.1.0-full`, the Dockerfile's base, stock clang; see "HIP compile check").
3. ~~**No ROCm on this machine**~~ Resolved: `sudo` needs a password, so the HIP compile check runs
in docker (see "HIP compile check"); it passes.
## Phase 0 results (2026-10-23)
@@ -288,9 +287,22 @@ In a SYCL build the host tier is `ctest -LE 'gpu|oot|sycl'` (kbench moved to the
`scripts/sycl/notify.sh "msg"` posts to the Discord webhook (user's request, 2026-10-23): used for
blockers, questions and milestones. Tested: posted.
## HIP-side edits awaiting a ROCm compile check
## HIP compile check
None yet.
2026-10-23, commit `370a906` (the SYCL backend, every core-side change): built in docker,
`rocm/dev-ubuntu-24.04:10.1.0-full` (HIP 7.16, AMD clang 24.0.0git, the Dockerfile's base with its
stock compiler rather than the Dockerfile's patched LLVM), `cmake -DRAD_WITH_HIP=ON
-DRAD_GPU_TARGETS=gfx1201`, g++-14: **785/785 targets, 0 errors**, libr4d included. Later commits add
only libxe2 and sycl/, which a HIP build does not compile. Re-run after any core change:
```sh
git worktree add --detach /tmp/hipsrc HEAD
docker run --rm -v /tmp/hipsrc:/src:ro rocm/dev-ubuntu-24.04:10.1.0-full bash -c '
apt-get update -qq && apt-get install -y -qq --no-install-recommends cmake ninja-build pkg-config g++-14 gawk
export CC=gcc-14 CXX=g++-14 ROCM_PATH=/opt/rocm HIP_PATH=/opt/rocm
cmake -S /src -B /build -G Ninja -DRAD_WITH_HIP=ON -DRAD_GPU_TARGETS=gfx1201 && cmake --build /build -j6'
git worktree remove --force /tmp/hipsrc
```
## Reproduce the current state