From 54a5385de76688991c2ff8afcd00f79725c5e812 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 15 Oct 2024 11:33:13 -0500 Subject: [PATCH 01/12] build wheels without build isolation --- .github/workflows/pr.yaml | 155 -------------------------------------- ci/build_wheel.sh | 37 +++++++-- 2 files changed, 32 insertions(+), 160 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1ca4589500..f868822ef8 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,148 +12,12 @@ concurrency: jobs: pr-builder: needs: - - changed-files - - checks - - clang-tidy - - conda-cpp-build - - conda-cpp-tests - - conda-cpp-checks - - conda-python-build - - conda-python-tests-singlegpu - - conda-python-tests-dask - - conda-notebook-tests - - docs-build - wheel-build-cuml - - wheel-tests-cuml - - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} - changed-files: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 - with: - files_yaml: | - test_cpp: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/**' - - '!thirdparty/LICENSES/**' - test_notebooks: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!thirdparty/LICENSES/**' - test_python: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!thirdparty/LICENSES/**' - checks: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 - with: - enable_check_generated_files: false - ignored_pr_jobs: >- - optional-job-conda-python-tests-cudf-pandas-integration - clang-tidy: - needs: checks - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - with: - build_type: pull-request - node_type: "cpu8" - arch: "amd64" - container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" - run_script: "ci/run_clang_tidy.sh" - conda-cpp-build: - needs: checks - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 - with: - build_type: pull-request - conda-cpp-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp - with: - build_type: pull-request - conda-cpp-checks: - needs: conda-cpp-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 - with: - build_type: pull-request - enable_check_symbols: true - symbol_exclusions: raft_cutlass - conda-python-build: - needs: conda-cpp-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 - with: - build_type: pull-request - conda-python-tests-singlegpu: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: "ci/test_python_singlegpu.sh" - optional-job-conda-python-tests-cudf-pandas-integration: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - matrix_filter: map(select(.ARCH == "amd64")) - build_type: pull-request - script: "ci/test_python_integration.sh" - conda-python-tests-dask: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: "ci/test_python_dask.sh" - conda-notebook-tests: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:latest" - run_script: "ci/test_notebooks.sh" - docs-build: - needs: conda-python-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:latest" - run_script: "ci/build_docs.sh" wheel-build-cuml: needs: checks secrets: inherit @@ -164,22 +28,3 @@ jobs: extra-repo: rapidsai/cumlprims_mg extra-repo-sha: branch-24.12 extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY - wheel-tests-cuml: - needs: [wheel-build-cuml, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: ci/test_wheel.sh - devcontainer: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12 - with: - arch: '["amd64"]' - cuda: '["12.5"]' - extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY - build_command: | - sccache -z; - build-all --verbose; - sccache -s; diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 976d7003dd..da30bbacc8 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -3,7 +3,9 @@ set -euo pipefail +package_name="cuml" package_dir="python/cuml" +underscore_package_name=$(echo "${package_name}" | tr "-" "_") source rapids-configure-sccache source rapids-date-string @@ -14,6 +16,27 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" # everywhere except in the final wheel name. PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" +rapids-logger "Generating build requirements" +matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_build_${underscore_package_name}" \ + --matrix "${matrix_selectors}" \ +| tee /tmp/requirements-build.txt + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_rapids_build_${underscore_package_name}" \ + --matrix "${matrix_selectors}" \ +| tee -a /tmp/requirements-build.txt + +rapids-logger "Installing build requirements" +python -m pip install \ + -v \ + --prefer-binary \ + -r /tmp/requirements-build.txt + rapids-generate-version > ./VERSION cd ${package_dir} @@ -40,14 +63,18 @@ case "${RAPIDS_CUDA_VERSION}" in ;; esac -SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" \ - python -m pip wheel . \ +export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" + +rapids-logger "Building '${package_name}' wheel" +python -m pip wheel \ -w dist \ - -vvv \ + -v \ + --no-build-isolation \ --no-deps \ - --disable-pip-version-check + --disable-pip-version-check \ + . mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* -RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist From a8fb59840e94ffbcc0157fb6f1fe2bea6c42c6fd Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 15 Oct 2024 11:34:02 -0500 Subject: [PATCH 02/12] no checks --- .github/workflows/pr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f868822ef8..2912e349de 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -19,7 +19,6 @@ jobs: with: needs: ${{ toJSON(needs) }} wheel-build-cuml: - needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: From 74fa1675124e44a46417a8e2c807b138c10d1ede Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 15 Oct 2024 14:58:24 -0500 Subject: [PATCH 03/12] sccache stats, dependencies.yaml naming conventions --- ci/build_wheel.sh | 2 ++ dependencies.yaml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index da30bbacc8..e52d83344e 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -74,6 +74,8 @@ python -m pip wheel \ --disable-pip-version-check \ . +sccache --show-adv-stats + mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* diff --git a/dependencies.yaml b/dependencies.yaml index 8d6a028d90..432a73607f 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -66,14 +66,14 @@ files: - py_version - test_cuml - test_notebooks - py_build: + py_build_cuml: output: pyproject pyproject_dir: python/cuml extras: table: build-system includes: - rapids_build_backend - py_rapids_build: + py_rapids_build_cuml: output: pyproject pyproject_dir: python/cuml extras: From 078899982c6ffc9d9284db36b3a775511a669731 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 15 Oct 2024 15:26:43 -0500 Subject: [PATCH 04/12] enable all CI --- .github/workflows/pr.yaml | 156 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2912e349de..1ca4589500 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,13 +12,150 @@ concurrency: jobs: pr-builder: needs: + - changed-files + - checks + - clang-tidy + - conda-cpp-build + - conda-cpp-tests + - conda-cpp-checks + - conda-python-build + - conda-python-tests-singlegpu + - conda-python-tests-dask + - conda-notebook-tests + - docs-build - wheel-build-cuml + - wheel-tests-cuml + - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!notebooks/**' + - '!python/**' + - '!thirdparty/LICENSES/**' + test_notebooks: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!thirdparty/LICENSES/**' + test_python: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!notebooks/**' + - '!thirdparty/LICENSES/**' + checks: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 + with: + enable_check_generated_files: false + ignored_pr_jobs: >- + optional-job-conda-python-tests-cudf-pandas-integration + clang-tidy: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + with: + build_type: pull-request + node_type: "cpu8" + arch: "amd64" + container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" + run_script: "ci/run_clang_tidy.sh" + conda-cpp-build: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 + with: + build_type: pull-request + conda-cpp-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp + with: + build_type: pull-request + conda-cpp-checks: + needs: conda-cpp-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 + with: + build_type: pull-request + enable_check_symbols: true + symbol_exclusions: raft_cutlass + conda-python-build: + needs: conda-cpp-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 + with: + build_type: pull-request + conda-python-tests-singlegpu: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: "ci/test_python_singlegpu.sh" + optional-job-conda-python-tests-cudf-pandas-integration: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + matrix_filter: map(select(.ARCH == "amd64")) + build_type: pull-request + script: "ci/test_python_integration.sh" + conda-python-tests-dask: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: "ci/test_python_dask.sh" + conda-notebook-tests: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks + with: + build_type: pull-request + node_type: "gpu-v100-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:latest" + run_script: "ci/test_notebooks.sh" + docs-build: + needs: conda-python-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + with: + build_type: pull-request + node_type: "gpu-v100-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:latest" + run_script: "ci/build_docs.sh" wheel-build-cuml: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: @@ -27,3 +164,22 @@ jobs: extra-repo: rapidsai/cumlprims_mg extra-repo-sha: branch-24.12 extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY + wheel-tests-cuml: + needs: [wheel-build-cuml, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: ci/test_wheel.sh + devcontainer: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12 + with: + arch: '["amd64"]' + cuda: '["12.5"]' + extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY + build_command: | + sccache -z; + build-all --verbose; + sccache -s; From 8d8ba2b9fc02c2689d8765ad6b24a24a3111c8f3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 23 Oct 2024 14:01:32 -0500 Subject: [PATCH 05/12] update rapids-dependency-file-generator pattern, other misc. consistency things --- .github/workflows/pr.yaml | 143 -------------------------------------- .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 4 ++ ci/build_python.sh | 7 ++ ci/build_wheel.sh | 22 +++--- 5 files changed, 23 insertions(+), 155 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1ca4589500..807ddbff20 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,150 +12,26 @@ concurrency: jobs: pr-builder: needs: - - changed-files - - checks - - clang-tidy - conda-cpp-build - - conda-cpp-tests - - conda-cpp-checks - conda-python-build - - conda-python-tests-singlegpu - - conda-python-tests-dask - - conda-notebook-tests - - docs-build - wheel-build-cuml - - wheel-tests-cuml - - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} - changed-files: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 - with: - files_yaml: | - test_cpp: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/**' - - '!thirdparty/LICENSES/**' - test_notebooks: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!thirdparty/LICENSES/**' - test_python: - - '**' - - '!.devcontainer/**' - - '!.pre-commit-config.yaml' - - '!CONTRIBUTING.md' - - '!README.md' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!thirdparty/LICENSES/**' - checks: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 - with: - enable_check_generated_files: false - ignored_pr_jobs: >- - optional-job-conda-python-tests-cudf-pandas-integration - clang-tidy: - needs: checks - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - with: - build_type: pull-request - node_type: "cpu8" - arch: "amd64" - container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" - run_script: "ci/run_clang_tidy.sh" conda-cpp-build: - needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 with: build_type: pull-request - conda-cpp-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp - with: - build_type: pull-request - conda-cpp-checks: - needs: conda-cpp-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 - with: - build_type: pull-request - enable_check_symbols: true - symbol_exclusions: raft_cutlass conda-python-build: needs: conda-cpp-build secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 with: build_type: pull-request - conda-python-tests-singlegpu: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: "ci/test_python_singlegpu.sh" - optional-job-conda-python-tests-cudf-pandas-integration: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - matrix_filter: map(select(.ARCH == "amd64")) - build_type: pull-request - script: "ci/test_python_integration.sh" - conda-python-tests-dask: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: "ci/test_python_dask.sh" - conda-notebook-tests: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:latest" - run_script: "ci/test_notebooks.sh" - docs-build: - needs: conda-python-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:latest" - run_script: "ci/build_docs.sh" wheel-build-cuml: - needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: @@ -164,22 +40,3 @@ jobs: extra-repo: rapidsai/cumlprims_mg extra-repo-sha: branch-24.12 extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY - wheel-tests-cuml: - needs: [wheel-build-cuml, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: ci/test_wheel.sh - devcontainer: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12 - with: - arch: '["amd64"]' - cuda: '["12.5"]' - extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY - build_command: | - sccache -z; - build-all --verbose; - sccache -s; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30a7443829..ed77fffbf7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,7 +77,7 @@ repos: python/cuml/cuml/_thirdparty - id: verify-alpha-spec - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 48f4f444b2..fa066c03c6 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -15,6 +15,10 @@ rapids-print-env rapids-logger "Begin cpp build" +sccache --zero-stats + RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcuml +sccache --show-adv-stats + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index e1397e3373..964a6275ce 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -19,6 +19,8 @@ rapids-logger "Begin py build" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) +sccache --zero-stats + # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ @@ -26,6 +28,9 @@ RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuml +sccache --show-adv-stats +sccache --zero-stats + # Build cuml-cpu only in CUDA 11 jobs since it only depends on python # version RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" @@ -35,4 +40,6 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then conda/recipes/cuml-cpu fi +sccache --show-adv-stats + rapids-upload-conda-to-s3 python diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index e52d83344e..fdcb049b54 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -17,26 +17,24 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" rapids-logger "Generating build requirements" -matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" rapids-dependency-file-generator \ --output requirements \ - --file-key "py_build_${underscore_package_name}" \ - --matrix "${matrix_selectors}" \ + --file-key "py_build_${package_name}" \ + --file-key "py_rapids_build_${package_name}" \ + --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" \ | tee /tmp/requirements-build.txt -rapids-dependency-file-generator \ - --output requirements \ - --file-key "py_rapids_build_${underscore_package_name}" \ - --matrix "${matrix_selectors}" \ -| tee -a /tmp/requirements-build.txt - rapids-logger "Installing build requirements" python -m pip install \ -v \ --prefer-binary \ -r /tmp/requirements-build.txt +# build with '--no-build-isolation', for better sccache hit rate +# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) +export PIP_NO_BUILD_ISOLATION=0 + rapids-generate-version > ./VERSION cd ${package_dir} @@ -66,10 +64,12 @@ esac export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" rapids-logger "Building '${package_name}' wheel" + +sccache --zero-stats + python -m pip wheel \ -w dist \ -v \ - --no-build-isolation \ --no-deps \ --disable-pip-version-check \ . @@ -79,4 +79,4 @@ sccache --show-adv-stats mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* -RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist From 78bbfa0e4e89400471acdc732677b6d0847c79f2 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 23 Oct 2024 14:02:18 -0500 Subject: [PATCH 06/12] bit more cleanup --- ci/build_wheel.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index fdcb049b54..f76889a66d 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -5,17 +5,12 @@ set -euo pipefail package_name="cuml" package_dir="python/cuml" -underscore_package_name=$(echo "${package_name}" | tr "-" "_") source rapids-configure-sccache source rapids-date-string RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# This is the version of the suffix with a preceding hyphen. It's used -# everywhere except in the final wheel name. -PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" - rapids-logger "Generating build requirements" rapids-dependency-file-generator \ From 7b309b54e9441b9d0c6e64f762cdbebbf37c06c5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 23 Oct 2024 14:42:25 -0500 Subject: [PATCH 07/12] make scripts consistent with other RAPIDS repos --- ci/build_wheel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f76889a66d..f8f4241c15 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -58,10 +58,10 @@ esac export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" -rapids-logger "Building '${package_name}' wheel" - sccache --zero-stats +rapids-logger "Building '${package_name}' wheel" + python -m pip wheel \ -w dist \ -v \ From ab40ca8f3903c908c68c2af07b41e55181041289 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 23 Oct 2024 16:38:37 -0500 Subject: [PATCH 08/12] run all CI --- .github/workflows/pr.yaml | 143 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 807ddbff20..1ca4589500 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,26 +12,150 @@ concurrency: jobs: pr-builder: needs: + - changed-files + - checks + - clang-tidy - conda-cpp-build + - conda-cpp-tests + - conda-cpp-checks - conda-python-build + - conda-python-tests-singlegpu + - conda-python-tests-dask + - conda-notebook-tests + - docs-build - wheel-build-cuml + - wheel-tests-cuml + - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!notebooks/**' + - '!python/**' + - '!thirdparty/LICENSES/**' + test_notebooks: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!thirdparty/LICENSES/**' + test_python: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!notebooks/**' + - '!thirdparty/LICENSES/**' + checks: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 + with: + enable_check_generated_files: false + ignored_pr_jobs: >- + optional-job-conda-python-tests-cudf-pandas-integration + clang-tidy: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + with: + build_type: pull-request + node_type: "cpu8" + arch: "amd64" + container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" + run_script: "ci/run_clang_tidy.sh" conda-cpp-build: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 with: build_type: pull-request + conda-cpp-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp + with: + build_type: pull-request + conda-cpp-checks: + needs: conda-cpp-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 + with: + build_type: pull-request + enable_check_symbols: true + symbol_exclusions: raft_cutlass conda-python-build: needs: conda-cpp-build secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 with: build_type: pull-request + conda-python-tests-singlegpu: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: "ci/test_python_singlegpu.sh" + optional-job-conda-python-tests-cudf-pandas-integration: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + matrix_filter: map(select(.ARCH == "amd64")) + build_type: pull-request + script: "ci/test_python_integration.sh" + conda-python-tests-dask: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: "ci/test_python_dask.sh" + conda-notebook-tests: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks + with: + build_type: pull-request + node_type: "gpu-v100-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:latest" + run_script: "ci/test_notebooks.sh" + docs-build: + needs: conda-python-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + with: + build_type: pull-request + node_type: "gpu-v100-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:latest" + run_script: "ci/build_docs.sh" wheel-build-cuml: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: @@ -40,3 +164,22 @@ jobs: extra-repo: rapidsai/cumlprims_mg extra-repo-sha: branch-24.12 extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY + wheel-tests-cuml: + needs: [wheel-build-cuml, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: ci/test_wheel.sh + devcontainer: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12 + with: + arch: '["amd64"]' + cuda: '["12.5"]' + extra-repo-deploy-key: CUMLPRIMS_SSH_PRIVATE_DEPLOY_KEY + build_command: | + sccache -z; + build-all --verbose; + sccache -s; From 6bda3db01ecda7d0ba22a65d24e0af81d9ec9247 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 23 Oct 2024 16:39:16 -0500 Subject: [PATCH 09/12] update script --- ci/build_python.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 964a6275ce..80817c71b0 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -38,8 +38,8 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ conda/recipes/cuml-cpu -fi -sccache --show-adv-stats + sccache --show-adv-stats +fi rapids-upload-conda-to-s3 python From 99000f838ebafb805e6d87f484af115782c64ebe Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 29 Oct 2024 09:28:13 -0500 Subject: [PATCH 10/12] revert --no-build-isolation stuff --- ci/build_wheel.sh | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f8f4241c15..6a45821eea 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -3,7 +3,6 @@ set -euo pipefail -package_name="cuml" package_dir="python/cuml" source rapids-configure-sccache @@ -11,24 +10,9 @@ source rapids-date-string RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -rapids-logger "Generating build requirements" - -rapids-dependency-file-generator \ - --output requirements \ - --file-key "py_build_${package_name}" \ - --file-key "py_rapids_build_${package_name}" \ - --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" \ -| tee /tmp/requirements-build.txt - -rapids-logger "Installing build requirements" -python -m pip install \ - -v \ - --prefer-binary \ - -r /tmp/requirements-build.txt - -# build with '--no-build-isolation', for better sccache hit rate -# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) -export PIP_NO_BUILD_ISOLATION=0 +# This is the version of the suffix with a preceding hyphen. It's used +# everywhere except in the final wheel name. +PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" rapids-generate-version > ./VERSION @@ -56,22 +40,18 @@ case "${RAPIDS_CUDA_VERSION}" in ;; esac -export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" - sccache --zero-stats -rapids-logger "Building '${package_name}' wheel" - -python -m pip wheel \ +SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DDISABLE_DEPRECATION_WARNINGS=ON;-DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/;-DUSE_CUVS_WHEEL=ON${EXTRA_CMAKE_ARGS}" \ + python -m pip wheel . \ -w dist \ -v \ --no-deps \ - --disable-pip-version-check \ - . + --disable-pip-version-check sccache --show-adv-stats mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* -RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist +RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist From 296f60ac1ab438b76d76919e3665317e7652f2ed Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 29 Oct 2024 09:29:24 -0500 Subject: [PATCH 11/12] update rapids-upload-wheels-to-s3 call --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6a45821eea..eb28dc3a1f 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -54,4 +54,4 @@ sccache --show-adv-stats mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* -RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist +RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist From a51f7b48252a9b4c2fcb4e73cfb5325a648d76c3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 31 Oct 2024 10:13:38 -0500 Subject: [PATCH 12/12] move --zero-stats inside if --- ci/build_python.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 80817c71b0..e8d2b3ed39 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -29,12 +29,13 @@ RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ conda/recipes/cuml sccache --show-adv-stats -sccache --zero-stats # Build cuml-cpu only in CUDA 11 jobs since it only depends on python # version RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then + sccache --zero-stats + RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ conda/recipes/cuml-cpu