Skip to content

fix: Added full_matrices parameter to dask.array.linalg.svd#12292

Merged
jacobtomlinson merged 5 commits intodask:mainfrom
ayanbag:fix/svd-full-matrices-10389
Mar 2, 2026
Merged

fix: Added full_matrices parameter to dask.array.linalg.svd#12292
jacobtomlinson merged 5 commits intodask:mainfrom
ayanbag:fix/svd-full-matrices-10389

Conversation

@ayanbag
Copy link
Copy Markdown
Contributor

@ayanbag ayanbag commented Feb 11, 2026

Add full_matrices keyword argument to dask.array.linalg.svd for Array API spec conformance. Dask's SVD already computes the reduced SVD (full_matrices=False), but the parameter was not exposed, causing TypeError when Array API-consuming libraries (e.g., scikit-learn) passed it explicitly.

full_matrices=False works as before. full_matrices=True raises NotImplementedError since full SVD is not feasible with chunked arrays. Default is False to maintain backward compatibility.

Copilot AI review requested due to automatic review settings February 11, 2026 18:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the full_matrices parameter to dask.array.linalg.svd to improve conformance with the Array API specification, addressing issue #10389. The implementation exposes full_matrices=False (reduced SVD, which Dask already computes) and raises NotImplementedError for full_matrices=True (full SVD, which is not feasible with chunked arrays). This allows Array API-consuming libraries like scikit-learn to use Dask arrays while staying backend-agnostic.

Changes:

  • Added full_matrices parameter to svd() function signature with default value False to maintain backward compatibility
  • Added validation logic that raises NotImplementedError when full_matrices=True
  • Added comprehensive tests covering both the error case and the working case

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
dask/array/linalg.py Added full_matrices parameter to svd() function with validation logic and updated docstring
dask/array/tests/test_linalg.py Added tests for full_matrices=True raising NotImplementedError and full_matrices=False working correctly
.gitignore Added dev directory to ignore list (appears unrelated to PR purpose)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     21 files  ± 0       21 suites  ±0   5h 3m 6s ⏱️ +8s
 18 288 tests + 4   17 013 ✅ + 3   1 274 💤 ±0  1 ❌ +1 
294 851 runs  +64  252 502 ✅ +57  42 348 💤 +6  1 ❌ +1 

For more details on these failures, see this check.

Results for commit a8b7544. ± Comparison against base commit 4195f5a.

♻️ This comment has been updated with latest results.

ayanbag and others added 2 commits February 12, 2026 01:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jacobtomlinson
Copy link
Copy Markdown
Member

CI failure looks unrelated

@jacobtomlinson jacobtomlinson merged commit 714eaf4 into dask:main Mar 2, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dask.array.linalg.svd does not conform to the Array API spec

3 participants