[FEA] LTO IR Support (4) - Implement LTO Transform Kernels - #22680
Merged
Conversation
…amarrr/cudf into multi-output-transform-support
Co-authored-by: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com>
Co-authored-by: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com>
…amarrr/cudf into multi-output-transform-support
Contributor
Author
|
/ok to test 9cfd77f |
Contributor
Author
|
/ok to test 19e47b9 |
…pile_library and compile_fragment
Contributor
Author
|
/ok to test 543e226 |
3 tasks
Contributor
Author
|
/ok to test f730f36 |
… checks - Removed the `fallible` enum and related checks from the transform functions and kernels. - Updated the `multi_transform` and `transform_lto` functions to no longer accept a fallibility parameter. - Adjusted the kernel implementation to handle errors without the fallibility flag. - Modified the CMake configuration to reflect changes in the transform kernel instantiation. - Updated tests to remove fallibility assertions and ensure compatibility with the new implementation.
Contributor
Author
|
/ok to test a2034e2 |
…t to store versions
Contributor
Author
|
/ok to test 5a85802 |
…ile_library and compile_fragment functions
Contributor
Author
|
/ok to test f7d2883 |
bdice
approved these changes
Jul 3, 2026
Contributor
Author
|
/merge |
3 tasks
rapids-bot Bot
pushed a commit
that referenced
this pull request
Jul 6, 2026
#23106) Since #22680, a from-scratch `./build.sh` with the **Unix Makefiles** generator fails with: ``` gmake[2]: *** No rule to make target 'CMakeFiles/cudf_fragments_transform_kernel_20.dir/src/transform/jit/kernel.fatbin', needed by 'rtcx_embed/cudf_fragments.hpp'. Stop. ``` The `rtcx_embed()` custom command depends on the fragment object libraries only via `$<TARGET_OBJECTS:...>` generator expressions. With the Makefiles generator this produces file-level prerequisites with no build rule and no target-level ordering — `cudf_fragments.dir/all` only depended on `cudf_fragments__jit_embed_run`, not on the 21 `cudf_fragments_transform_kernel_N` object libraries — so a parallel make races ahead of the fatbin compilations and dies. Ninja resolves the same dependency through its global build graph, which is why CI never hit this. The fix records the object-library target names in a new `EMBED_TARGET_DEP_NAMES` property alongside the existing `$<TARGET_OBJECTS:...>` genexes, and passes those names to the custom command `DEPENDS`. Naming a real target there makes CMake emit a proper target-level dependency, so the Makefiles generator builds all fragment fatbins before running the embed step. Verified locally with CMake 4.3.4 + Unix Makefiles: after this change `Makefile2` contains target-level deps from `cudf_fragments.dir/all` on every `cudf_fragments_transform_kernel_N.dir/all`, and a clean-state `-j32` build of `cudf_fragments` (and a full `./build.sh`) succeeds where it previously failed. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Bradley Dice (https://github.com/bdice) - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: #23106
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds LTO-based transforms to libcudf by introducing a new
cudf::transform_ltoAPI that accepts LTO-IR or FATBIN UDF binaries and executes them through the existing transform pipeline. The API supports typed transform inputs/outputs, null-awareness, and optional user data.The change enables libcudf transforms to execute precompiled device UDF fragments instead of relying only on source/PTX-style runtime compilation. This creates a path for lower-overhead, link-time-optimized transform kernels while preserving the existing transform abstraction around input columns, scalar inputs, output specifications, and null policy.
The AOT-compiled transform UDF has a similar ABI signature as NUMBA-CUDA UDFs (https://nvidia.github.io/numba-cuda/user/cuda_ffi.html):
The integer return is used for signaling errors (non-zero values) and may be discarded or propagated by the implementation.
This pull request also replaces the software SHA256 implementation with a SIMD-accelerated xxHash implementation (XXH3-128, ported from #22920). SHA256 was initially chosen as the obvious choice for a collision-free hash, and it was implemented to keep dependencies minimal.
For a hot JIT cache, the previous cryptographic SHA256 hash took ~88.1% (~4727ns) of the
get_kernelfunction execution time.With the new non-cryptographic SIMD-accelerated hash, the hash time is reduced by 16.33x to 288ns, ~31.2% of the
get_kernelfunction execution time.This pull request also:
cudaGetDevicePropertiesvalues into the cudf context object; each call takes ~1.8ms per-call (see: [BUG] Repeated calls tocudaGetDevicePropertiescauses launch overhead in JIT kernels #23074)nvrtc-related flags be dispatched by thenvrtcVersionand notcudaGetRuntimeVersion. They can be differentdiscard_errorsspecialization of the transform kernel; this helps reduce the number of kernel instantiations that need to be pre-compiled, and also reduces kernel varianceCloses #19578 & #23074
Benchmarks
Throughput benchmarks are provided in #22680 (comment), and compilation-time benchmarks are provided in #22680 (comment)
Checklist