Skip to content

Commit

Permalink
refine build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 14, 2025
1 parent e35df32 commit 7853681
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ tmp/
.hypothesis
wheels/
wheelhouse/
raft_log.txt
_skbuild/

## files pickled in notebook when ran during python docstring generation
Expand Down
13 changes: 12 additions & 1 deletion ci/build_wheel_cuml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ package_dir="python/cuml"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# Download the libcuml wheel built in the previous step and make it
# available for pip to find.
LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libcuml_dist)

# TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged
source ./ci/use_wheels_from_prs.sh

cat >> ./constraints.txt <<EOF
libcuml-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUGRAPH_WHEELHOUSE}/libcuml_*.whl)
EOF

# Using env variable PIP_CONSTRAINT is necessary to ensure the constraints
# are used when creating the isolated build environment.
export PIP_CONSTRAINT="${PWD}/constraints.txt"

EXCLUDE_ARGS=(
--exclude "libcuml++.so"
--exclude "libcumlprims_mg.so"
Expand All @@ -20,7 +32,6 @@ EXCLUDE_ARGS=(
case "${RAPIDS_CUDA_VERSION}" in
12.*)
EXCLUDE_ARGS+=(
--exclude "libcuvs.so"
--exclude "libcublas.so.12"
--exclude "libcublasLt.so.12"
--exclude "libcufft.so.11"
Expand Down
3 changes: 2 additions & 1 deletion ci/build_wheel_libcuml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ python -m pip install \
# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735)
export PIP_NO_BUILD_ISOLATION=0

# TODO(jameslamb): it's weird to "exclude" libcumlprims_mg just as a way to stop auditwheel from complaining... when it really is in the wheel
# NOTE: 'libcumlprims_mg.so' is marked as '--exclude' here because auditwheel doesn't detect it,
# but it really is intentionally included in 'libcuml' wheels
EXCLUDE_ARGS=(
--exclude "libcumlprims_mg.so"
--exclude "libcuvs.so"
Expand Down
19 changes: 17 additions & 2 deletions ci/validate_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@ set -euo pipefail
package_dir=$1
wheel_dir_relative_path=$2

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"

# some packages are much larger on CUDA 11 than on CUDA 12
PYDISTCHECK_ARGS=()
if [[ "${package_dir}" == "python/libcuml" ]]; then
if [[ "${RAPIDS_CUDA_MAJOR}" == "11" ]]; then
PYDISTCHECK_ARGS+=(
--max-allowed-size-compressed '1.0G'
)
else
PYDISTCHECK_ARGS+=(
--max-allowed-size-compressed '500M'
)
fi
fi

cd "${package_dir}"

rapids-logger "validate packages with 'pydistcheck'"

# TODO(jameslamb) add libcuml here

pydistcheck \
--inspect \
"${PYDISTCHECK_ARGS[@]}" \
"$(echo ${wheel_dir_relative_path}/*.whl)"

rapids-logger "validate packages with 'twine'"
Expand Down
3 changes: 0 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ files:
extras:
table: project
includes:
- cuda_wheels
- depends_on_cudf
- depends_on_cupy
- depends_on_cuvs
Expand Down Expand Up @@ -161,7 +160,6 @@ files:
- common_build
- depends_on_libraft
- depends_on_librmm
- depends_on_treelite
- py_build
py_run_libcuml:
output: pyproject
Expand All @@ -172,7 +170,6 @@ files:
- cuda_wheels
- depends_on_cuvs
- depends_on_libraft
- depends_on_treelite
channels:
- rapidsai
- rapidsai-nightly
Expand Down
2 changes: 0 additions & 2 deletions python/cuml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ include(../../rapids_config.cmake)
option(CUML_CPU "Build only cuML CPU Python components." OFF)
set(language_list "CXX")

# TODO(jameslamb): can this be removed? (I think so?)
if(NOT CUML_CPU)
# TODO(jameslamb): where does rapids_cuda_init_architectures belong?
# We always need CUDA for cuML GPU because the raft dependency brings in a
# header-only cuco dependency that enables CUDA unconditionally.
include(rapids-cuda)
Expand Down
11 changes: 2 additions & 9 deletions python/cuml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ requires = [
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[tool.pydistcheck]
# TODO(jameslamb): update this once libcuml is working
select = [
"distro-too-large-compressed",
]

# detect when package size grows significantly
max_allowed_size_compressed = '1.5G'
# PyPI limit is 100 MiB, fail CI before we get too close to that
max_allowed_size_compressed = '75M'

[tool.pytest.ini_options]
addopts = "--tb=native"
Expand Down Expand Up @@ -102,11 +101,6 @@ dependencies = [
"libcuml==25.2.*,>=0.0.0a0",
"numba>=0.57",
"numpy>=1.23,<3.0a0",
"nvidia-cublas",
"nvidia-cufft",
"nvidia-curand",
"nvidia-cusolver",
"nvidia-cusparse",
"packaging",
"pylibraft==25.2.*,>=0.0.0a0",
"raft-dask==25.2.*,>=0.0.0a0",
Expand Down Expand Up @@ -176,7 +170,6 @@ versioneer\.py |
[tool.rapids-build-backend]
build-backend = "scikit_build_core.build"
dependencies-file = "../../dependencies.yaml"
# TODO(jameslamb): can 'cuda_wheels=true' be removed?
matrix-entry = "cuda_suffixed=true"

requires = [
Expand Down
4 changes: 0 additions & 4 deletions python/libcuml/libcuml/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ def load_library():
# the loader can find it.
pass

# treelite must be loaded before libcuml++ because libcuml++
# references its symbols
import treelite

prefer_system_installation = (
os.getenv("RAPIDS_LIBCUML_PREFER_SYSTEM_LIBRARY", "false").lower()
!= "false"
Expand Down
5 changes: 0 additions & 5 deletions python/libcuml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies = [
"nvidia-curand",
"nvidia-cusolver",
"nvidia-cusparse",
"treelite==4.3.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Expand All @@ -59,9 +58,6 @@ select = [
"distro-too-large-compressed",
]

# TODO(jameslamb): update ci/validate_whee.sh
max_allowed_size_compressed = '5.0G'

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
cmake.build-type = "Release"
Expand Down Expand Up @@ -89,5 +85,4 @@ requires = [
"libraft==25.2.*,>=0.0.0a0",
"librmm==25.2.*,>=0.0.0a0",
"ninja",
"treelite==4.3.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

0 comments on commit 7853681

Please sign in to comment.