Skip to content

[FEA] LTO IR Support (1) - Introduce LibRTCX - #21625

Merged
rapids-bot[bot] merged 275 commits into
NVIDIA:mainfrom
lamarrr:drop-jitify
May 22, 2026
Merged

[FEA] LTO IR Support (1) - Introduce LibRTCX#21625
rapids-bot[bot] merged 275 commits into
NVIDIA:mainfrom
lamarrr:drop-jitify

Conversation

@lamarrr

@lamarrr lamarrr commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request introduces new library called librtcx for JIT compilation & linking (replacing JITIFY).
Jitify previously helped bootstrap and get JIT compilation working quickly but, it has proven to be difficult for continued usage, due to multiple factors:

  • Lacks support for JIT-linking of AOT-compiled fragments, We've had to convert PTX into inline assembly in CUDA, and the current interface provides no concrete way to integrate AOT-compiled LTO-IR fragments
  • It packs each CUDA kernel as preprocessed source strings, which is large, slow, and doesn't scale (in JIT compilation-time & binary size)
  • It represents the source code as large hex arrays which slows down syntax highlighting, and forced workarounds like setting compiler _FILE_OFFSET_BITS to 64-bits to enable large arrays of binaries in C++ code rather than embedding it
  • Lacks support for source code compression (even with the -minify option). The preprocessed headers are duplicated across each kernel, this doesn't scale as we use more existing CUDF, CCCL, & CUB headers and expand the number of JIT kernels
  • Lacks support for user-managed cache or fragments
  • It doesn't expose or provide any interface into the underlying library handles (NVRTC, NVJITLINK, CUDART)
  • Most of the abstractions and advantages provided by JITIFY are not suitable and have become a barrier compared to calling NVRTC, NVJITLink, and CUDART directly
  • Lacks support for pre-loading/pre-populating the in-memory JIT cache, which has been requested by our partners and is necessary for accurate benchmarking

This Pull Request:

  • Implements librtcx, a wrapper on top of NVRTC, NVJITLINK, and CUDART to provide full control of the JIT compilation pipeline

Future Work

  • Unit tests for the LibRTCX abstractions

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

- Introduced a new `jit_bundle` class to encapsulate JIT installation and management.
- Updated `cache_statistics` to include disk hit/miss counters for blobs and fragments.
- Removed the custom `rw_spinlock_t` implementation in favor of standard synchronization mechanisms.
- Enhanced the `cache_t` class to manage JIT bundle installation and caching more effectively.
- Refactored file handling functions to improve clarity and error handling.
- Updated kernel compilation logic to utilize the new JIT bundle structure.
- Improved test cases for fragment creation to reflect changes in the JIT compilation process.
- Change LZ4 library linking from static to object files for better flexibility.
- Update LZ4 compression method in Python script to use block compression.
- Enhance JIT installation logging for better debugging.
- Modify CMake configuration to use the latest LZ4 development version.
@lamarrr lamarrr removed Python Affects Python cuDF API. Java Affects Java cuDF API. labels May 21, 2026
@bdice

bdice commented May 21, 2026

Copy link
Copy Markdown
Contributor

/ok to test a0ec040

@bdice bdice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your care and attention to detail!

@lamarrr

lamarrr commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@lamarrr

lamarrr commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d146ece

@lamarrr lamarrr changed the title [FEA] Introduce LibRTCX [FEA] LTO-IR Support (1) - Introduce LibRTCX May 22, 2026
@lamarrr lamarrr changed the title [FEA] LTO-IR Support (1) - Introduce LibRTCX [FEA] LTO IR Support (1) - Introduce LibRTCX May 22, 2026
@rapids-bot
rapids-bot Bot merged commit 99f9861 into NVIDIA:main May 22, 2026
129 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python May 22, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 14, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake CMake build issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants