Skip to content

WIP: Prevent path conflict in builds#2245

Closed
AyodeAwe wants to merge 19 commits intorapidsai:branch-24.08from
AyodeAwe:jawe/ops-2621
Closed

WIP: Prevent path conflict in builds#2245
AyodeAwe wants to merge 19 commits intorapidsai:branch-24.08from
AyodeAwe:jawe/ops-2621

Conversation

@AyodeAwe
Copy link
Copy Markdown
Contributor

@AyodeAwe AyodeAwe commented Mar 25, 2024

Contributes to rapidsai/build-planning#54

This will make builds fail when there are path conflicts

@AyodeAwe AyodeAwe requested a review from a team as a code owner March 25, 2024 19:08
@github-actions github-actions bot added the ci label Mar 25, 2024
@jameslamb jameslamb changed the title Prevent path conflict in builds WIP: Prevent path conflict in builds Apr 22, 2024
@jameslamb jameslamb marked this pull request as draft April 22, 2024 23:11
@jameslamb
Copy link
Copy Markdown
Member

jameslamb commented Apr 23, 2024

This is currently failing with the following conflicts.

(I've included just 1 example of each type below)

(CUDA 11.8 build log) (CUDA 12.2 build log)

  1. fmt and spdlog issues (conflicting packages: conda-forge/fmt, librmm, libraft-headers-only)

Described in rapidsai/rmm#1508 (comment).

  1. (CUDA 11.x only) CUDA toolkit packages packaged differently (conflicting packages: nvidia/cuda-{component}, conda-forge/cudatoolkit)
This transaction has incompatible packages due to a shared path.
  packages: nvidia/linux-64::libcublas-11.11.3.6-0, conda-forge/linux-64::cudatoolkit-11.8.0-h4ba93d1_13
  path: 'lib/libcublas.so.11'

And similar for all these:

lib/libcublas.so.11.11.3.6
lib/libcublasLt.so.11
lib/libcublasLt.so.11.11.3.6
lib/libnvblas.so.11
lib/libnvblas.so.11.11.3.6
lib/libcurand.so.10
lib/libcurand.so.10.3.0.86
lib/libcusolver.so.11
lib/libcusolver.so.11.4.1.48
lib/libcusolverMg.so.11
lib/libcusolverMg.so.11.4.1.48
lib/libcusparse.so.11
lib/libcusparse.so.11.7.5.86
lib/libcublas.so
lib/libcublasLt.so
lib/libnvblas.so
lib/libcurand.so
lib/libcusolver.so
lib/libcusolverMg.so
lib/libcusparse.so
  1. (CUDA 11.x only) lib-{component} and lib-{component}-dev from the nvidia channel
This transaction has incompatible packages due to a shared path.
  packages: nvidia/linux-aarch64::libcusparse-11.7.5.86-0, nvidia/linux-aarch64::libcusparse-dev-11.7.5.86-0, conda-forge/linux-aarch64::cudatoolkit-11.8.0-hdd48f4a_13
  path: 'lib/libcusparse.so.11'
  1. cub (conflicting packages: librmm and libraft-headers-only)
This transaction has incompatible packages due to a shared path.
  packages: rapidsai-nightly/linux-64::librmm-24.06.00a0-cuda11_240325_gfb23a13a_0, file:///tmp/conda-bld-output/linux-64::libraft-headers-only-24.06.00a24-cuda11_240325_g367052cd_24
  path: 'include/rapids/cub/agent/agent_adjacent_difference.cuh'
  1. libcudacxx (conflicting packages: librmm and libraft-headers-only)
This transaction has incompatible packages due to a shared path.
 packages: rapidsai-nightly/linux-64::librmm-24.06.00a0-cuda11_240325_gfb23a13a_0, file:///tmp/conda-bld-output/linux-64::libraft-headers-only-24.06.00a24-cuda11_240325_g367052cd_24
  path: 'include/rapids/libcudacxx/cuda/memory_resource
  1. thrust (conflicting packages: librmm and libraft-headers-only)
This transaction has incompatible packages due to a shared path.
  packages: rapidsai-nightly/linux-64::librmm-24.06.00a0-cuda12_240325_gfb23a13a_0, file:///tmp/conda-bld-output/linux-64::libraft-headers-only-24.06.00a24-cuda12_240325_g367052cd_24
  path: 'include/rapids/thrust/adjacent_difference.h'
  1. rmm (conflicting packages: librmm and libraft-headers-only)
This transaction has incompatible packages due to a shared path.
 packages: rapidsai-nightly/linux-64::librmm-24.06.00a0-cuda12_240325_gfb23a13a_0, file:///tmp/conda-bld-output/linux-64::libraft-headers-only-24.06.00a24-cuda12_240325_g367052cd_24
  path: 'include/rmm/aligned.hpp

@cjnolet cjnolet added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 26, 2024
rapids-bot bot pushed a commit that referenced this pull request May 2, 2024
Contributes to rapidsai/build-planning#54.

The `libraft-headers` and `libraft-headers-only` conda packages are bundling `rmm`'s headers. I believe that's because the `librmm` conda package isn't available in the `libraft*` conda build environment, and as a result it's getting `rmm` via CPM (thanks to `rapids-cmake`).

As a result, this project and any that depend on it are seeing warnings like the following in conda builds where `conda`'s `path_conflict` setting is set to `warn` or `prevent` (like #2245):

```text
This transaction has incompatible packages due to a shared path.
  packages: rapidsai-nightly/linux-64::librmm-24.04.00a38-cuda11_240326_ga98931b9_38, rapidsai-nightly/linux-64::libraft-headers-only-24.04.00a93-cuda11_240326_g9637b3c2_93
  path: 'include/rmm/mr/device/arena_memory_resource.hpp'
```

To fix that, this proposes the following changes:

* make `librmm` a `host` dependency of the following conda packages: `libraft-headers-only`, `libraft-headers`

### Benefits of this change

* slightly smaller `libraft-headers` and `libraft-headers-only` conda packages
* reduced risk of runtime and installation issues caused by file clobbering

## Notes for reviewers

### History of changes to the `librmm` dependency for `libraft-headers`:

* both `run` and `host`: #508
* both `run` and `host`, but ignoring its `run_exports`: #1264
* just `run`, but ignoring its `run_exports`: #2102

In particular, #2102 referred to the `host` dependency on `librmm` as "extraneous" but from a packaging perspective, I don't think it is. `librmm` being in `host` means it'll be present in the build environment, which means its headers will be *found* instead of *downloaded*, and therefore not packaging into the `libraft*` conda packages.

### How I tested this

Built all the `raft` conda packages locally from `branch-24.06` and confirmed that they contain `rmm` headers. Then again from this branch and confirmed they were gone.

```shell
docker run \
    --rm \
    --env-file "${PWD}/aws-creds.env" \
    -v $(pwd):/opt/work \
    -w /opt/work \
    -it rapidsai/ci-conda:cuda12.2.2-ubuntu22.04-py3.10-amd64 \
    bash

CI="true" \
  ci/build_cpp.sh

# On 'branch-24.06', this showed the rmm headers being packaged.
# On this branch, they're omitted.
tar --bzip2 -tf \
  /tmp/conda-bld-output/linux-64/libraft-headers-only-24.06.00a50-cuda12_240430_g1e0e2283_50.tar.bz2 \
| grep 'include/rmm' \
| wc -l
```

Also checked the CI logs from `conda-cpp-build` jobs here. On other recent PRs, I see CPM downloading `rmm` ...

```text
-- CPM: Adding package rmm@24.06 (branch-24.06)
```

... and all the `rmm` headers getting installed as part of the `libraft-headers` package

```text
-- Installing: /opt/conda/conda-bld/_h_env_placehold_placehold_..._placeho/include/rmm/cuda_stream.hpp
```

([build link](https://github.com/rapidsai/raft/actions/runs/8904352932))

Here, I see `librmm` coming through via the conda package requirements ...

```text
The following NEW packages will be INSTALLED:
    ...
    librmm:                      24.06.00a17-cuda12_240430_g26fa9ecb_17 rapidsai-nightly
```

... and being used instead of downloads via CPM ...

```text
-- CPM: Using local package rmm@24.06.0
```

... and no installation of the `rmm` headers as part of building any `libraft` packages.

([build link](https://github.com/rapidsai/raft/actions/runs/8910675575/job/24470450187?pr=2284))

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Ray Douglass (https://github.com/raydouglass)

URL: #2284
@jameslamb jameslamb changed the base branch from branch-24.06 to branch-24.08 May 21, 2024 15:47
@jameslamb
Copy link
Copy Markdown
Member

This work is paused, in favor of pursuing a better long-term solution in the future. Closing this PR for now.

Subscribe to rapidsai/build-planning#54 and rapidsai/build-planning#56 for updates.

@jameslamb jameslamb closed this Jul 18, 2024
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
Contributes to rapidsai/build-planning#54.

The `libraft-headers` and `libraft-headers-only` conda packages are bundling `rmm`'s headers. I believe that's because the `librmm` conda package isn't available in the `libraft*` conda build environment, and as a result it's getting `rmm` via CPM (thanks to `rapids-cmake`).

As a result, this project and any that depend on it are seeing warnings like the following in conda builds where `conda`'s `path_conflict` setting is set to `warn` or `prevent` (like rapidsai#2245):

```text
This transaction has incompatible packages due to a shared path.
  packages: rapidsai-nightly/linux-64::librmm-24.04.00a38-cuda11_240326_ga98931b9_38, rapidsai-nightly/linux-64::libraft-headers-only-24.04.00a93-cuda11_240326_g9637b3c2_93
  path: 'include/rmm/mr/device/arena_memory_resource.hpp'
```

To fix that, this proposes the following changes:

* make `librmm` a `host` dependency of the following conda packages: `libraft-headers-only`, `libraft-headers`

### Benefits of this change

* slightly smaller `libraft-headers` and `libraft-headers-only` conda packages
* reduced risk of runtime and installation issues caused by file clobbering

## Notes for reviewers

### History of changes to the `librmm` dependency for `libraft-headers`:

* both `run` and `host`: rapidsai#508
* both `run` and `host`, but ignoring its `run_exports`: rapidsai#1264
* just `run`, but ignoring its `run_exports`: rapidsai#2102

In particular, rapidsai#2102 referred to the `host` dependency on `librmm` as "extraneous" but from a packaging perspective, I don't think it is. `librmm` being in `host` means it'll be present in the build environment, which means its headers will be *found* instead of *downloaded*, and therefore not packaging into the `libraft*` conda packages.

### How I tested this

Built all the `raft` conda packages locally from `branch-24.06` and confirmed that they contain `rmm` headers. Then again from this branch and confirmed they were gone.

```shell
docker run \
    --rm \
    --env-file "${PWD}/aws-creds.env" \
    -v $(pwd):/opt/work \
    -w /opt/work \
    -it rapidsai/ci-conda:cuda12.2.2-ubuntu22.04-py3.10-amd64 \
    bash

CI="true" \
  ci/build_cpp.sh

# On 'branch-24.06', this showed the rmm headers being packaged.
# On this branch, they're omitted.
tar --bzip2 -tf \
  /tmp/conda-bld-output/linux-64/libraft-headers-only-24.06.00a50-cuda12_240430_g1e0e2283_50.tar.bz2 \
| grep 'include/rmm' \
| wc -l
```

Also checked the CI logs from `conda-cpp-build` jobs here. On other recent PRs, I see CPM downloading `rmm` ...

```text
-- CPM: Adding package rmm@24.06 (branch-24.06)
```

... and all the `rmm` headers getting installed as part of the `libraft-headers` package

```text
-- Installing: /opt/conda/conda-bld/_h_env_placehold_placehold_..._placeho/include/rmm/cuda_stream.hpp
```

([build link](https://github.com/rapidsai/raft/actions/runs/8904352932))

Here, I see `librmm` coming through via the conda package requirements ...

```text
The following NEW packages will be INSTALLED:
    ...
    librmm:                      24.06.00a17-cuda12_240430_g26fa9ecb_17 rapidsai-nightly
```

... and being used instead of downloads via CPM ...

```text
-- CPM: Using local package rmm@24.06.0
```

... and no installation of the `rmm` headers as part of building any `libraft` packages.

([build link](https://github.com/rapidsai/raft/actions/runs/8910675575/job/24470450187?pr=2284))

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Ray Douglass (https://github.com/raydouglass)

URL: rapidsai#2284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants