Repository navigation
Lower _linalg_svd - #4537
Lower _linalg_svd#4537
Conversation
e75c513 to
255f999
Compare
|
CI failing due to seemingly unrelated error: |
255f999 to
f6651cb
Compare
|
Update: this test seems like it's failing on head. |
JackCaoG
left a comment
There was a problem hiding this comment.
Thanks! Feel free to merge after test is green
This change lowers _linalg_svd by mostly reusing the existing svd lowering. However, there are a couple of notable differences between these two ops: 1. torch.svd()'s `some` is the opposite of torch.linalg.svd()'s `full_matrices`. Note that default value for both is True, so the default behavior is effectively the opposite. 2. torch.svd() returns V, whereas torch.linalg.svd() returns Vh (V transposed). 3. If `compute_uv` is False, torch.svd() returns zero-filled tensors for U and Vh, whereas torch.linalg.svd() returns empty tensors.
f6651cb to
080f7c1
Compare
|
crashed with frame info seems like some shape in SVD is invalid.. |
|
Seems like I missed an op in the |
b391a34 to
3a4deb8
Compare
|
Added some more ops failing due to the same existing error with Now locally, the tests are passing but I'll let the CI verify. |
* Lower _linalg_svd This change lowers _linalg_svd by mostly reusing the existing svd lowering. However, there are a couple of notable differences between these two ops: 1. torch.svd()'s `some` is the opposite of torch.linalg.svd()'s `full_matrices`. Note that default value for both is True, so the default behavior is effectively the opposite. 2. torch.svd() returns V, whereas torch.linalg.svd() returns Vh (V transposed). 3. If `compute_uv` is False, torch.svd() returns zero-filled tensors for U and Vh, whereas torch.linalg.svd() returns empty tensors. * Run linter * Disable some more tests * Add comments to the disabled tests
Fixes #4511
Lower _linalg_svd
This change lowers _linalg_svd by mostly reusing the existing svd lowering. However, there are a couple of notable differences between these two ops:
someis the opposite of torch.linalg.svd()'sfull_matrices. Note that default value for both is True, so the default behavior is effectively the opposite.compute_uvis False, torch.svd() returns zero-filled tensors for U and Vh, whereas torch.linalg.svd() returns empty tensors.As a result of this change, we also disable the following ops in xla/test/test_ops.py:
geqrflinalg.detlinalg.inv_exlinalg.matrix_ranklinalg.svdlinalg.svdvalsThese ops all call into the newly lowered
_linalg_svdand cause failure:Slice dim size 1 greater than dynamic slice dimension: 0. This failure seems to be also happening in our master branch for the already lowered opsvd. In xla/test/test_ops.py, ops such assvd,pinverse, ornuclear_normthat callsvdare failing due to the same error and are disabled. However, to ensure correctness for the newly lowered_linalg_svd, this PR adds unit tests and does not cause any regressing cpp test failures.