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

[Relay][Frontend] Preserve Pytorch Span Names #16171

Merged
merged 10 commits into from
Dec 8, 2023

Conversation

navya-encharge
Copy link
Contributor

@navya-encharge navya-encharge commented Nov 27, 2023

In accordance with discussion and RFC at https://discuss.tvm.apache.org/t/frontend-preserving-pytorch-spans/16044, we provide the ability to preserve the raw Pytorch scope name like "bert.encoder.layer.11.output.dense" as opposed to getting renamed to an arbitrary "internal" TVM name like "aten::conv2d_1, aten::dense" etc.

@navya-encharge navya-encharge changed the title Preserve Pytorch Span Names [Frontend] Preserve Pytorch Span Names Nov 27, 2023
@navya-encharge navya-encharge changed the title [Frontend] Preserve Pytorch Span Names [Relay][Frontend] Preserve Pytorch Span Names Nov 27, 2023
@navya-encharge navya-encharge marked this pull request as ready for review November 27, 2023 21:58
Copy link
Contributor

@MichaelJKlaiber MichaelJKlaiber left a comment

Choose a reason for hiding this comment

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

Looks generally good!
Some minor nits

python/tvm/relay/frontend/pytorch.py Show resolved Hide resolved
python/tvm/relay/frontend/pytorch.py Outdated Show resolved Hide resolved
python/tvm/relay/frontend/pytorch.py Outdated Show resolved Hide resolved
python/tvm/relay/frontend/pytorch.py Show resolved Hide resolved
Copy link
Contributor

@MichaelJKlaiber MichaelJKlaiber left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@navya-encharge
Copy link
Contributor Author

@masahi @tqchen any feedback would be awesome! Lmk if y'all prefer some changes

source_map=None,
op_type_dict=None,
use_parser_friendly_name=False,
preserve_pytorch_scopes=False,
Copy link
Member

Choose a reason for hiding this comment

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

I think it can be set to True by default, can be done as a follow up.

@masahi masahi merged commit bf071de into apache:main Dec 8, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants