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

[PyTorch] : implement support for replicated{1,2,3} pad #28271

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

Conversation

11happy
Copy link
Contributor

@11happy 11happy commented Jan 4, 2025

Overview:
This pull request fixes #23322.

Testing:

  • Tested the updated code.
    Screenshot from 2025-01-05 00-46-00

CC:

@11happy 11happy requested a review from a team as a code owner January 4, 2025 19:18
@11happy 11happy requested review from mvafin and PiotrKrzem January 4, 2025 19:18
@github-actions github-actions bot added the category: PyTorch FE OpenVINO PyTorch Frontend label Jan 4, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Jan 4, 2025
@11happy
Copy link
Contributor Author

11happy commented Jan 6, 2025

humble ping!
thank you

@rkazants
Copy link
Member

rkazants commented Jan 7, 2025

build_jenkins

@11happy 11happy requested a review from rkazants January 20, 2025 15:35
Signed-off-by: 11happy <[email protected]>
@rkazants
Copy link
Member

build_jenkins

@11happy
Copy link
Contributor Author

11happy commented Jan 25, 2025

I have fixed the code style , ran clang-format.
Thank you

@rkazants
Copy link
Member

build_jenkins

@11happy
Copy link
Contributor Author

11happy commented Feb 2, 2025

humble ping!
fixed the CI failing cause.
thank you

@rkazants
Copy link
Member

rkazants commented Feb 2, 2025

build_jenkins

Signed-off-by: 11happy <[email protected]>
@rkazants
Copy link
Member

rkazants commented Feb 3, 2025

build_jenkins

class TestReplicatePad1D(PytorchLayerTest):
def _prepare_input(self, ndim=4, dtype="float32"):
import numpy as np
input_5d_shape = [5,9,1,1,2,4]
Copy link
Member

Choose a reason for hiding this comment

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

please remove input_5d_shape and ndim from here and add normal input_shape to @pytest.mark.parametrize.
The same comment for other tests

Copy link
Contributor Author

@11happy 11happy Feb 7, 2025

Choose a reason for hiding this comment

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

done,
please suggest the input_shapes to keep, currently kept random from my end,
thank you

@11happy 11happy requested review from mvafin and rkazants February 8, 2025 07:49
@11happy
Copy link
Contributor Author

11happy commented Feb 8, 2025

I think in reflection pad as well we can change aten::pad to aten::reflection_padnd , should I make those changes in this PR ? or may I open a new PR for those changes.
thank you

@mvafin
Copy link
Contributor

mvafin commented Feb 10, 2025

I think in reflection pad as well we can change aten::pad to aten::reflection_padnd , should I make those changes in this PR ? or may I open a new PR for those changes. thank you

Yes, please do the same for reflection_pad, and constant_padnd as it is similar. You would need to add the entries in op_table.cpp for TS table.

@11happy
Copy link
Contributor Author

11happy commented Feb 16, 2025

Humble Ping! @mvafin , @rkazants
In recent commit I have also changed aten::pad to aten::reflection_padnd as discussed above.
Thank you

@11happy 11happy requested a review from mvafin February 16, 2025 09:24
Signed-off-by: 11happy <[email protected]>
num_inputs_check(context, 2, 2);
auto data = context.get_input(0);
auto paddings = context.const_input<std::vector<int64_t>>(1);
Output<Node> pad_value = context.mark_node(v0::Constant::create(element::f32, Shape{}, {0}));
return translate_pad_common(context, data, paddings, pad_value, "reflect");
}

OutputVector translate_replicate_pad_nd(const NodeContext & context) {
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
OutputVector translate_replicate_pad_nd(const NodeContext & context) {
OutputVector translate_replicate_pad_nd(const NodeContext& context) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 955 to 957
{"aten.replicate_pad1d.default", op::translate_replicate_pad_nd},
{"aten.replicate_pad2d.default", op::translate_replicate_pad_nd},
{"aten.replicate_pad3d.default", op::translate_replicate_pad_nd},
Copy link
Contributor

Choose a reason for hiding this comment

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

Tests for torch.export fail. I can see that names are wrong, but tests fail on torch side, please check them

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 am not sure but If I am trying to open the logs
image

its just loading & loading not showing the logs. How may I acces the failed logs.
Thank you

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 have corrected the names. Thank you

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::replication_pad{1,2,3}d for pytorch models
4 participants