Implement dpnp.linalg.lu_factor 2D inputs#2557
Merged
vlad-perevezentsev merged 19 commits intomasterfrom Aug 28, 2025
Merged
Conversation
Contributor
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
Contributor
|
Array API standard conformance tests for dpnp=0.19.0dev3=py313h509198e_30 ran successfully. |
Collaborator
ndgrigorian
reviewed
Aug 19, 2025
7 tasks
ndgrigorian
reviewed
Aug 24, 2025
github-actions bot
added a commit
that referenced
this pull request
Aug 28, 2025
This PR suggests adding `dpnp.linalg.lu_factor()` for 2D arrays similar to `scipy.linalg.lu_factor` Support for ND inputs will be added in the next phase. In addition, this PR includes: 1. An updated implementation of `getrf` to support non-square matrices. 2. Refactoring of `_lu_factor()` by splitting the logic into separate functions to improve readability and maintainability. 6eb6f6f
vlad-perevezentsev
added a commit
that referenced
this pull request
Aug 29, 2025
This PR suggests extending `dpnp.linalg.lu_factor()` #2557 for batch arrays In addition, this PR includes: An updated implementation of getrf_batch to support non-square matrices
antonwolfy
reviewed
Aug 29, 2025
Comment on lines
+922
to
+923
| Whether to overwrite data in `a` (may increase performance) | ||
| Default: ``False``. |
Contributor
There was a problem hiding this comment.
Whether to overwrite data in `a` (may increase performance).
Default: ``False``.| check_finite : {None, bool}, optional | ||
| Whether to check that the input matrix contains only finite numbers. | ||
| Disabling may give a performance gain, but may result in problems | ||
| (crashes, non-termination) if the inputs do contain infinities or NaNs. |
|
|
||
| Returns | ||
| ------- | ||
| lu :(M, N) dpnp.ndarray |
Contributor
There was a problem hiding this comment.
sems space is missing: lu : (M, N)
| lu :(M, N) dpnp.ndarray | ||
| Matrix containing U in its upper triangle, and L in its lower triangle. | ||
| The unit diagonal elements of L are not stored. | ||
| piv (K, ): dpnp.ndarray |
Contributor
There was a problem hiding this comment.
piv : (K, ) dpnp.ndarray
| return dpnp_lstsq(a, b, rcond=rcond) | ||
|
|
||
|
|
||
| def lu_factor(a, overwrite_a=False, check_finite=True): |
Contributor
There was a problem hiding this comment.
The documentation for the function is not rendering
| if any(dev_info_h): | ||
| diag_nums = ", ".join(str(v) for v in dev_info_h if v > 0) | ||
| warn( | ||
| f"Diagonal number {diag_nums} are exactly zero. Singular matrix.", |
Contributor
There was a problem hiding this comment.
"Diagonal number {diag_nums} is exactly zero. Singular matrix."
antonwolfy
reviewed
Sep 1, 2025
| a_h.get_array(), | ||
| ipiv_h.get_array(), | ||
| dev_info_h, | ||
| depends=[copy_ev] if copy_ev is not None else [], |
Contributor
There was a problem hiding this comment.
It must depend on _manager.submitted_events if copy is None
vlad-perevezentsev
added a commit
that referenced
this pull request
Sep 4, 2025
This PR suggests adding `dpnp.linalg.lu_factor()` for 2D arrays similar to `scipy.linalg.lu_factor` Support for ND inputs will be added in the next phase. In addition, this PR includes: 1. An updated implementation of `getrf` to support non-square matrices. 2. Refactoring of `_lu_factor()` by splitting the logic into separate functions to improve readability and maintainability.
vlad-perevezentsev
added a commit
that referenced
this pull request
Sep 4, 2025
This PR suggests extending `dpnp.linalg.lu_factor()` #2557 for batch arrays In addition, this PR includes: An updated implementation of getrf_batch to support non-square matrices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR suggests adding
dpnp.linalg.lu_factor()for 2D arrays similar toscipy.linalg.lu_factorSupport for ND inputs will be added in the next phase.
In addition, this PR includes:
getrfto support non-square matrices._lu_factor()by splitting the logic into separate functions to improve readability and maintainability.