CUDA Library Samples

repository·main·Indexed 25 days ago

https://github.com/nvidia/cudalibrarysamples

A collection of practical examples demonstrating NVIDIA's GPU-accelerated libraries for high-performance computing. Includes detailed guides on cuBLAS floating point emulation using the BF16x9 method and dynamic mantissa control for DGEMM, as well as tools like test_blas3 and grade_blas3 for detecting matrix multiplication algorithms and evaluating Grade A compliance accuracy.

Tokens
133.3K
Snippets
500
Records
901
Agent score
79%

What's inside nvidia-cudalibrarysamples

  1. Overview of NVIDIA Performance Primitives (NPP) Examples

    main
    This repository provides example applications for the NVIDIA Performance Primitives (NPP) library, which is used for high-performance image processing on NVIDIA GPUs. The examples cover various computer vision tasks including edge detection, segmentation, and distance transforms.
  2. Overview of cuBLAS Level-2 spr APIs

    main

    The cublas<t>spr APIs are used to compute packed symmetric rank-1 updates. This specific sample demonstrates the operation $A = A + x imes x^T$ (or similar rank-1 updates) using packed storage formats.

    Prerequisites:

    • Linux or Windows system with recent NVIDIA drivers.
    • CMake version 3.18 or minimum.

    Supported Architectures:

    • GPU: All GPUs supported by CUDA Toolkit.
    • CPU: x86_64, arm64-sbsa.
    • OS: Linux, Windows.
  3. Overview of FFT + JAX implementations

    main

    This project demonstrates how to compute Fast Fourier Transforms (FFTs) at scale using JAX. It provides two distinct implementation paths for multi-GPU, multi-node (MGMN) environments:

    1. JAX-only: Uses standard JAX APIs including jax.numpy.fft, custom_partitioning, and jit. This approach relies on JAX's built-in distributed capabilities.
    2. JAX+cuFFTMp: Integrates cuFFTMp, an MGMN extension to cuFFT based on NVSHMEM. This uses a JAX distributed-memory custom operation to leverage cuFFTMp's performance in a one-GPU-per-process model.
  4. Overview of nvCOMP Library Samples

    main

    This repository contains API usage examples and performance benchmarks for the nvCOMP library. nvCOMP is a CUDA library providing generic compression interfaces that allow developers to integrate high-performance GPU-based compressors and decompressors into their applications.

    Detailed algorithm descriptions and benchmarking results are available on the nvCOMP Developer Page.

  5. Overview of cuBLASLt API samples

    main

    The cuBLASLt folder contains several samples demonstrating different ways to use the cublasLtMatmul API. These samples range from drop-in replacements for standard cuBLAS functions to advanced auto-tuning and tensor operation implementations.

    Available Samples

    • LtDgemmPresetAlgo: Executes double precision GEMM with a predefined algorithm. It is a near drop-in replacement for cublasDgemm but includes workspace support for split-K algorithms.
    • LtHSHgemmStridedBatchSimple: Executes mixed precision GEMM. It is a near drop-in replacement for cublasGemmEx with workspace support for split-K algorithms.
    • LtIgemmTensor: Uses cublasLtMatmul to perform tensor-op Igemm with memory order transforms on all buffers.
    • LtPlanarComplex: Uses cublasLtMatmul to perform tensor-op Cgemm using planar complex memory layout and half-precision inputs.
    • LtSgemm: Executes single precision GEMM. It is a near drop-in replacement for cublasSgemm with workspace support for split-K algorithms.
    • LtSgemmCustomFind: Uses the low-level cublasLt API to iterate through multiple combinations of algorithms and configuration attributes for single precision GEMM.
    • LtSgemmSimpleAutoTuning: Performs single precision GEMM auto-tuning by querying cublasLt heuristics to find the best performing algorithm for a specific problem.
  6. Overview of cuBLAS gemm3m usage

    main

    The cublas<t>gemm3m API is used to compute a matrix-matrix product. This specific sample demonstrates the use of the Gauss complexity reduction algorithm for complex matrix multiplication.

    Compatibility

  7. Overview of the cuFFT 2D FFT C2R/R2C example

    main

    This example demonstrates a two-step FFT process:

    1. An in-place two-dimensional complex-to-real (C2R) transform is applied to input data (following default FFTW padding mode requirements).
    2. An in-place two-dimensional real-to-complex (R2C) transform is applied to the normalized output of the first transform.

    This example utilizes the cufftExecC2R API.

  8. Overview of cuFFTDx API Examples

    main

    The cuFFTDx repository contains various examples demonstrating different FFT usage patterns. Examples are categorized into the following groups:

    • Introduction Examples: Basic API introduction.
    • Simple FFT Examples: Includes Thread FFT (complex-to-complex, half-precision) and Block FFT (complex-to-complex, complex-to-real, real-to-complex, and various data types like cuda::std::complex, __half2, or fp16).
    • FFT Performance: Benchmarks for C2C and C2C/R2C/C2R block FFT.
    • NVRTC Examples: Thread and block FFT using NVRTC, including runtime database queries.
    • 2D/3D FFT Examples: 2D and 3D FP32 FFTs, including single-kernel launches using Cooperative Groups and R2C/C2R convolutions.
    • Convolution Examples: Simplified and optimized FFT convolutions (1D and 2D).
    • 3D Convolution Examples: Fused 3D convolutions with preprocessing, filtering, and postprocessing.
    • Mixed Precision Examples: Using separate storage and compute precisions for 1D and 2D FFTs.
  9. Overview of CUDA Library Samples

    main
    The CUDA Library Samples repository provides practical examples demonstrating how to use various NVIDIA GPU-accelerated libraries. These samples are designed to help developers implement high-performance computing tasks such as math operations, image processing, signal processing, linear algebra, and data compression using CUDA.
  10. Overview of Image Euclidean Distance Transform (EDT) using NVIDIA NPP

    main

    This sample demonstrates how to use the NVIDIA Performance Primitives (NPP) library to compute distance transforms and Voronoi diagrams on grayscale images using the GPU.

    Supported Operations

    • Truncated Euclidean Distance Transform (EDT)
    • True (floating-point) Distance Transform
    • Voronoi Diagram Generation

    Key Technical Features

    • Uses nppiDistanceTransformPBA_* functions for GPU acceleration.
    • Supports multiple output types: 16u, 32f, and 16s.
    • Implements batch processing and stream-based execution using NppStreamContext for efficient GPU utilization.
    • Handles raw .raw grayscale image formats.