CUDA.jl

repository·main·Indexed 23 days ago

https://github.com/juliagpu/cuda.jl

The primary interface for NVIDIA CUDA GPU programming in Julia. It provides high-level array abstractions, a compiler for writing custom kernels via the @cuda macro, and wrappers for standard CUDA libraries including cuBLAS, cuDNN, cuFFT, cuRAND, cuSPARSE, cuSOLVER, cuTENSOR, cuStateVec, cuTensorNet, and NVML. The ecosystem includes CUDACore.jl for fundamental building blocks and CUDATools.jl for profiling and debugging.

Tokens
19.8K
Snippets
40
Records
130
Agent score
80%

What's inside CUDA.jl

  1. Overview of cuDNN.jl

    main

    cuDNN.jl is a Julia wrapper for NVIDIA cuDNN that provides GPU-accelerated neural-network primitives specifically for CuArray values. It is part of the CUDA.jl repository and is organized into several layers:

    • Raw Bindings: libcudnn.jl provides the generated bindings for the raw C API.
    • Backend API: backend.jl wraps cudnnBackendDescriptor_t using typed descriptor helpers.
    • Graph API: The graph/ directory provides a high-level Julia frontend including Graph, Tensor, operation factories, heuristics, plan caching, and execution.
    • Operations API: The ops/ directory exposes Julia-facing operations like attention!, convolution!, pooling, and batch normalization for use by downstream packages.
    • Legacy Wrappers: Fixed-function compatibility wrappers are located in src/legacy (e.g., for older API patterns), while Softmax, dropout, and RNN are managed outside the legacy system.
  2. Overview of CUDACore.jl

    main

    CUDACore.jl is the core package for CUDA programming in the Julia ecosystem. It provides the fundamental building blocks for GPU computing, including:

    • GPU array abstractions: Interfaces for working with data on the GPU.
    • Kernel compilation: Tools to compile and launch CUDA kernels.
    • Memory management: Handling data movement and allocation between host and device.
    • CUDA driver/runtime interface: Low-level access to the CUDA driver and runtime APIs.
  3. Overview of NVML.jl

    main
    NVML.jl is a Julia wrapper for the NVIDIA Management Library (NVML). It is used for monitoring and managing NVIDIA GPU devices, allowing users to access metrics such as temperature, power usage, utilization, and memory statistics directly from Julia. It is part of the CUDA.jl ecosystem.
  4. Overview of CUDATools.jl

    main

    CUDATools.jl is a package within the CUDA.jl ecosystem that provides diagnostic and utility tools for CUDA programming in Julia. It is designed to help developers monitor, profile, and debug their GPU workloads.

    Key capabilities include:

    • Profiling: Integration with NVIDIA CUPTI.
    • Device Monitoring: Access to NVIDIA Management Library (NVML) for monitoring device state.
    • Debugging: Various helpers to assist in CUDA debugging processes.
  5. Use cuSPARSE for sparse linear algebra

    main
    The cuSPARSE module provides Julia bindings to the NVIDIA cuSPARSE library, enabling high-performance sparse matrix operations on CUDA devices. It is part of the CUDA.jl ecosystem. To use it, ensure you have the cuSPARSE module available in your environment, typically by installing CUDA.jl which manages the necessary dependencies.