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(frontend): Added logsumexp function in paddlepaddle frontend #21725

Merged
merged 4 commits into from
Jan 2, 2024

Conversation

shaby112
Copy link
Contributor

@shaby112 shaby112 commented Aug 11, 2023

close #21617

@github-actions
Copy link
Contributor

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 master, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
2. 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. ⚠️🔧
3. 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! 🎉👨‍💻

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Aug 11, 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 🤗

Copy link
Contributor

@AryanSharma21 AryanSharma21 left a comment

Choose a reason for hiding this comment

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

Hey @shaby112 , you should edit the description of the PR to add the closing tag as
close #issue_number to link the PR with the issue that you create. This will close the issue with the pull request accordingly. Thanks

@shaby112
Copy link
Contributor Author

Okay, I have edited the description. Thank you for letting me know!



@with_supported_dtypes(
{"2.5.1 and below": ("float32", "float64")}, "paddle"
Copy link
Contributor

Choose a reason for hiding this comment

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

x (Tensor) – The input Tensor with data type float16, float32 or float64, which have no more than 4 dimensions.

Original function supports the following dtypes for x, please update the decorator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. The changes have been made.

@sagewhocodes
Copy link
Contributor

@shaby112 I noticed that you wrote a frontend for logsumexp but there's no implementation of that in Ivy's functional API which you were trying to use in your frontend implemenation.

I would advice you to adapt a compositional implementation similar to the one in jax's frontend for this function.
Thanks!

@shaby112
Copy link
Contributor Author

@shaby112 I noticed that you wrote a frontend for logsumexp but there's no implementation of that in Ivy's functional API which you were trying to use in your frontend implemenation.

I would advice you to adapt a compositional implementation similar to the one in jax's frontend for this function. Thanks!

Sure I will try my best

Copy link
Contributor Author

@shaby112 shaby112 left a comment

Choose a reason for hiding this comment

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

I have changed the implementation, kindly review this.



@with_supported_dtypes(
{"2.5.1 and below": ("float32", "float64")}, "paddle"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. The changes have been made.

Copy link
Contributor Author

@shaby112 shaby112 left a comment

Choose a reason for hiding this comment

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

I had some errors in the previous code that I submitted, I didn't test it properly. This implementation works as expected and passes al 5 tests aswell. Kindly review this.

Copy link
Contributor Author

@shaby112 shaby112 left a comment

Choose a reason for hiding this comment

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

Kindly review this pull request. I would appreciate your valuable insights and thoughts!

@sagewhocodes
Copy link
Contributor

Hi @shaby112 , Could you please resolve the merge conflicts?
I'll review them after that!

@handle_frontend_test(
fn_tree="paddle.tensor.math.amax",
fn_tree="paddle.tensor.math.logsumexp",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid"),
num_arrays=2,
allow_inf=False,
shared_dtype=True,
Copy link
Contributor

@sagewhocodes sagewhocodes Aug 18, 2023

Choose a reason for hiding this comment

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

add max_num_dims = 4 in the decorator , tests are failing because of it
On the paddle docs it says

x (Tensor) – The input Tensor with data type float16, float32 or float64, which have no more than 4 dimensions.

return out


@with_supported_dtypes(
Copy link
Contributor

Choose a reason for hiding this comment

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

fix Indentation issues on Line 495

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I am doing that. Thank you for letting me know!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed the indentation issue however I am still getting the same lint error, I apologize for taking so much of your time.

@sagewhocodes
Copy link
Contributor

Hello @shaby112 , Please update your PR with the proposed changes, Verify all the tests pass and let me know!

Thanks!

@shaby112
Copy link
Contributor Author

Hello @shaby112 , Please update your PR with the proposed changes, Verify all the tests pass and let me know!

Thanks!

Alright, the tests are running I will let you know how it goes. Thanks!

@shaby112
Copy link
Contributor Author

shaby112 commented Sep 1, 2023

@saeedashrraf can you kindly review this? I will appreciate your input and insights.

@shaby112
Copy link
Contributor Author

shaby112 commented Sep 5, 2023

@sagewhocodes can you kindly review this PR, I will greatly appreciate your insights.

@shaby112
Copy link
Contributor Author

I closed it accidentally, reopening the PR!

@shaby112 shaby112 reopened this Sep 20, 2023
@shaby112
Copy link
Contributor Author

Can you kindly review this @sagewhocodes @saeedashrraf ? I will greatly appreciate your insights!

@saeedashrraf saeedashrraf changed the title Added logsumexp function in paddlepaddle frontend feat(frontend): Added logsumexp function in paddlepaddle frontend Oct 21, 2023
@github-actions
Copy link
Contributor

Thank you for this PR, here is the CI results:


This pull request does not result in any additional test failures. Congratulations!

@NripeshN
Copy link
Contributor

NripeshN commented Jan 2, 2024

LGTM!!

@NripeshN NripeshN merged commit f655b4c into ivy-llc:main Jan 2, 2024
131 of 140 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
Development

Successfully merging this pull request may close these issues.

logsumexp
8 participants