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

feat: added quantile function (new) #23580

Closed
wants to merge 21 commits into from

Conversation

jaskiratsingh2000
Copy link
Contributor

@jaskiratsingh2000 jaskiratsingh2000 commented Sep 14, 2023

Close #19176

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks Passed!

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena - Please review this

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Sep 14, 2023
@ivy-leaves
Copy link

If you are working on an open task, please edit the PR description to link to the issue you've created.

For more information, please check ToDo List Issues Guide.

Thank you 🤗

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena This is the infor from Github-bot on many PRs so I want to highlight as it says we can "ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀" which means it is good to go. Please let me know.

`Thanks for contributing to Ivy! 😊👏
Here are some of the important points from our Contributing Guidelines 📝:

  1. Feel free to ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀 It contains the following two sections:
  • Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
  • New Failures Introduced: This lists the tests that are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
  1. The lint / Check formatting / check-formatting tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧
  2. Finally, the test-docstrings / run-docstring-tests check for the changes made in docstrings of the functions. This may be skipped, as well. 📚
    Happy coding! 🎉👨‍💻`

@lucasalavapena
Copy link
Contributor

@lucasalavapena This is the infor from Github-bot on many PRs so I want to highlight as it says we can "ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀" which means it is good to go. Please let me know.

`Thanks for contributing to Ivy! 😊👏 Here are some of the important points from our Contributing Guidelines 📝:

  1. Feel free to ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀 It contains the following two sections:
  • Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
  • New Failures Introduced: This lists the tests that are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
  1. The lint / Check formatting / check-formatting tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧
  2. Finally, the test-docstrings / run-docstring-tests check for the changes made in docstrings of the functions. This may be skipped, as well. 📚
    Happy coding! 🎉👨‍💻`

You have to click on the details and actually look at the results. They are still failing...

@a0m0rajab
Copy link
Contributor

a0m0rajab commented Sep 14, 2023

@jaskiratsingh2000 hi thank you for mentioning the bot, the idea of that message meant to go directly to combined tests instead of checking each of them which we updated the message on last bot and removed it though. PLus, could you add a closing word to the PR reference? it would help to connect it with the issue and auto-close it,

@lucasalavapena lucasalavapena self-assigned this Sep 14, 2023
@lucasalavapena
Copy link
Contributor

#10704

You are linking the wrong issue? That is for backends. You are adding a frontend. Plus you should link the quantile
individual frontend issue not the master issue for all frontends/backends

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena I actually tried but unabel to resolve them at my end. I did actually what I could do during debugs. Would appreciate if locally you cancpush them up once?

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena Apology in that part here is the master issue - #15045
and this one is sub-task #19176

@lucasalavapena
Copy link
Contributor

@lucasalavapena I actually tried but unabel to resolve them at my end. I did actually what I could do during debugs. Would appreciate if locally you cancpush them up once?

All I did was make the axis into an int in your test

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena you mean where I refer to axis=axis that should be made to axis=int. right?

@lucasalavapena
Copy link
Contributor

@lucasalavapena you mean where I refer to axis=axis that should be made to axis=int. right?

No, I explained this better in the other PR in which I showed you part of the paddle paddle code. Your axis variable during tests was sometimes (0,) and other times 0, and I have shown you multiple times now that paddle does not take a tuple as an input for axis

@lucasalavapena
Copy link
Contributor

@lucasalavapena Apology in that part here is the master issue - #15045 and this one is sub-task #19176

Thanks for letting me know 😄 . I updated your first PR comment so it should be all good, please do that next time or update any existing PR you may have accordingly!

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena I made the axis variable as an int itself in the test.

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena or the another opotion that can be done is

dtype_x_and_axis=helpers.dtype_values_axis(
        available_dtypes=helpers.get_dtypes("valid"),
        min_num_dims=1,
        min_value=-1e10,
        max_value=1e10,
        valid_axis=True,
        force_int_axis=True,  # Assuming this forces the axis to be an integer.
    )

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena I tried adding what I mentioned to you on Discord. but there is no luck in surpassing those checks. I'm not able to debug this further. Therefore, I have also raised the concern on Discord Testing channel but there have been no response from them so far. Please, would really appreciate if you could over-commit on my previous or let me know what change I should made it now?
Thanks!
@lucasalavapena

@a0m0rajab a0m0rajab modified the milestone: #10388 Sep 14, 2023
@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena As you mentioned that you were able to make a change and run the test case can you just tell me where exactly made the change? I'm struggling with that even after debugging. and I feel this is at the last stage. Please let me know if you can this would really means a lot.

@jaskiratsingh2000
Copy link
Contributor Author

@Ishticode @lucasalavapena Please please let me know on this.

@jaskiratsingh2000
Copy link
Contributor Author

@lucasalavapena I'm getting this error which I'm unable to understand thouh I know it is an issue of module imports but how to solve it?

Traceback (most recent call last):
  File "/Users/jaskiratsingh/ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_stat.py", line 5, in <module>
    import ivy_tests.test_ivy.helpers as helpers
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/__init__.py", line 2, in <module>
    from . import hypothesis_helpers
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/hypothesis_helpers/__init__.py", line 1, in <module>
    from . import general_helpers
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/hypothesis_helpers/general_helpers.py", line 9, in <module>
    from . import array_helpers, number_helpers, dtype_helpers
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/hypothesis_helpers/array_helpers.py", line 16, in <module>
    from ivy_tests.test_ivy.helpers.hypothesis_helpers.dtype_helpers import get_dtypes
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/hypothesis_helpers/dtype_helpers.py", line 14, in <module>
    from ...conftest import mod_backend
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/conftest.py", line 37, in <module>
    from ivy_tests.test_ivy.helpers.multiprocessing import backend_proc, frontend_proc
  File "/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/multiprocessing.py", line 5, in <module>
    from ivy_tests.test_ivy.helpers.hypothesis_helpers.array_helpers import (
ImportError: cannot import name 'array_helpers_dtype_info_helper' from partially initialized module 'ivy_tests.test_ivy.helpers.hypothesis_helpers.array_helpers' (most likely due to a circular import) (/Users/jaskiratsingh/opt/anaconda3/envs/ivy_dev/lib/python3.10/site-packages/ivy_tests/test_ivy/helpers/hypothesis_helpers/array_helpers.py)

input_dtypes, (x,), axis = dtype_x_and_axis
# Convert axis if it's a tuple
if isinstance(axis, tuple):
axis = axis[0] if len(axis) == 1 else list(axis)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of this logic, I don't think this is required.

Copy link
Contributor Author

@jaskiratsingh2000 jaskiratsingh2000 Sep 15, 2023

Choose a reason for hiding this comment

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

Since axis varibale has to be int not tuples when accepting parameters so that is wy I added it.

)
@to_ivy_arrays_and_back
def quantile(x, q, axis=None, keepdim=False):
return ivy.quantile(x, q, axis=axis, keepdims=keepdim)
Copy link
Contributor

Choose a reason for hiding this comment

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

Paddle quantile returns float64 to obtain higher precision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should I mention only float64?

Copy link
Contributor

@Sarvesh-Kesharwani Sarvesh-Kesharwani Sep 16, 2023

Choose a reason for hiding this comment

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

It's not fixed "AssertionError: returned dtype = float32, ground-truth returned dtype = float64"
this is not related to the supported dtypes but the return dtype of the function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Sarvesh-Kesharwani This has to be implemented within the Test file or this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Sarvesh-Kesharwani I have added. Can you check?

@Sarvesh-Kesharwani
Copy link
Contributor

you need to fix the lint errors as well.

@jaskiratsingh2000
Copy link
Contributor Author

@Sarvesh-Kesharwani lint error is resolved and the changes you requested I made. Still I feel these tests cases fail. Not sure why and how to resolve them

@Sarvesh-Kesharwani
Copy link
Contributor

Plus there is a shape mismatch error as well, you need to update your function logic to return the shape which matches the ground_truth shape

@jaskiratsingh2000
Copy link
Contributor Author

@Sarvesh-Kesharwani could you please let me know that error seems to be within the test file or another file?

Looking forward to hearing from you.

Thanks, and Regards

@jaskiratsingh2000
Copy link
Contributor Author

@Sarvesh-Kesharwani I have resolve the both the errors which you mentioned to nme. Can you please review it again?

@ivy-seed
Copy link

ivy-seed commented Jan 7, 2024

This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.

@ivy-seed ivy-seed closed this Feb 17, 2024
@ivy-seed
Copy link

This PR has been closed because it has been marked as stale for more than 7 days with no activity.

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 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quantile
8 participants