Skip to content

Use lld linker libcuvs conda - #2990

Draft
robertmaynard wants to merge 2 commits into
NVIDIA:mainfrom
robertmaynard:use-lld-linker-libcuvs-conda
Draft

robertmaynard wants to merge 2 commits into
NVIDIA:mainfrom
robertmaynard:use-lld-linker-libcuvs-conda

Conversation

@robertmaynard

@robertmaynard robertmaynard commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Link libcuvs conda package with lld

Add a build-for-packaging CMake preset (Release build, all supported GPU
architectures, lld linker) and use it for the libcuvs conda build via
build.sh's --cmake-args. Only the libcuvs recipe changes; the cuvs and
cuvs-bench recipes and the wheel builds are unchanged.

build.sh passes CMAKE_BUILD_TYPE and CMAKE_CUDA_ARCHITECTURES as -D flags
ahead of --cmake-args. Command-line -D values take precedence over a
preset's cache variables, so --gpu-arch and a non-Release build type still
apply when the preset is selected; the setting the preset adds in the
build.sh path is the linker.

Measured link times, default GNU ld vs lld 23.1.4 (CUDA 13.3, conda GCC
13.3, CMAKE_CUDA_ARCHITECTURES=RAPIDS as with build.sh --allgpuarch, 64
cores, idle machine, median of 5 interleaved runs of the link commands
taken from ninja -t commands):

libcuvs.so (274 MB) 3.88 s -> 0.56 s (6.9x faster)
libcuvs_c.so (3.6 MB) 0.21 s -> 0.06 s (3.8x faster)

@copy-pr-bot

copy-pr-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@robertmaynard robertmaynard added feature request New feature or request non-breaking Introduces a non-breaking change ci labels Nov 2, 2026
Add a `build-for-packaging` CMake preset (Release build, all supported GPU
architectures, lld linker) and use it for the libcuvs conda build via
build.sh's --cmake-args. Only the libcuvs recipe changes; the cuvs and
cuvs-bench recipes and the wheel builds are unchanged.

build.sh passes CMAKE_BUILD_TYPE and CMAKE_CUDA_ARCHITECTURES as -D flags
ahead of --cmake-args. Command-line -D values take precedence over a
preset's cache variables, so --gpu-arch and a non-Release build type still
apply when the preset is selected; the setting the preset adds in the
build.sh path is the linker.

Measured link times, default GNU ld vs lld 23.1.4 (CUDA 13.3, conda GCC
13.3, CMAKE_CUDA_ARCHITECTURES=RAPIDS as with build.sh --allgpuarch, 64
cores, idle machine, median of 5 interleaved runs of the link commands
taken from `ninja -t commands`):

  libcuvs.so (274 MB)   3.88 s -> 0.56 s   (6.9x faster)
  libcuvs_c.so (3.6 MB) 0.21 s -> 0.06 s   (3.8x faster)

A single-architecture (sm_75) build shows the same: libcuvs.so goes from
3.68 s to 0.48 s (7.7x).

Trade-offs and limits of the measurement:
- This saves about 3.3 s per libcuvs.so link, against an all-arch compile
  of roughly 85 minutes. Link time barely grows with the number of GPU
  architectures because the extra size is embedded device code.
- The lld-linked libcuvs.so is about 7 MB larger (the unloaded .strtab
  symbol-name table) and its peak RSS is higher (723 MB -> 976 MB).
- The tests and bench-ann executables the recipe also links were not
  measured.
Developers who build with build.sh can now select the build-for-packaging
preset (--cmake-args="--preset=build-for-packaging") without installing lld
separately. Regenerate the conda environment files.
@robertmaynard
robertmaynard force-pushed the use-lld-linker-libcuvs-conda branch from 2c4e9ba to ca09b09 Compare November 2, 2026 21:34
@robertmaynard

Copy link
Copy Markdown
Contributor Author

/okay to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci feature request New feature or request non-breaking Introduces a non-breaking change

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant