Skip to content

Relax UMAP version constraint - #7850

Merged
rapids-bot[bot] merged 19 commits into
NVIDIA:mainfrom
csadorf:bump-umap-version
Mar 5, 2026
Merged

Relax UMAP version constraint#7850
rapids-bot[bot] merged 19 commits into
NVIDIA:mainfrom
csadorf:bump-umap-version

Conversation

@csadorf

@csadorf csadorf commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Closes #7848

@copy-pr-bot

copy-pr-bot Bot commented Mar 4, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added conda conda issue Cython / Python Cython or Python issue labels Mar 4, 2026
@csadorf csadorf added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 4, 2026
@csadorf csadorf changed the title Bump umap version Bump UMAP version Mar 4, 2026
csadorf added 6 commits March 4, 2026 19:24
… conditions for 'haversine', 'wminkowski', and 'mahalanobis' metrics to ensure proper data dimensionality.
…d version and adjust cloning logic. Remove compatibility checks for scikit-learn 1.8 and clean up xfail-list.yaml by removing obsolete entries.
@csadorf

csadorf commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2966218

@csadorf csadorf changed the title Bump UMAP version Relax UMAP version constraint Mar 4, 2026
@csadorf
csadorf marked this pull request as ready for review March 5, 2026 15:23
@csadorf
csadorf requested review from a team as code owners March 5, 2026 15:23
@csadorf
csadorf requested review from dantegd and msarahan March 5, 2026 15:23
@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f0bc057c-b19d-4815-a95b-c5b5dfc2b466

📥 Commits

Reviewing files that changed from the base of the PR and between 3d64deb and 963bc8d.

📒 Files selected for processing (1)
  • python/cuml/cuml_accel_tests/upstream/xfail_manager.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Broadened umap-learn compatibility to allow versions >=0.5.7,<0.5.12 (previously pinned).
  • Bug Fixes

    • Improved version-aware compatibility handling to reduce mismatches across umap-learn releases.
  • Tests

    • Removed multiple version-specific skips and warning filters; updated xfail logic and upstream test invocation to be version-aware and support combined conditions.
  • Documentation

    • Updated supported-versions guidance and README note to reflect the new umap-learn range.
  • Chores

    • Added umap-learn entries to test dependency matrices.

Walkthrough

Relaxed umap-learn pins to >=0.5.7,<0.5.12 across configs; added runtime branching in UMAP overrides for changed parameter names; removed several sklearn-version test skips and FutureWarning filters; enhanced xfail condition parsing and made upstream UMAP test checkout/tagging dynamic.

Changes

Cohort / File(s) Summary
Conda environment pins
conda/environments/all_cuda-129_arch-aarch64.yaml, conda/environments/all_cuda-129_arch-x86_64.yaml, conda/environments/all_cuda-131_arch-aarch64.yaml, conda/environments/all_cuda-131_arch-x86_64.yaml
Changed umap-learn pin from ==0.5.7 to >=0.5.7,<0.5.12.
Dependency manifests
dependencies.yaml, python/cuml/pyproject.toml, docs/source/supported_versions.rst
Added/updated umap-learn in test matrices and test/optional deps; replaced strict pin with >=0.5.7,<0.5.12.
UMAP override (runtime compatibility)
python/cuml/cuml/accel/_overrides/umap.py
Added umap version detection and branching: preserve legacy force_all_finite signatures for umap-learn <0.5.8; use ensure_all_finite signatures for >=0.5.8 (method signature changes in guarded branches).
Test changes — gating, xfail, upstream runner
python/cuml/cuml_accel_tests/integration/test_umap.py, python/cuml/cuml_accel_tests/test_core.py, python/cuml/cuml_accel_tests/upstream/umap/run-tests.sh, python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
Removed sklearn-version skips and FutureWarning filters; gated an xfail on umap-learn <0.5.8; made upstream test checkout/tagging dynamic; extended 2D-data restriction for additional metrics.
Tests — removed deprecation guards
python/cuml/tests/test_sklearn_import_export.py, python/cuml/tests/test_trustworthiness.py, python/cuml/tests/test_umap.py
Deleted sklearn-version guards and pytest.filterwarnings entries that previously silenced umap-related FutureWarnings.
Pytest / xfail utilities
python/cuml/cuml/accel/pytest_plugin.py, python/cuml/cuml_accel_tests/upstream/xfail_manager.py, python/cuml/cuml_accel_tests/upstream/README.md
Added support for evaluating combined conditions joined by " and " with per-clause evaluation/validation; updated docs and xfail validation logic.
Upstream tests integration
python/cuml/cuml_accel_tests/upstream/umap/...
Changed upstream test checkout to fetch tags and compute tag from installed umap version; preserved pytest arg forwarding and expanded test path invocation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jcrist
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Relax UMAP version constraint' directly and clearly describes the main change: updating version specifications for the umap-learn dependency to allow a wider range of compatible versions.
Description check ✅ Passed The description references the related issue #7848 which documents the motivation and desired outcome for relaxing the UMAP version constraint, making it relevant to the changeset.
Linked Issues check ✅ Passed The PR comprehensively addresses both requirements from issue #7848: it updates all dependency configurations to allow umap-learn <0.5.12 [all conda YAML files, dependencies.yaml, pyproject.toml, docs] and updates all call sites and tests to match umap-learn's changed API signatures [umap.py, test files, pytest_plugin.py, xfail-list.yaml].
Out of Scope Changes check ✅ Passed All changes are directly related to relaxing the UMAP version constraint and updating code for API compatibility; minor documentation updates (README.md) and version-checking infrastructure (xfail_manager.py) support this primary objective without introducing unrelated functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@python/cuml/cuml_accel_tests/test_core.py`:
- Line 3: The test file currently only does a top-level "import importlib" but
later calls importlib.metadata.version("umap-learn") (around the call at line
where importlib.metadata.version is invoked), which can raise AttributeError on
Python 3.11; add an explicit "import importlib.metadata" near the other imports
at the top of the file so importlib.metadata is guaranteed to be present before
the importlib.metadata.version(...) call.

In `@python/cuml/cuml_accel_tests/upstream/umap/run-tests.sh`:
- Around line 15-16: UMAP tag construction assumes the "release-" prefix for all
versions; update the logic around UMAP_VERSION/UMAP_TAG to handle older tags by
either (a) checking if the "release-${UMAP_VERSION}" tag exists before using it
and falling back to "${UMAP_VERSION}" if not, or (b) using a version check
(UMAP_VERSION >= 0.5.5) to decide whether to prefix "release-"; ensure the
downstream git checkout uses the resolved tag and that the existence check
(e.g., git tag or git rev-parse) is used to avoid a failed git checkout.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf81750c-ea6b-443e-b03a-8f20ea7f1535

📥 Commits

Reviewing files that changed from the base of the PR and between c86eb15 and 2966218.

📒 Files selected for processing (14)
  • conda/environments/all_cuda-129_arch-aarch64.yaml
  • conda/environments/all_cuda-129_arch-x86_64.yaml
  • conda/environments/all_cuda-131_arch-aarch64.yaml
  • conda/environments/all_cuda-131_arch-x86_64.yaml
  • dependencies.yaml
  • python/cuml/cuml/accel/_overrides/umap.py
  • python/cuml/cuml_accel_tests/integration/test_umap.py
  • python/cuml/cuml_accel_tests/test_core.py
  • python/cuml/cuml_accel_tests/upstream/umap/run-tests.sh
  • python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
  • python/cuml/pyproject.toml
  • python/cuml/tests/test_sklearn_import_export.py
  • python/cuml/tests/test_trustworthiness.py
  • python/cuml/tests/test_umap.py
💤 Files with no reviewable changes (4)
  • python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
  • python/cuml/tests/test_sklearn_import_export.py
  • python/cuml/tests/test_umap.py
  • python/cuml/tests/test_trustworthiness.py

Comment thread python/cuml/cuml_accel_tests/test_core.py
Comment thread python/cuml/cuml_accel_tests/upstream/umap/run-tests.sh

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, but approving so you don't need another review from me after addressing them.

Comment thread python/cuml/cuml/accel/_overrides/umap.py Outdated
Comment thread python/cuml/cuml_accel_tests/test_core.py Outdated

@dantegd dantegd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a request to update docs

Comment thread conda/environments/all_cuda-129_arch-aarch64.yaml
Comment thread python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
csadorf added 4 commits March 5, 2026 16:09
Technically not necessary since the module would not be imported if uamp
was not available, but this is ok as a defensive measure.
@csadorf
csadorf requested a review from dantegd March 5, 2026 16:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@python/cuml/cuml_accel_tests/test_core.py`:
- Around line 89-90: The xfail reason text is inconsistent with the actual gate
predicate in the test: the code uses
Version(importlib.metadata.version("umap-learn")) < Version("0.5.8") but the
reason string says "<= 0.5.7"; update the reason to match the predicate (e.g.,
change the xfail reason to state "umap-learn < 0.5.8" or "< 0.5.8") so the
message aligns with the Version(...) < Version("0.5.8") check in the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: de7a1cf0-5604-402f-b54b-e475f5949669

📥 Commits

Reviewing files that changed from the base of the PR and between 2966218 and 9ff3580.

📒 Files selected for processing (4)
  • docs/source/supported_versions.rst
  • python/cuml/cuml/accel/_overrides/umap.py
  • python/cuml/cuml_accel_tests/test_core.py
  • python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml

Comment thread python/cuml/cuml_accel_tests/test_core.py
@csadorf
csadorf removed the request for review from msarahan March 5, 2026 16:48

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approving, thanks!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
python/cuml/cuml/accel/pytest_plugin.py (1)

46-61: Narrow the exception scope in condition evaluation.

At line 60, except Exception can hide unexpected defects and silently disable xfail conditions by returning False. Catch only the exceptions that can actually be raised: InvalidRequirement (from malformed requirement strings) and PackageNotFoundError (when a package is not installed).

Proposed diff
-from importlib.metadata import version
+from importlib.metadata import PackageNotFoundError, version
 ...
-from packaging.requirements import Requirement
+from packaging.requirements import InvalidRequirement, Requirement
 ...
-    except Exception:
+    except (InvalidRequirement, PackageNotFoundError):
         return False
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@python/cuml/cuml/accel/pytest_plugin.py` around lines 46 - 61, The
_evaluate_single_condition function currently swallows all exceptions; replace
the broad `except Exception` with a narrowed exception handler that only catches
malformed requirement and missing-package errors: catch `InvalidRequirement`
(from packaging.requirements) and `PackageNotFoundError` (from
importlib.metadata or importlib_metadata depending on project imports) and
return False in that handler, letting other exceptions propagate; keep the rest
of the logic using `Requirement(condition_str.strip())`, `version(req.name)`,
and `req.specifier.contains(...)` unchanged.
python/cuml/cuml_accel_tests/upstream/xfail_manager.py (1)

361-368: Use InvalidRequirement instead of catching all exceptions.

The broad except Exception as e: at line 364 can mask unrelated runtime issues. Since Requirement(clause.strip()) only raises InvalidRequirement for parsing errors, narrow the exception handler to specifically catch that documented exception from packaging.requirements.

Proposed diff
-from packaging.requirements import Requirement
+from packaging.requirements import InvalidRequirement, Requirement
...
-                    except Exception as e:
+                    except InvalidRequirement as e:
                         errors.append(
                             f"Group {i} has invalid condition "
                             f"'{group.condition}': {e}"
                         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@python/cuml/cuml_accel_tests/upstream/xfail_manager.py` around lines 361 -
368, The except block that currently catches all exceptions when parsing each
clause with Requirement(clause.strip()) should be narrowed to catch
packaging.requirements.InvalidRequirement only; replace "except Exception as e:"
with "except InvalidRequirement as e:" (import InvalidRequirement from
packaging.requirements if not already imported) so only parse errors append the
message to errors for Group i using group.condition, leaving other runtime
exceptions to propagate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@python/cuml/cuml_accel_tests/upstream/xfail_manager.py`:
- Around line 361-368: The except block that currently catches all exceptions
when parsing each clause with Requirement(clause.strip()) should be narrowed to
catch packaging.requirements.InvalidRequirement only; replace "except Exception
as e:" with "except InvalidRequirement as e:" (import InvalidRequirement from
packaging.requirements if not already imported) so only parse errors append the
message to errors for Group i using group.condition, leaving other runtime
exceptions to propagate.

In `@python/cuml/cuml/accel/pytest_plugin.py`:
- Around line 46-61: The _evaluate_single_condition function currently swallows
all exceptions; replace the broad `except Exception` with a narrowed exception
handler that only catches malformed requirement and missing-package errors:
catch `InvalidRequirement` (from packaging.requirements) and
`PackageNotFoundError` (from importlib.metadata or importlib_metadata depending
on project imports) and return False in that handler, letting other exceptions
propagate; keep the rest of the logic using
`Requirement(condition_str.strip())`, `version(req.name)`, and
`req.specifier.contains(...)` unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bc641d31-32a7-4506-9bd3-799ae3a871d2

📥 Commits

Reviewing files that changed from the base of the PR and between 0bc9698 and 3d64deb.

📒 Files selected for processing (4)
  • python/cuml/cuml/accel/pytest_plugin.py
  • python/cuml/cuml_accel_tests/upstream/README.md
  • python/cuml/cuml_accel_tests/upstream/umap/xfail-list.yaml
  • python/cuml/cuml_accel_tests/upstream/xfail_manager.py
✅ Files skipped from review due to trivial changes (1)
  • python/cuml/cuml_accel_tests/upstream/README.md

@csadorf

csadorf commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit ede20b6 into NVIDIA:main Mar 5, 2026
99 checks passed
@csadorf
csadorf deleted the bump-umap-version branch March 5, 2026 22:18
@coderabbitai coderabbitai Bot mentioned this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conda conda issue Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rleax umap-learn version constraint to support <0.5.12

5 participants