cuda: decline unsupported indexer top_k cache types in supports_op#2118
Closed
joelfarthing wants to merge 1 commit into
Closed
cuda: decline unsupported indexer top_k cache types in supports_op#2118joelfarthing wants to merge 1 commit into
joelfarthing wants to merge 1 commit into
Conversation
Owner
|
I was actually thinking to remove the |
Contributor
Author
Even better. I'll close this one out. |
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.
-fidx -ictk f32on a CUDA build aborts at eval: the indexer top_k kernel assertsk->type == F16 || ggml_is_quantized(k->type)(indexer_topk.cu:72) while supports_op returns true unconditionally, so the scheduler keeps the op on CUDA. Because the op only engages once n_kv exceeds top_k, the server loads clean and serves short requests, then aborts on the first one past 2048 tokens. On main at8e2d83cfe:This patch makes supports_op mirror what the kernel can execute: f16 k (the cuBLAS path), or quantized k that has an MMQ kernel for the type on the device (
ggml_cuda_should_use_mmq), plus the operand types the kernel asserts. Everything else falls back through the scheduler to the CPU op, which handles all four openPangu-ictktypes on AVX2 and ARM-dotprod builds (its existing platform contract from #2111). Checkingggml_is_quantizedalone would over-accept: quantized types with no MMQ case would still hit the dispatch abort, and the GLM-ictkpath does not restrict cache types.With the fix, the same f32 configuration answers a 6.5K-token needle correctly with every INDEXER_TOPK node on CPU (GGML_SCHED_DEBUG);
-ictk q8_0and the default f16 keep their main placement (identical scheduler split before and after the fix). bf16, which the kernel also cannot execute, did not abort on main because the scheduler happened to route it to CPU already; it now lands there by explicit decline, with the same needle result.