Skip to content
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

Conversion/TorchToTosa/basic.mlir failing on ARM, due to different random numbers in torch.aten.uniform #3859

Closed
dbabokin opened this issue Nov 7, 2024 · 4 comments

Comments

@dbabokin
Copy link
Contributor

dbabokin commented Nov 7, 2024

After 4dd213b by @justin-ngo-arm, I see Conversion/TorchToTosa/basic.mlir test is failing on my ARM-based MacbookPro for torch.aten.uniform check. This line doesn't match:

// CHECK: %[[VAL_4:.*]] = "tosa.const"() <{value = dense<{{\[\[}}1.00007045, 2.18384027, 7.80044794, 5.12785149], [5.79490519, 2.97063255, 1.42340159, 7.10978221], [7.11366796, 9.41223621, 4.45151854, 5.67474747]]> : tensor<3x4xf32>}> : () -> tensor<3x4xf32>

Instead I have the following line in my output:

%0 = "tosa.const"() <{value = dense<[[1.0002023, 1.76529205, 6.41217375, 9.0245018], [9.71160125, 2.70720792, 5.63478279, 4.5820756], [3.36615539, 7.69161224, 1.8059299, 6.04350948]]> : tensor<3x4xf32>}> : () -> tensor<3x4xf32>

Which is also uniform distribution, but with different random numbers. The test works fine for me on x86 Linux, though.

I'm not sure if the test needs to be fixed or torch.aten.uniform itself to be more reproducible across platforms.

@justin-ngo-arm
Copy link
Contributor

Hi @dbabokin , I've fixed the test and will tag you in the PR review process. Thank you for catching this issue.

@dbabokin
Copy link
Contributor Author

dbabokin commented Nov 7, 2024

@justin-ngo-arm Thanks for blazingly fast response!

@justin-ngo-arm
Copy link
Contributor

@dbabokin I've tagged you in a comment in this recently merged PR - #3855 - which includes the fix for the issue. Please let me know if this resolves your problem and we can close the issue out. Thank you!

@dbabokin
Copy link
Contributor Author

dbabokin commented Nov 7, 2024

I've just checked and the issue is fixed. Thank you!

@dbabokin dbabokin closed this as completed Nov 7, 2024
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

No branches or pull requests

2 participants