Fix CUDA stream lookup with dynamic ggml backends - #340
Merged
Conversation
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.
Summary
Fixes the non-CPU Docker workflow failure introduced by PR #321. That PR added
ggml_backend_cuda_get_stream()and used it fromtorch_random.cppthrough a direct link-time reference. CUDA Docker builds enableENGINE_ENABLE_CPU_ALL_VARIANTS=ON, which forcesGGML_BACKEND_DL=ON, soggml-cudais a dynamic backend module and the direct symbol reference is unresolved when linkingaudiocpp_cli.This PR keeps the Music3 call site unchanged and routes CUDA stream lookup through the backend proc-address table, matching the existing CUDA hooks for stream priority, graph clearing, and pool trimming.
Validation
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -DAUDIOCPP_MODEL_SET=full -DENGINE_ENABLE_CPU_ALL_VARIANTS=ON -DENGINE_ENABLE_CUDA=ON -DENGINE_ENABLE_CUDA_GRAPHS=ON -DENGINE_ENABLE_VULKAN=OFF -DENGINE_ENABLE_OPENMP=ON -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON -DENGINE_BUILD_EXAMPLES=OFF -DENGINE_BUILD_TESTS=OFF -DENGINE_BUILD_MODEL_TESTS=OFF -DENGINE_BUILD_WARMBENCH=OFFcmake --build build/debug --parallel $(nproc) --target audiocpp_clicmake --build build/debug --parallel $(nproc) --target audiocpp_server --target audiocpp_model_manager --target model_perf