Skip to content

Support Nvidia GPUs in the MLIR backend#17

Merged
guillon merged 4 commits intoxtc-tools:mainfrom
ElectrikSpace:dev/snoiry/gpu
Jan 27, 2026
Merged

Support Nvidia GPUs in the MLIR backend#17
guillon merged 4 commits intoxtc-tools:mainfrom
ElectrikSpace:dev/snoiry/gpu

Conversation

@ElectrikSpace
Copy link
Copy Markdown
Contributor

@ElectrikSpace ElectrikSpace commented Jan 13, 2026

Motivation

Target Nvidia GPUs through the MLIR backend

Description

Add basic support for Nvidia GPUs, leveraging the existing support in MLIR. This also adds support for Cupti performance counters in the runtime.

TODO:

  • Have several runtimes such that in the same python process compile for the llmvir target and the nvgpu target

@ElectrikSpace ElectrikSpace marked this pull request as ready for review January 16, 2026 17:03
@guillon guillon self-requested a review January 19, 2026 16:08
@guillon guillon added the enhancement New feature or request label Jan 19, 2026
Comment thread src/xtc/csrcs/runtimes/host/runtime.h Outdated
Comment thread tests/filecheck/evaluation/test_matmul_pmu_counters_gpu.py
Comment thread tests/filecheck/backends/test_matmul_mlir_parallel.py
Comment thread src/xtc/csrcs/runtimes/gpu/perf_event_gpu.h Outdated
This commit adds a new target to the MLIR backend for NVidia GPUS. It
requires a specific build of llvm-project with options:
  - LLVM_TARGETS_TO_BUILD="host;NVPTX"
  - MLIR_ENABLE_CUDA_RUNNER=ON
  - MLIR_NVVM_EMBED_LIBDEVICE=ON
The PTX version is currently hardcoded to sm_80 and ptx75+ (Ampere).

Tested on Nvida A100, Nvidia L40S, and Nvidia L4.
These are now inferred from nvidia-smi and nvcc. Of course these tools
need to be installed, but they are part of the Nvidia toolkit.
The implementation relies on the Nvidia CUpti profiling library.
More specifically, it uses the range profiler.

It integrates itself in the XTC runtime if preprocessor conditions and
hooks.
- Vectorization is not supported for now
- GPU kernels are generated only if there is one or multiple parallel
  axes for now.
@guillon guillon merged commit 5774581 into xtc-tools:main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants