Skip to content

Commit

Permalink
Only install necessary components in conda packages. (#2209)
Browse files Browse the repository at this point in the history
Closes #2175.

**This PR cuts the binary size of `libraft` by about 50%.** In total, this PR shrinks the binary size of the entire C++ conda channel (the sum of all conda packages produced by `conda/recipes/libraft/meta.yaml`) by around 20%, from 1.5 GB to 1.2 GB. The main difference is dropping the extraneous copy of `libraft.a` (~300 MB) that was shipped in the `libraft` package.

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Corey J. Nolet (https://github.com/cjnolet)
  - https://github.com/damontecres
  - Ray Douglass (https://github.com/raydouglass)

URL: #2209
  • Loading branch information
bdice authored Mar 7, 2024
1 parent e470177 commit 2d714cb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions conda/recipes/libraft/build_libraft.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

./build.sh libraft --allgpuarch --compile-lib --build-metrics=compile_lib --incl-cache-stats --no-nvtx
./build.sh libraft --allgpuarch --compile-lib --build-metrics=compile_lib --incl-cache-stats --no-nvtx -n
cmake --install cpp/build --component compiled
5 changes: 4 additions & 1 deletion conda/recipes/libraft/build_libraft_headers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

# We must install everything (not just the "raft" component) because some
# dependencies like cuCollections and cutlass place their install rules in the
# "all" component.
./build.sh libraft --allgpuarch --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

./build.sh tests bench-prims --allgpuarch --no-nvtx --build-metrics=tests_bench_prims --incl-cache-stats
cmake --install cpp/build --component testing
3 changes: 3 additions & 0 deletions conda/recipes/libraft/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ cmake_version:
nccl_version:
- ">=2.9.9"

gbench_version:
- "==1.8.0"

gtest_version:
- ">=1.13.0"

Expand Down
6 changes: 6 additions & 0 deletions conda/recipes/libraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ outputs:
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
# We must include both libraft and libraft-static to prevent the test
# builds from packaging those libraries. However, tests only depend on
# the shared library in libraft.
- {{ pin_subpackage('libraft', exact=True) }}
- {{ pin_subpackage('libraft-static', exact=True) }}
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }}
Expand All @@ -300,6 +304,7 @@ outputs:
- libcusolver-dev
- libcusparse-dev
{% endif %}
- benchmark {{ gbench_version }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
run:
Expand All @@ -314,6 +319,7 @@ outputs:
- libcusparse
{% endif %}
- {{ pin_subpackage('libraft', exact=True) }}
- benchmark {{ gbench_version }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
about:
Expand Down

0 comments on commit 2d714cb

Please sign in to comment.