cuda: add TP flag-fold and kv-norm task fallbacks - #12
Merged
GiorgioOppo merged 1 commit intoSep 4, 2026
Merged
GiorgioOppo merged 1 commit into
GiorgioOppo merged 1 commit into
Conversation
ds4.c:27325 calls ds4_gpu_add_tensor_tp_flag() under #ifndef DS4_NO_GPU, so every GPU backend has to provide it. Metal implements it; ROCm got fallbacks in 9f005f4 ("rocm: fix build break from Metal-only TP/kv-norm symbols"), merged here in 79907e0. CUDA had neither, so linking ds4, ds4-server, ds4-bench, ds4-eval and ds4-agent fails on CUDA: ds4.o: in function `metal_graph_encode_decode_layer_phase': ds4.c:27325: undefined reference to `ds4_gpu_add_tensor_tp_flag' collect2: error: ld returned 1 exit status This mirrors the ROCm block verbatim: the TP flag-fold and deferred kv-norm paths are Metal-only optimizations, so the plain fallback is the correct behaviour elsewhere - add without the checked flag, kv norm always standalone. No functional change on any path that computes: the only non-empty function delegates to the existing ds4_gpu_add_tensor(). Verified on GB10 / sm_121 (DGX Spark), CUDA 13, make cuda-spark and make quality-score both exit 0 with no unresolved symbols.
5 tasks
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.
ds4.c:27325callsds4_gpu_add_tensor_tp_flag()under#ifndef DS4_NO_GPU, so every GPU backend has to provide it. Metal implements it; ROCm got fallbacks in9f005f4c("rocm: fix build break from Metal-only TP/kv-norm symbols"), merged here in79907e02. CUDA had neither, so linking fails on CUDA for all five binaries:This mirrors the ROCm block verbatim, including its rationale: the TP flag-fold and deferred kv-norm paths are Metal-only optimizations, so the plain fallback is the correct behaviour elsewhere — add without the checked flag, kv norm always standalone.
No functional change on any path that computes. Six of the seven functions are empty or return 0; the only non-empty one delegates to the existing
ds4_gpu_add_tensor().Verified on GB10 / sm_121 (DGX Spark), CUDA 13:
make cuda-sparkandmake quality-scoreboth exit 0 with no unresolved symbols, on exactly the content of this PR.Context: this is what currently blocks anyone from building antirez#952 on CUDA, which is why it did not show up earlier — Metal and ROCm both link fine.