Skip to content

Conversation

@dkjung
Copy link
Collaborator

@dkjung dkjung commented Nov 20, 2025

This commit introduces CUDA support for addition operations:

  1. Added new CUDA files:

    • nntrainer/tensor/cuda_operations/addition_cuda.cu: Implementation
      of CUDA addition kernel
    • nntrainer/tensor/cuda_operations/addition_cuda.h: Header for CUDA
      addition functions
    • nntrainer/tensor/cuda_operations/cuda_interface.cpp: Implementation
      of CUDA interface functions
    • nntrainer/tensor/cuda_operations/cuda_interface.h: Header for CUDA
      interface
  2. Updated build configuration:

    • Modified meson.build to include new CUDA files in the build
    • Updated test/unittest/meson.build to add unittest_cuda_addition target
  3. Added unit test:

    • test/unittest/unittest_cuda_addition.cpp: Unit test for CUDA addition
      operations with timing measurements

The new implementation provides:

  • CUDA kernel for element-wise addition operations
  • CUDA interface functions for tensor operations
  • Comprehensive unit test with performance timing

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]>
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]>
This commit includes the following changes:
1. Add new CUDA unit test file (unittest_cuda.cpp) with RMSNorm CUDA kernel
   tests
2. Reorganize CUDA operations directory structure by moving subdir inclusion
   from nntrainer/meson.build to nntrainer/tensor/meson.build
3. Add CUDA test target in test/unittest/meson.build
4. Fix CUDA linking issues by adding proper link arguments (-NOIMPLIB, -NOEXP)
   to prevent generation of unnecessary .lib and .exp files
5. Add CUDA dependencies handling in unit test build configuration

The changes ensure proper CUDA support in the build system and add
comprehensive unit tests for CUDA operations.

Signed-off-by: Daekyoung Jung <[email protected]>
This commit introduces CUDA support for addition operations:

1. Added new CUDA files:
   - `nntrainer/tensor/cuda_operations/addition_cuda.cu`: Implementation
     of CUDA addition kernel
   - `nntrainer/tensor/cuda_operations/addition_cuda.h`: Header for CUDA
     addition functions
   - `nntrainer/tensor/cuda_operations/cuda_interface.cpp`: Implementation
     of CUDA interface functions
   - `nntrainer/tensor/cuda_operations/cuda_interface.h`: Header for CUDA
     interface

2. Updated build configuration:
   - Modified meson.build to include new CUDA files in the build
   - Updated test/unittest/meson.build to add unittest_cuda_addition target

3. Added unit test:
   - `test/unittest/unittest_cuda_addition.cpp`: Unit test for CUDA addition
     operations with timing measurements

The new implementation provides:
- CUDA kernel for element-wise addition operations
- CUDA interface functions for tensor operations
- Comprehensive unit test with performance timing

Signed-off-by: Daekyoung Jung <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

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.

@github-actions github-actions bot added the Stale label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant