-
Notifications
You must be signed in to change notification settings - Fork 99
Add CUDA context support and build configuration #3567
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
base: main
Are you sure you want to change the base?
Conversation
Adds CUDA context management files (cuda_context.h and cuda_context.cpp) that provide similar functionality to the existing OpenCL context. The changes include: - CudaContext class inheriting from Context and Singleton - CUDA kernel management and execution interfaces - Build system updates to support CUDA with enable-cuda option - Conditional linking of CUDA runtime library for both Windows and Linux - Addition of enable-cuda option in meson_options.txt Signed-off-by: Daekyoung Jung <[email protected]>
|
Could you check the CI and then We will review once all the ci pass. |
|
I think the commit body of bc7cec0 is missing. Please add some messages to the body instead of putting all messages in the title. |
|
Please check the comments in #3562 |
| foreach kernel : cuda_sources | ||
| obj_name = kernel.replace('.cu', '.o') | ||
| obj = custom_target(obj_name, | ||
| command: [nvcc, '-c', '-Xcompiler', '/MD', '@INPUT@', '-o', '@OUTPUT@'], |
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.
/MD is for MSVC++. This expression should check if it's for Windows/MSVCC++.
For linux, add appropriate compiler option (-fPIC ? )
| #endif | ||
|
|
||
| #ifdef ENABLE_CUDA | ||
| auto &cuda_context = nntrainer::CudaContext::Global(); |
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.
This may need to add #include "cuda_context.h".
| namespace nntrainer { | ||
| std::mutex cuda_factory_mutex; | ||
|
|
||
| void CudaContext::initialize() noexcept { |
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.
Is it ok to let the caller of initialize() unaware of the init error?
This commit adds CUDA context management files (cuda_context.h and cuda_context.cpp) that provide similar functionality to the existing OpenCL context. The changes include: - Implementation of CudaContext class inheriting from Context and Singleton - CUDA kernel management and execution interface - Build system updates to support CUDA with enable-cuda meson_options - Conditional linking of CUDA runtime library for both Windows and Linux - Addition of enable-cuda option in meson_options.txt - Implementation of RMSNorm CUDA kernel and build configuration Signed-off-by: Daekyoung Jung <[email protected]>
bc7cec0 to
42922de
Compare
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 3 days. |
This PR adds CUDA context management files (cuda_context.h and cuda_context.cpp) that provide similar functionality to the existing OpenCL context. The changes include:
Signed-off-by: Daekyoung Jung [email protected]