diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8bbb437b7..5d4b30faa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,8 +9,14 @@ python/ @rapidsai/cucim-python-codeowners **/CMakeLists.txt @rapidsai/cucim-cmake-codeowners **/cmake/ @rapidsai/cucim-cmake-codeowners -#build/ops code owners -/.github/ @rapidsai/ops-codeowners -/ci/ @rapidsai/ops-codeowners -/conda/ @rapidsai/ops-codeowners -dependencies.yaml @rapidsai/ops-codeowners +#CI code owners +/.github/ @rapidsai/ci-codeowners +/ci/ @rapidsai/ci-codeowners +/.pre-commit-config.yaml @rapidsai/ci-codeowners + +#packaging code owners +/.devcontainer/ @rapidsai/packaging-codeowners +/conda/ @rapidsai/packaging-codeowners +/dependencies.yaml @rapidsai/packaging-codeowners +/build.sh @rapidsai/packaging-codeowners +pyproject.toml @rapidsai/packaging-codeowners diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 17a953717..f18070040 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -38,7 +38,7 @@ jobs: if: github.ref_type == 'branch' needs: [python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -51,7 +51,7 @@ jobs: python-build: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -60,7 +60,7 @@ jobs: upload-conda: needs: [cpp-build, python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -78,7 +78,7 @@ jobs: wheel-publish: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7b686cd7f..5020f00c3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,32 +20,32 @@ jobs: - wheel-build - wheel-tests secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.08 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: pull-request docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -55,14 +55,14 @@ jobs: wheel-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: pull-request script: ci/build_wheel.sh wheel-tests: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: pull-request script: ci/test_wheel.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4724fea3e..7205ec4e4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfffa3dca..81811af95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,8 +28,13 @@ repos: args: ["--toml", "python/cucim/pyproject.toml"] additional_dependencies: - tomli + - repo: https://github.com/rapidsai/pre-commit-hooks + rev: v0.2.0 + hooks: + - id: verify-alpha-spec + args: ["--fix", "--mode=release"] - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.8.0 + rev: v1.13.11 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc436634..28e824cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# cucim 24.08.00 (7 Aug 2024) + +## 🛠️ Improvements + +- Drop NumPy build dependency ([#751](https://github.com/rapidsai/cucim/pull/751)) [@jakirkham](https://github.com/jakirkham) +- Use workflow branch 24.08 again ([#749](https://github.com/rapidsai/cucim/pull/749)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Build and test with CUDA 12.5.1 ([#747](https://github.com/rapidsai/cucim/pull/747)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Minor fixes for NumPy 2.0 compatiblity ([#746](https://github.com/rapidsai/cucim/pull/746)) [@grlee77](https://github.com/grlee77) +- skip CMake 3.30.0, require CMake >=3.26.4 ([#745](https://github.com/rapidsai/cucim/pull/745)) [@jameslamb](https://github.com/jameslamb) +- Use verify-alpha-spec hook ([#744](https://github.com/rapidsai/cucim/pull/744)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- remove .gitattributes ([#740](https://github.com/rapidsai/cucim/pull/740)) [@jameslamb](https://github.com/jameslamb) +- Adopt CI/packaging codeowners ([#739](https://github.com/rapidsai/cucim/pull/739)) [@bdice](https://github.com/bdice) +- Remove text builds of documentation ([#738](https://github.com/rapidsai/cucim/pull/738)) [@vyasr](https://github.com/vyasr) +- use rapids-build-backend ([#736](https://github.com/rapidsai/cucim/pull/736)) [@jameslamb](https://github.com/jameslamb) + # cucim 24.06.00 (5 Jun 2024) ## 🚨 Breaking Changes diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1aff40e..ff7e7ca8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/VERSION b/VERSION index 0bff6981a..ec8489fda 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -24.06.00 +24.08.00 diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 28d8644e0..9b419b816 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -13,12 +13,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -version=$(rapids-generate-version) - rapids-logger "Begin cpp build" conda config --set path_conflict prevent -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcucim +RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcucim rapids-upload-conda-to-s3 cpp diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 1f8865a4c..4bc3e63f2 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -9,7 +9,7 @@ rapids-logger "Create test conda environment" rapids-dependency-file-generator \ --output conda \ - --file_key docs \ + --file-key docs \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n docs @@ -31,10 +31,8 @@ export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build Python docs" pushd docs sphinx-build -b dirhtml ./source _html -sphinx-build -b text ./source _text -mkdir -p "${RAPIDS_DOCS_DIR}/cucim/"{html,txt} +mkdir -p "${RAPIDS_DOCS_DIR}/cucim/"html mv _html/* "${RAPIDS_DOCS_DIR}/cucim/html" -mv _text/* "${RAPIDS_DOCS_DIR}/cucim/txt" popd rapids-upload-docs diff --git a/ci/build_python.sh b/ci/build_python.sh index 684ce04b7..25925f906 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,16 +13,7 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -package_name="cucim" -package_dir="python/cucim" -package_src_dir="${package_dir}/src/${package_name}" - -version=$(rapids-generate-version) - -commit=$(git rev-parse HEAD) - -echo "${version}" > VERSION -sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py" +rapids-generate-version > ./VERSION rapids-logger "Begin py build" conda config --set path_conflict prevent @@ -31,7 +22,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cucim diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 8d3fcf941..4005c36d4 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -12,28 +12,15 @@ CMAKE_BUILD_TYPE="release" source rapids-configure-sccache source rapids-date-string -version=$(rapids-generate-version) -commit=$(git rev-parse HEAD) +rapids-generate-version > ./VERSION RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# Patch project metadata files to include the CUDA version suffix and version override. -pyproject_file="${package_dir}/pyproject.toml" - PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" -# update package name to have the cuda suffix -sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -echo "${version}" > VERSION -sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py" - -if [[ ${PACKAGE_CUDA_SUFFIX} == "-cu12" ]]; then - # change pyproject.toml to use CUDA 12.x version of cupy - sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} -fi # Install pip build dependencies (not yet using pyproject.toml) rapids-dependency-file-generator \ - --file_key "py_build" \ + --file-key "py_build" \ --output "requirements" \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee build_requirements.txt pip install -r build_requirements.txt diff --git a/ci/check_style.sh b/ci/check_style.sh index 9bc26fe71..f8bc16525 100755 --- a/ci/check_style.sh +++ b/ci/check_style.sh @@ -8,7 +8,7 @@ rapids-logger "Create checks conda environment" rapids-dependency-file-generator \ --output conda \ - --file_key checks \ + --file-key checks \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n checks diff --git a/ci/test_python.sh b/ci/test_python.sh index d6e76971e..ae14da4a0 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -12,7 +12,7 @@ RAPIDS_VERSION_NUMBER=$(rapids-generate-version) rapids-logger "Generate Python testing dependencies" rapids-dependency-file-generator \ --output conda \ - --file_key test_python \ + --file-key test_python \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n test diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 5a8e835a2..9e0bbb497 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -9,7 +9,7 @@ dependencies: - GPUtil>=1.4.0 - c-compiler - click -- cmake>=3.23.1,!=3.25.0 +- cmake>=3.26.4,!=3.30.0 - cuda-version=11.8 - cudatoolkit - cupy>=12.0.0 diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml similarity index 92% rename from conda/environments/all_cuda-122_arch-x86_64.yaml rename to conda/environments/all_cuda-125_arch-x86_64.yaml index 0aa83182a..d183e447d 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -9,10 +9,10 @@ dependencies: - GPUtil>=1.4.0 - c-compiler - click -- cmake>=3.23.1,!=3.25.0 +- cmake>=3.26.4,!=3.30.0 - cuda-cudart-dev - cuda-nvcc -- cuda-version=12.2 +- cuda-version=12.5 - cupy>=12.0.0 - cxx-compiler - gcc_linux-64=11.* @@ -53,4 +53,4 @@ dependencies: - zstd - pip: - opencv-python-headless>=4.6 -name: all_cuda-122_arch-x86_64 +name: all_cuda-125_arch-x86_64 diff --git a/conda/recipes/cucim/build.sh b/conda/recipes/cucim/build.sh index 3f26cb963..a66acc30d 100644 --- a/conda/recipes/cucim/build.sh +++ b/conda/recipes/cucim/build.sh @@ -18,6 +18,6 @@ cp -P python/install/lib/* python/cucim/src/cucim/clara/ pushd python/cucim echo "PYTHON: ${PYTHON}" -$PYTHON -m pip install . -vv +$PYTHON -m pip install --config-settings rapidsai.disable-cuda=true . -vv popd diff --git a/conda/recipes/cucim/conda_build_config.yaml b/conda/recipes/cucim/conda_build_config.yaml index 8a1b64ec6..001878ff2 100644 --- a/conda/recipes/cucim/conda_build_config.yaml +++ b/conda/recipes/cucim/conda_build_config.yaml @@ -15,3 +15,6 @@ c_stdlib: c_stdlib_version: - "2.17" + +cmake_version: + - ">=3.26.4,!=3.30.0" diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml index dbacd8015..ed800d086 100644 --- a/conda/recipes/cucim/meta.yaml +++ b/conda/recipes/cucim/meta.yaml @@ -51,7 +51,7 @@ requirements: - {{ compiler('cuda') }} {% endif %} - cuda-version ={{ cuda_version }} - - cmake >=3.23.1,!=3.25.0 + - cmake {{ cmake_version }} - make - ninja - {{ stdlib("c") }} @@ -63,16 +63,17 @@ requirements: {% endif %} - cupy >=12.0.0 - libcucim ={{ version }} - - numpy 1.23 - python + - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-image >=0.19.0,<0.23.0a0 - scipy >=1.6 + - setuptools >=24.2.0 run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major != "11" %} - cuda-cudart {% endif %} - - {{ pin_compatible('numpy') }} + - numpy >=1.23,<2.0a0 - click - cupy >=12.0.0 - lazy_loader >=0.1 diff --git a/conda/recipes/libcucim/conda_build_config.yaml b/conda/recipes/libcucim/conda_build_config.yaml index d8a71327a..ff870eb5c 100644 --- a/conda/recipes/libcucim/conda_build_config.yaml +++ b/conda/recipes/libcucim/conda_build_config.yaml @@ -16,6 +16,9 @@ c_stdlib: c_stdlib_version: - "2.17" +cmake_version: + - ">=3.26.4,!=3.30.0" + # The CTK libraries below are missing from the conda-forge::cudatoolkit package # for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages # and the "*_run_*" version specifiers correspond to `11.x` packages. diff --git a/conda/recipes/libcucim/meta.yaml b/conda/recipes/libcucim/meta.yaml index 5d24c368f..b373ffbbe 100644 --- a/conda/recipes/libcucim/meta.yaml +++ b/conda/recipes/libcucim/meta.yaml @@ -56,7 +56,7 @@ requirements: {% endif %} - cuda-version ={{ cuda_version }} - binutils - - cmake >=3.23.1,!=3.25.0 + - cmake {{ cmake_version }} - make - ninja - {{ stdlib("c") }} diff --git a/cpp/plugins/cucim.kit.cumed/CMakeLists.txt b/cpp/plugins/cucim.kit.cumed/CMakeLists.txt index dc775742d..b1743e70a 100644 --- a/cpp/plugins/cucim.kit.cumed/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cumed/CMakeLists.txt @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt b/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt index 047b5ee61..c52c564d8 100644 --- a/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/cucim.code-workspace b/cucim.code-workspace index 099b210fe..82eafdcd1 100644 --- a/cucim.code-workspace +++ b/cucim.code-workspace @@ -33,7 +33,7 @@ "CUCIM_TESTDATA_FOLDER": "${workspaceDirectory}/test_data", // Add cuslide plugin's library path to LD_LIBRARY_PATH "LD_LIBRARY_PATH": "${workspaceDirectory}/build-debug/lib:${workspaceDirectory}/cpp/plugins/cucim.kit.cuslide/build-debug/lib:${workspaceDirectory}/temp/cuda/lib64:${os_env:LD_LIBRARY_PATH}", - "CUCIM_TEST_PLUGIN_PATH": "cucim.kit.cuslide@24.06.00.so" + "CUCIM_TEST_PLUGIN_PATH": "cucim.kit.cuslide@24.08.00.so" }, "cwd": "${workspaceDirectory}", "catch2": { @@ -226,7 +226,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", @@ -254,7 +254,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", @@ -286,7 +286,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", diff --git a/dependencies.yaml b/dependencies.yaml index d69b3cd75..840cea8eb 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -3,7 +3,7 @@ files: all: output: conda matrix: - cuda: ["11.8", "12.2"] + cuda: ["11.8", "12.5"] arch: [x86_64] includes: - build @@ -36,6 +36,14 @@ files: pyproject_dir: python/cucim extras: table: build-system + includes: + - rapids_build_setuptools + py_rapids_build: + output: pyproject + pyproject_dir: python/cucim + extras: + table: tool.rapids-build-backend + key: requires includes: - build py_run: @@ -84,7 +92,7 @@ dependencies: # python/cucim/src/cucim/clara/ before calling `pip install .`. - output_types: [conda, requirements] packages: - - cmake>=3.23.1,!=3.25.0 + - cmake>=3.26.4,!=3.30.0 - ninja - output_types: conda packages: @@ -92,7 +100,6 @@ dependencies: - cxx-compiler - output_types: [requirements, pyproject] packages: - - setuptools>=24.2.0 - wheel specific: - output_types: conda @@ -157,6 +164,10 @@ dependencies: cuda: "12.2" packages: - cuda-version=12.2 + - matrix: + cuda: "12.5" + packages: + - cuda-version=12.5 cuda: specific: - output_types: conda @@ -240,6 +251,12 @@ dependencies: - matrix: packages: - python>=3.8,<3.12 + rapids_build_setuptools: + common: + - output_types: [conda, requirements, pyproject] + packages: + - rapids-build-backend>=0.3.0,<0.4.0.dev0 + - setuptools>=24.2.0 run: common: - output_types: [conda, requirements, pyproject] @@ -266,9 +283,18 @@ dependencies: # Not sure where these go, if anywhere: # - openslide # - xorg-libxcb + specific: - output_types: [requirements, pyproject] - packages: - - cupy-cuda11x>=12.0.0 + matrices: + - matrix: {cuda: "12.*"} + packages: + - cupy-cuda12x>=12.0.0 + - matrix: {cuda: "11.*"} + packages: + - &cupy_cu11 cupy-cuda11x>=12.0.0 + - matrix: + packages: + - *cupy_cu11 test_python: common: - output_types: [conda, requirements, pyproject] diff --git a/examples/cpp/CMakeLists.txt.examples.release.in b/examples/cpp/CMakeLists.txt.examples.release.in index ddb8570de..bae629eb7 100644 --- a/examples/cpp/CMakeLists.txt.examples.release.in +++ b/examples/cpp/CMakeLists.txt.examples.release.in @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) project(cucim-cpp-examples VERSION @VERSION@ DESCRIPTION "cuCIM CPP examples" LANGUAGES CUDA CXX) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index adbbde7e9..70334a980 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/python/cucim/.gitattributes b/python/cucim/.gitattributes deleted file mode 100644 index 3708d19e1..000000000 --- a/python/cucim/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -src/cucim/_version.py export-subst diff --git a/python/cucim/pyproject.toml b/python/cucim/pyproject.toml index b63ef7cdc..806419559 100644 --- a/python/cucim/pyproject.toml +++ b/python/cucim/pyproject.toml @@ -2,10 +2,10 @@ # See file LICENSE for terms. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "rapids_build_backend.build" requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "setuptools>=24.2.0", - "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project] @@ -90,6 +90,16 @@ docs = [ [project.entry-points."console_scripts"] cucim = "cucim.clara.cli:main" +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +commit-files = [ + "src/cucim/COMMIT_FILE" +] +dependencies-file = "../../dependencies.yaml" +requires = [ + "wheel", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + [tool.setuptools] license-files = [ "LICENSE", diff --git a/python/cucim/src/cucim/_version.py b/python/cucim/src/cucim/_version.py index 9abb33848..e61fd2958 100644 --- a/python/cucim/src/cucim/_version.py +++ b/python/cucim/src/cucim/_version.py @@ -15,6 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("cucim").joinpath("VERSION").read_text().strip() + importlib.resources.files(__package__) + .joinpath("VERSION") + .read_text() + .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py b/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py index 789518cb1..ea33f26b5 100644 --- a/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py +++ b/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py @@ -429,6 +429,7 @@ def chan_vese( energies = [] phivar = tol + 1 + dt = cp.asarray(dt, dtype=float_dtype) while phivar > tol and i < max_num_iter: # Save old level set values oldphi = phi diff --git a/python/cucim/tests/unit/core/test_stain_normalizer.py b/python/cucim/tests/unit/core/test_stain_normalizer.py index aa969c523..34a44384c 100644 --- a/python/cucim/tests/unit/core/test_stain_normalizer.py +++ b/python/cucim/tests/unit/core/test_stain_normalizer.py @@ -137,7 +137,7 @@ def test_result_value(self, image, expected): stain_extraction_pca(image) else: result = stain_extraction_pca(image) - cp.testing.assert_allclose(result, expected) + cp.testing.assert_allclose(result, expected, rtol=1e-6) class TestStainNormalizerMacenko: diff --git a/python/cucim/tests/unit/test_version.py b/python/cucim/tests/unit/test_version.py new file mode 100644 index 000000000..256da0a89 --- /dev/null +++ b/python/cucim/tests/unit/test_version.py @@ -0,0 +1,25 @@ +# +# Copyright (c) 2024, NVIDIA CORPORATION. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import cucim + + +def test_version_constants_are_populated(): + # __git_commit__ will only be non-empty in a built distribution + assert isinstance(cucim.__git_commit__, str) + + # __version__ should always be non-empty + assert isinstance(cucim.__version__, str) + assert len(cucim.__version__) > 0 diff --git a/python/pybind11/cucim_py.cpp b/python/pybind11/cucim_py.cpp index 62f041e2d..bb91b5c43 100644 --- a/python/pybind11/cucim_py.cpp +++ b/python/pybind11/cucim_py.cpp @@ -19,9 +19,11 @@ #include #include -#include +#include +#include #include #include +#include #include #include @@ -445,11 +447,30 @@ py::object py_read_region(const CuImage& cuimg, { py::gil_scoped_acquire scope_guard; - auto arr = pybind11::array_t::ensure(location); - if (arr) // fast copy + py::object mv_obj = py::none(); + try { - py::buffer_info buf = arr.request(); - int64_t* data_array = static_cast(buf.ptr); + mv_obj = py::cast(py::memoryview(location)); + } + catch (const std::exception& e) + { + } + + if (!mv_obj.is_none()) // fast copy + { + py::memoryview mv(mv_obj); + py::buffer_info buf(PyMemoryView_GET_BUFFER(mv.ptr()), false); + + if (buf.format != py::format_descriptor::format()) + { + throw std::invalid_argument("Expected int64 array-like"); + } + if (PyBuffer_IsContiguous(buf.view(), 'C') == 0) + { + throw std::invalid_argument("Expected C-contiguous array-like"); + } + + const int64_t* data_array = static_cast(buf.ptr); ssize_t data_size = buf.size; locations.reserve(data_size); locations.insert(locations.end(), &data_array[0], &data_array[data_size]);