Skip to content

chore: speed up CUDA kernel compilation#7509

Merged
0ax1 merged 1 commit intodevelopfrom
adroste/split-cuda-kernel-build
Apr 17, 2026
Merged

chore: speed up CUDA kernel compilation#7509
0ax1 merged 1 commit intodevelopfrom
adroste/split-cuda-kernel-build

Conversation

@0ax1
Copy link
Copy Markdown
Contributor

@0ax1 0ax1 commented Apr 17, 2026

Previously, changing a .cu file triggered cargo to rerun vortex-cuda's build script, which recompiled all CUDA kernels and regenerated bindgen output, causing a full Rust recompilation. Besides skipping the Rust recompilation, we now do timestamp-based PTX compilation: Only recompile .cu files whose PTX is older than the source or any header.

@0ax1 0ax1 enabled auto-merge (squash) April 17, 2026 10:06
@0ax1 0ax1 requested a review from AdamGS April 17, 2026 10:06
@0ax1 0ax1 added the changelog/chore A trivial change label Apr 17, 2026
Comment thread vortex-cuda/kernel-build/src/lib.rs Outdated
Comment thread vortex-cuda/kernel-build/build.rs Outdated
Comment thread vortex-cuda/kernel-build/build.rs Outdated
Stop registering .cu/.cuh files with cargo:rerun-if-changed so that
editing a CUDA kernel no longer triggers a full Rust rebuild of
vortex-cuda. The build script still compiles PTX on clean builds via
timestamp-based staleness checks, and uses write-if-changed for
generated bit_unpack files to avoid unnecessary mtime bumps.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0ax1 0ax1 force-pushed the adroste/split-cuda-kernel-build branch from 22a8228 to 9f27745 Compare April 17, 2026 10:45
@0ax1 0ax1 requested a review from AdamGS April 17, 2026 10:47
@0ax1 0ax1 merged commit 6ebb797 into develop Apr 17, 2026
69 of 71 checks passed
@0ax1 0ax1 deleted the adroste/split-cuda-kernel-build branch April 17, 2026 11:02
0ax1 added a commit that referenced this pull request Apr 17, 2026
This reverts commit 6ebb797.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
0ax1 added a commit that referenced this pull request Apr 17, 2026
Needs to be reverted as CUDA changes are not properly picked up by
build.rs Turns out there's no way to skip Rust build time and linkage,
even if only the CUDA files changed that need to be re-generated.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants