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(torch): torch.histc function added to torch front-end #23678

Closed
wants to merge 5 commits into from

Conversation

kiluazen
Copy link

@kiluazen kiluazen commented Sep 15, 2023

PR Description

Related Issue

Close #23527

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:

@KushalSM5

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

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Protected Branch

In order to be considered for merging, the pull request changes must not be implemented on the "main" branch. This is described in our Contributing Guide. We are closing this pull request and we would suggest that you implement your changes as described in our Contributing Guide and open a new pull request.

@kiluazen
Copy link
Author

My tests failed, but had to make the PR, else my issue was gonna expire. I need assistance in understanding the errors.

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.

Congrats on making your first Pull Request and thanks for supporting Ivy! 🎉
Join the conversation in our Discord

Here are some notes to understand our tests:

  • We have merged all the tests in one file called `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 fails on this PR.

Please make sure they are passing. 💪

Keep in mind that we will assign an engineer for this task and they will look at it based on the workload that they have, so be patient.

@kiluazen kiluazen changed the title histc #23527 feat(torch): torch.histc function added to torch front-end Sep 15, 2023
@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Sep 15, 2023
@kiluazen
Copy link
Author

I have solved results not matching error for numpy vs torch ground truth. Essentially the problem is when min and max of the array are equal then how are you gonna make bins for the histogram.
I used (min - 5.0000e-1, max +5.0000e+1) that's how they do it in torch.
But there is a fundamental difference in the implementations of tensorflow and torch I think, which I couldn't resolve.
Lastly,
dtypes not matching. I needed assistance on what should I do about that.
Thank you.

@jieunboy0516
Copy link
Contributor

hi @kiluazen , i really apologise for my late reply. It seems that there are falsifying examples shown in the unit tests. Could you take a look and fix it please?
image
thanks a lot for your contribution to ivy!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

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


Failed tests:

This PR introduces the following new failing tests:
ivy_tests/test_ivy/test_frontends/test_torch/test_indexing_slicing_joining_mutating_ops.py::test_torch_dstack,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_indexing_slicing_joining_mutating_ops.py::test_torch_dstack,tensorflow
ivy_tests/test_ivy/test_functional/test_experimental/test_core/test_elementwise.py::test_diff,paddle
ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py::test_tensorflow_scalar_mul,numpy
ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py::test_tensorflow_scalar_mul,jax
ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py::test_tensorflow_scalar_mul,tensorflow
ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py::test_tensorflow_scalar_mul,torch
ivy_tests/test_ivy/test_frontends/test_torch/test_indexing_slicing_joining_mutating_ops.py::test_torch_dsplit,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_apply_,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_apply_,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_apply_,paddle
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_narrow,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_narrow,tensorflow
ivy_tests/test_ivy/test_functional/test_experimental/test_core/test_manipulation.py::test_partial_vec_to_tensor,paddle
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_view_as,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_view_as,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_view_as,paddle
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_transpose_,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_fix_,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_fix_,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_fix_,paddle
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_neg_,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_split,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_split,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_add,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_add,paddle
ivy_tests/test_ivy/test_frontends/test_torch/test_indexing_slicing_joining_mutating_ops.py::test_torch_narrow,numpy
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_max,jax
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_max,tensorflow
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_tensor_argmin,jax

@kiluazen
Copy link
Author

kiluazen commented Oct 4, 2023

I am struggling with understanding the root cause of my test failures. please take a look at this colab file. I played with ouputs of jax.numpy and torch.histc and also the histc funciton I wrote using ivy.histogram. They all are giving me the same outputs. But in my failed test cases it's like backend jax is not matching with ground truth torch. So maybe there is conversion problem with frontend to jax backend, I don't know .

I need some assistance with this. Can you specify a 25 min window in the next week, so we can both be online and have a back and forth conversation and resolve this issue.

Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

Hi @kiluazen
Thanks for the PR. Sorry for the delay on our end.
Could you remove the duplicate histc implmentations and the tests and cleanup stuff from conflict resolving like <<<<<<< HEAD and =======
Feel free to request a review when done. Thanks :)

@ivy-seed
Copy link

ivy-seed commented Mar 8, 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 added the Stale label Mar 8, 2024
@ivy-seed ivy-seed closed this Mar 15, 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
PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

histc
7 participants