Skip to content

[FEA] LTO IR Support (3) - Replace JITIFY usage with LIBRTCX - #22654

Merged
rapids-bot[bot] merged 307 commits into
NVIDIA:mainfrom
lamarrr:lto-ir-3--rtcx-adoption
Jun 5, 2026
Merged

[FEA] LTO IR Support (3) - Replace JITIFY usage with LIBRTCX#22654
rapids-bot[bot] merged 307 commits into
NVIDIA:mainfrom
lamarrr:lto-ir-3--rtcx-adoption

Conversation

@lamarrr

@lamarrr lamarrr commented May 24, 2026

Copy link
Copy Markdown
Contributor

Description

This PR:

  • Replaces all uses of JITIFY with LIBRTCX
  • Minor refactoring of LibRTCX
  • Adds new features:
    • JIT Cache preloading
    • NVTX ranges on all compilation/linking steps
    • CUDA cache management (LIBCUDF_JIT_DISABLE_CUDA_CACHE)
    • More benchmarking and profiling functionalities (LIBCUDF_JIT_DUMP_TRACE, LIBCUDF_JIT_DUMP_TIME_PROFILE, LIBCUDF_KERNEL_CACHE_DISABLED)
    • Removes the 64-bit source-code workaround _FILE_OFFSET_BITS=64 (replaced by ASM embedding)

Immediate Impact

  • Reduces libcudf.so from 516 MB to 494 MB, a 4.26% binary size decrease due to LIBRTCX's compressed CUDA source code embedding, unlike JITIFY's per-kernel preprocessed CUDA source strings

Checklist

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

- Updated CMakeLists.txt to remove unnecessary comments and added src/jit/jit.cpp to the build.
- Enhanced JitEmbed.cmake for better dependency management and code clarity.
- Renamed structures in column_view.cuh for consistency and clarity.
- Updated thunk.cuh to reflect new structure names and ensure proper mapping.
- Modified types.cuh to align with new structure names and improve documentation.
- Cleaned up transform.hpp by removing unnecessary whitespace.
- Introduced jit.cpp and jit.hpp for improved JIT compilation handling.
- Added README.md for documentation on JIT LTO functionality.
- Updated cache.hpp and rtc.cpp to include necessary checks and improve error handling.
- Refactored context.cpp and context.hpp to integrate new JIT bundle structure.
- Adjusted transform2.cu to ensure proper namespace usage.
- Updated rtc.cpp test cases to reflect changes in structure names and improve test clarity.
- Introduced new header files in `librtcx/system_includes` for various standard library components, including algorithm, array, atomic, barrier, bit, cassert, complex, and more, all utilizing the CUDA standard library.
- Updated the `context` class to replace the old RTC cache implementation with the new `rtcx` namespace, ensuring proper initialization and usage of the cache.
- Refactored includes and namespaces to maintain consistency and improve code organization.
… and remove deprecated nullable_element functions
…orm2.cu, and update export.hpp copyright year
… and improve column handling

- Updated `transform_input` to remove `mutable_column_view` and streamline input handling.
- Introduced `transform_output` struct to specify output types and nullability policies.
- Modified `transform_extended2` to return a `table` instead of a vector of columns, enhancing output management.
- Refactored `column_accessor` to utilize `detail::column_device_view_base` for better abstraction.
- Removed deprecated reflection functions for input accessors and adjusted related helper functions.
- Enhanced `transform_udf` to work with the new column view structure, ensuring compatibility with the updated input/output specifications.
- Updated kernel launch and argument handling to accommodate changes in input and output types.
- Improved nullability checks and handling in the transform execution flow.
- Added support for pre-allocated string offsets in output columns to optimize memory usage.
@lamarrr

lamarrr commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2d0e7c2

@lamarrr

lamarrr commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Can we remove https://github.com/rapidsai/cudf/blob/2d4cc67d7bced44c48ee7efa8d6096372daf9032/cpp/include/cudf/detail/operation-udf.hpp?

No, we can't, I accidentally omitted it for some of the kernels while re-applying my local patch files.
It is required not just for the explainability of the flow but also to instantiate the kernels, as NVCC/NVRTC can't have defines with complex CUDA strings in them.

@lamarrr

lamarrr commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2d0e7c2

@copy-pr-bot

copy-pr-bot Bot commented May 28, 2026

Copy link
Copy Markdown

/ok to test 2d0e7c2

@lamarrr, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@lamarrr

lamarrr commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test da973b9

@lamarrr
lamarrr requested review from bdice and vyasr May 28, 2026 15:32

@vyasr vyasr 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.

I'm comfortable moving forward with this so we can start on the proposed next steps of the split.

@lamarrr

lamarrr commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

awaiting re-review from @bdice

@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.

Nice work. I have a few minor comments. Please merge when you're ready.

Comment thread cpp/src/jit/cache.cpp
Comment thread cpp/src/runtime/context.cpp
Comment thread cpp/src/transform/jit/kernel.cu
@lamarrr

lamarrr commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

thanks for the feedback @bdice & @vyasr

@lamarrr

lamarrr commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 363920c into NVIDIA:main Jun 5, 2026
217 of 219 checks passed
@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.

4 participants