Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Good First Issue]: Support aten::logit, aten::special_logit #28744

Open
code-dev05 opened this issue Jan 30, 2025 · 12 comments · May be fixed by #28882
Open

[Good First Issue]: Support aten::logit, aten::special_logit #28744

code-dev05 opened this issue Jan 30, 2025 · 12 comments · May be fixed by #28882
Assignees
Labels
category: PyTorch FE OpenVINO PyTorch Frontend good first issue Good for newcomers no_stale Do not mark as stale

Comments

@code-dev05
Copy link
Contributor

code-dev05 commented Jan 30, 2025

Context

Context
OpenVINO component responsible for support of PyTorch models is called as PyTorch Frontend (PT FE). PT FE converts a model represented as TorchScript model to a model in OpenVINO opset.

Add Support for the following operations:
aten::logit

What needs to be done?

Implement conversion rule and/or transformation to support the new operation.
Implement operation tests in tests/layer_tests/pytorch_tests. Please consider different data types, but keep reasonable number of test cases

Example Pull Requests
#18998

Resources

Contact points

@openvinotoolkit/openvino-pytorch-frontend-maintainers

No response

@code-dev05 code-dev05 added good first issue Good for newcomers no_stale Do not mark as stale labels Jan 30, 2025
@github-project-automation github-project-automation bot moved this to Contributors Needed in Good first issues Jan 30, 2025
@code-dev05
Copy link
Contributor Author

.take

Copy link
Contributor

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

@mlukasze mlukasze moved this from Contributors Needed to Assigned in Good first issues Jan 30, 2025
@code-dev05
Copy link
Contributor Author

I have been trying to implement this operation and facing difficulty with the decomposition. It would be great if you could help me figure it out.

@mvafin

@mvafin
Copy link
Contributor

mvafin commented Feb 7, 2025

I have been trying to implement this operation and facing difficulty with the decomposition. It would be great if you could help me figure it out.

@mvafin

@code-dev05 Check the formula here https://pytorch.org/docs/stable/special.html#torch.special.logit
If the eps is not None you need to clamp the input with Clamp-1, if it is None, then leave as-is.
After that apply the formula for ln(z/(1-z))

@mvafin mvafin changed the title [Good First Issue]: Support for operations PyTorch Frontend (PT FE) [Good First Issue]: Support aten::logit Feb 7, 2025
@mvafin mvafin added the category: PyTorch FE OpenVINO PyTorch Frontend label Feb 7, 2025
@mvafin mvafin changed the title [Good First Issue]: Support aten::logit [Good First Issue]: Support aten::logit, aten::special_logit Feb 7, 2025
@mvafin
Copy link
Contributor

mvafin commented Feb 7, 2025

Please also support aten::special_logit as it seems to be just an alias to the same operation.

@code-dev05
Copy link
Contributor Author

Yes I will try to do that.

@code-dev05
Copy link
Contributor Author

Can we perform the operation 1 - z by using a constant 1 and doing subtraction with z?

@mvafin
Copy link
Contributor

mvafin commented Feb 7, 2025

Can we perform the operation 1 - z by using a constant 1 and doing subtraction with z?

Yes, that is exactly what is needed Subtract(Constant(1), clamped_input)

@p-wysocki
Copy link
Contributor

Hello @code-dev05, do you have any questions or require any help?

@code-dev05
Copy link
Contributor Author

Yes, I am facing an accuracy issue. The fp16 test cases are passing but fp32 are not. Can you guide me how to go about it?
@p-wysocki

@p-wysocki
Copy link
Contributor

p-wysocki commented Mar 12, 2025

The answer may be easier if you just open the PR, even if some tests are still failing.
@openvinotoolkit/openvino-pytorch-frontend-maintainers @mvafin could you please take a look?

@code-dev05
Copy link
Contributor Author

This is the PR - 28882
I opened it some time ago.

@mlukasze mlukasze moved this from Assigned to In Review in Good first issues Mar 12, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category: PyTorch FE OpenVINO PyTorch Frontend good first issue Good for newcomers no_stale Do not mark as stale
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

3 participants