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

[PT FE] Support aten::_autocast_to_full_precision #29929

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

saadkhi
Copy link

@saadkhi saadkhi commented Apr 3, 2025

closes #29680

Description:

  • Added support for the aten::_autocast_to_full_precision operation in the PyTorch frontend by implementing the translate_autocast_to_full_precision function and registering it in the operation table.
  • Created a Python-based unit test for translate_autocast_to_full_precision to validate its behavior with various input data types (float32, float16, int32).
  • Resolved module import issues and ensured compatibility by dynamically adjusting sys.path for proper module resolution in the test files.

@saadkhi saadkhi requested a review from a team as a code owner April 3, 2025 19:50
@saadkhi saadkhi requested review from rkazants and cavusmustafa April 3, 2025 19:51
@github-actions github-actions bot added the category: PyTorch FE OpenVINO PyTorch Frontend label Apr 3, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Apr 3, 2025
@mvafin mvafin changed the title [ADD] Support aten::_autocast_to_full_precision [PT FE] Support aten::_autocast_to_full_precision Apr 4, 2025
Comment on lines 7 to 12
import sys
from pathlib import Path

# Add the appropriate paths to sys.path for resolving common and pytorch_layer_test_class
sys.path.append(str(Path(__file__).resolve().parent.parent.parent))
sys.path.append(str(Path(__file__).resolve().parent.parent))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import sys
from pathlib import Path
# Add the appropriate paths to sys.path for resolving common and pytorch_layer_test_class
sys.path.append(str(Path(__file__).resolve().parent.parent.parent))
sys.path.append(str(Path(__file__).resolve().parent.parent))

Copy link
Author

Choose a reason for hiding this comment

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

@mvafin can you explain little more what i have to do.

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need these changes to run tests. If you have issues, you may use PYTHONPATH to solve your individual issues with environment

if (input_type == element::f32) {
return {input};
}
auto full_precision_tensor = context.mark_node(std::make_shared<v1::ConvertLike>(input, input, element::f32));
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no such constructor for COnvertLike. Your code cannot be built

Copy link
Contributor

@mvafin mvafin left a comment

Choose a reason for hiding this comment

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

Make sure your code builts

@saadkhi saadkhi requested a review from mvafin April 8, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: PyTorch FE OpenVINO PyTorch Frontend ExternalPR External contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Support aten::_autocast_to_full_precision
3 participants