-
Notifications
You must be signed in to change notification settings - Fork 1
Add CUDA GPU backend implementation #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d190578
Initial plan
Copilot 81f2d37
Add initial CUDA support architecture - backend, kernels, tests, and …
Copilot ee11d2b
Fix build configuration - conditional OBJCXX and add missing cstring …
Copilot dc87cd2
Add CUDA backend architecture documentation
Copilot f51f58e
Expand CUDA test suite to match Metal test comprehensiveness
Copilot 62cee09
Fix critical CUDA backend issues: memory tracking, argument ordering,…
Copilot 3f9d2f4
Merge main branch with updated CI/test workflows
Copilot e86b258
Update CI workflow to test each OS with both GPU ON and OFF configura…
Copilot f40902c
Fix atomic operations in memory tracking and update Hopper documentation
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
|
|
||
| #include "backend.h" | ||
| #include <chrono> | ||
| #include <cstring> | ||
| #include <iostream> | ||
|
|
||
| namespace MetalFish { | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate symbol linker error when CUDA enabled
High Severity
When
USE_CUDA=ONandUSE_METAL=OFF(typical Linux/Windows builds), bothcpu_backend.cppandcuda_backend.cuare compiled and linked. The preprocessor guard incpu_backend.cppis#ifndef USE_METAL, which passes since Metal is off. Meanwhile,cuda_backend.cuuses#ifdef USE_CUDA. Both files defineBackend::get()andBackend::available(), causing duplicate symbol linker errors. The guard incpu_backend.cppneeds to also exclude whenUSE_CUDAis defined.🔬 Verification Test
Why verification test was not possible: This is a build-time linker error that requires a full CMake+CUDA toolchain setup. The bug can be verified by examining the code:
cpu_backend.cppline 131-133 definesBackend::get()andBackend::available(), andcuda_backend.culines 583-588 defines the same functions. When both files are compiled (USE_CUDA=ON, USE_METAL=OFF per CMakeLists.txt lines 174 and 192), the linker will report duplicate symbols.Additional Locations (1)
src/gpu/cuda/cuda_backend.cu#L582-L588There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix this