Repository navigation
fix(kvflash): tests that share a KvFlashPager with luce_common get its CUDA define - #1027
Open
dusterbloom wants to merge 2 commits into
Open
dusterbloom wants to merge 2 commits into
dusterbloom wants to merge 2 commits into
Conversation
…s CUDA define KvFlashPager adds its async-DMA members only under LUCE_BACKEND_CUDA, LUCE_BACKEND_HIP or GGML_USE_HIP. luce_common sets LUCE_BACKEND_CUDA=1 PRIVATE, so on CUDA test_qwen4exp_prefix_cache built a smaller pager than the one luce_common code reads: qwen4exp_kvflash_reserve read compute_stream_ past the test's object and segfaulted in cudaEventRecord. test_kvflash has the same pattern. HIP builds already match through ggml's GGML_USE_HIP.
davide221
reviewed
Nov 17, 2026
davide221
left a comment
Contributor
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 10098386 · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again
Collaborator
Author
|
The two AMD jobs never ran: the Strix Halo job timed out after 24 h in the queue and the R9700 job is still queued. The lucebox3 runner has taken no jobs since 11-17. Device evidence in the meantime. #1028's head 6940669 contains this commit, and on it
Once the runner is back, the two AMD jobs can be re-run; or this can merge on the runs above. |
server/CMakeLists.txt: main's Luce-Org#1031 added a comment above add_test(qwen4exp_prefix_cache) where this branch adds the LUCE_BACKEND_CUDA define; keep both.
dusterbloom
added a commit
to dusterbloom/lucebox-hub
that referenced
this pull request
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On CUDA builds,
test_qwen4exp_prefix_cachesegfaults on main in its KVFlash case. The crash comes right after the case's expected refusal,[qwen4exp][kvflash] a 385-row forward exceeds the 384 rows a 512-slot pool keeps resident:Cause: the two sides build
KvFlashPagerdifferently.KvFlashPager(src/common/kvflash_pager.h) adds its async-DMA members only whenLUCE_BACKEND_CUDA,LUCE_BACKEND_HIPorGGML_USE_HIPis defined.luce_commongetsLUCE_BACKEND_CUDA=1as a PRIVATE definition; the test target does not. So the test compiles a smaller pager than the oneluce_commoncode reads.std::make_unique<KvFlashPager>(),attach).qwen4exp_kvflash_reserve, compiled inluce_common, then readscompute_stream_past the end of the test's object, gets garbage, and records an event on it.HIP builds are not affected: ggml propagates
GGML_USE_HIPto every consumer, so both sides build the DMA layout.Fix: on CUDA, give the define to the two test targets that construct a
KvFlashPagerand pass it toluce_commoncode:test_qwen4exp_prefix_cachetest_kvflashThe change is build config only.
Evidence (RTX 3090, sm_86, CUDA 12.0)
test_qwen4exp_prefix_cache4af911b74kvflash()after the 385-row refusalNot run:
test_kvflash, which needs a qwen35 GGUF; it is built only.Considered: making
kvflash_pager.halso checkGGML_USE_CUDA, which ggml already propagates, would fix every consumer at once. But it would also move the header-only pager tests onto the DMA path, so it belongs in a separate change.