-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Op info test for linalg.tensorsolve .. log_normal
#7505
Comments
@ManfeiBai - Iam working on this |
trying linspace:One of the failing test logs:
The Taking the last sample input and calling in a test script that uses torch_xla2:
The call is returning a Jax array of len 1. As does the native torch's implementation:
|
Investigating further, the testcases that are failing is using
The same function when the steps>1, returns a tensor !! :
steps==1 case calls |
Investigating
Output:
|
Thanks for the investigation here, is it possible to modify |
Trying this patch, some of the failures went away for
But it introduces failures for
output:
|
copy_ should behave identically as original torch.copy_ should behave. From here: https://pytorch.org/docs/stable/generated/torch.Tensor.copy_.html it's not about scaler vs rank 1; but about self's shape is perserving. (and src broadcasts to self). So So something along the lines of:
should work |
ProgressWith fixes in #8236 , most tests are passing (for
Remaining failure can be reduced to behavior similar to this input:
Investigating the failure
output:
The interesting thing is when iam debugging , xla's linspace breaks in torch python lib: https://github.com/pytorch/pytorch/blob/b16167874dddcbb078a113e4d607761b81de940d/torch/_refs/__init__.py#L5107 |
tried locally too with
|
Looks like there is a bug in torch's linspace: pytorch/pytorch#137546 |
tested jaten.py implementation as well xla's pytorch decomposition. For the float dtype output matches. So its to do with rounding logic when converting from float to int !! And it should be done after the initial generation. xla override (jax implementation):
test script:
|
1. fix _copy to handle self shape=(1) and copy src shape=0, ref: pytorch#7505 (comment) 2. for squeeze where we expect the self's shape to change, dont use copy_ instead replace. 3. in test_ops reset dtype to float when an int64 is passed for linspace case. This is to workaround known pytorch failure: pytorch/pytorch#137546 ref: * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch/pytorch#137546
1. fix _copy to handle self shape=(1) and copy src shape=0, ref: pytorch#7505 (comment) 2. for squeeze where we expect the self's shape to change, dont use copy_ instead replace. 3. in test_ops reset dtype to float when an int64 is passed for linspace case. This is to workaround known pytorch failure: pytorch/pytorch#137546 ref: * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch/pytorch#137546
1. fix _copy to handle self shape=(1) and copy src shape=0, ref: pytorch#7505 (comment) 2. for squeeze where we expect the self's shape to change, dont use copy_ instead replace. 3. in test_ops reset dtype to float when an int64 is passed for linspace case. This is to workaround known pytorch failure: pytorch/pytorch#137546 4. logspace tests depend on linspace. Both are passing now ref: * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch#7505 (comment) * pytorch/pytorch#137546
Working on
|
diff_output( |
So excluding the test from numerical comparision.
Ref:
- pytorch test library annotation for log_normal: https://github.com/pytorch/pytorch/blob/5516ac5c218dc05928860c91563c6f01ceac4808/torch/testing/_internal/common_methods_invocations.py#L11954
* Use the existing log_normal decomposition * Skip numerical comparision for the operation ref: pytorch#7505 (comment) fixes: pytorch#7505
* Use the existing log_normal decomposition * Skip numerical comparision for the operation ref: pytorch#7505 (comment) fixes: pytorch#7505
Working on
|
working on
|
@op(torch.ops.aten._linalg_solve_ex) |
Fix the Op info test for
linalg.tensorsolve .. log_normal
linalg.tensorsolve
..log_normal
fromskip_list
pytest test/test_ops.py
Please refer to
this guide as guide to fix:
Also refer to these PRs:
The text was updated successfully, but these errors were encountered: