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

fix: Fixed stat.paddle.mean for all backends #28087

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

Sai-Suraj-27
Copy link
Contributor

PR Description

Fixed stat.paddle.mean for all backends

image

Related Issue

Closes #28082
Closes #28083
Closes #28084
Closes #28085
Closes #28086

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Socials

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Jan 27, 2024
@Sarvesh-Kesharwani
Copy link
Contributor

Sarvesh-Kesharwani commented Jan 28, 2024

image
image
please work on fixing these test failures

@Sai-Suraj-27
Copy link
Contributor Author

Sai-Suraj-27 commented Jan 28, 2024

image image please work on fixing these test failures

Hey, @Sarvesh-Kesharwani thanks for the review. I'm not sure, how many examples you set while testing, I tested with 25, 50, 100 and 150 examples.

image
All, the backends are passing with 50 examples.

Although when I tested with 100 examples, only torch backend is failing and when I tested with 150 examples only numpy backend is failing.

image

But, it is actually not any problem with code, it's just the accuracy of the result. You can see that the test is failing due to a minute difference of 10^(-3) difference in the outputs from the 2 backends, Due to this small difference some tests are failing when we set the number of examples too high.

image

I guess, that is the reason, Even in the CI, the test is not shown as failed because in the CI tests are ran with only 25 examples.

So, I guess we can merge this, no need to change anything. Please let me know your opinion.
Thank you.

@@ -26,7 +26,7 @@ def test_paddle_mean(
backend_fw,
test_flags,
):
input_dtype, x, axis = dtype_and_x
input_dtype, x, axis, dtype3, where = dtype_and_x
Copy link
Contributor

Choose a reason for hiding this comment

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

These seem unnecessary

Suggested change
input_dtype, x, axis, dtype3, where = dtype_and_x
input_dtype, x, axis = dtype_and_x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I thought it won't unpack the rest like JS (sorry have been off Python for a while). But why don't we use this?

Suggested change
input_dtype, x, axis, dtype3, where = dtype_and_x
input_dtype, x, axis = dtype_and_x[:2]

Not sure if I'm slicing correctly though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done👍🏻

@KareemMAX
Copy link
Contributor

Also, regarding the current issues with the failing tests. They shouldn't fail even if the code appears right, the precision issue should be handled accordingly @Sai-Suraj-27. And make sure examples cited by @Sarvesh-Kesharwani are passing

@Sai-Suraj-27
Copy link
Contributor Author

Sai-Suraj-27 commented Jan 30, 2024

Also, regarding the current issues with the failing tests. They shouldn't fail even if the code appears right, the precision issue should be handled accordingly @Sai-Suraj-27. And make sure examples cited by @Sarvesh-Kesharwani are passing

Hey, @KareemMAX I know precision should be handled but since the test was passing in CI also. I thought it's okay. Actually this is a clear example of this 2nd case in the docs.
I have updated the test, and tested it with 150 examples, and it is successfully passing for all the backends now.
image

Thanks @Sarvesh-Kesharwani for spotting this 😄.

Copy link
Contributor

@KareemMAX KareemMAX left a comment

Choose a reason for hiding this comment

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

LGTM, waiting for @Sarvesh-Kesharwani's approval to merge

@Sai-Suraj-27
Copy link
Contributor Author

Hey, @Sarvesh-Kesharwani. Can you please look into the PR once and merge it if you think it's good 😄.
Thank you.

@Sarvesh-Kesharwani
Copy link
Contributor

Okay let me test once, then I'll merge it.

@Sarvesh-Kesharwani
Copy link
Contributor

Hi @Sai-Suraj-27,
LGTM now,
Thanks for the hard work.

@Sarvesh-Kesharwani Sarvesh-Kesharwani merged commit 33369c8 into Transpile-AI:main Jan 31, 2024
131 of 141 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
4 participants