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

Reorg for converters in (FX Converter Refactor [1/N]) #1867

Merged
merged 1 commit into from
May 23, 2023

Conversation

narendasan
Copy link
Collaborator

@narendasan narendasan commented Apr 28, 2023

Description

Proposes reorganization of the converters to separate IR from implementation.

Introduces SourceIR enum to inform downstream tasks of any necessary special cases.

Note: This PR cannot be merged without child PRs updating uses of common_activation and add_activation to use the new method.

Type of change

Please delete options that are not relevant and/or add your own.

  • Refactor

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

@narendasan narendasan requested review from frank-wei and wushirong and removed request for yinghai April 28, 2023 20:10
Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

@narendasan narendasan changed the title Reorg for converters in FX [1/N] Reorg for converters in (FX Converter Refactor [2/N]) Apr 28, 2023
@github-actions github-actions bot requested a review from yinghai April 28, 2023 20:29
@narendasan narendasan changed the title Reorg for converters in (FX Converter Refactor [2/N]) Reorg for converters in (FX Converter Refactor [1/N]) Apr 28, 2023
Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to Python style guidelines

Copy link

@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.

Code conforms to C++ style guidelines

Copy link
Contributor

@wushirong wushirong left a comment

Choose a reason for hiding this comment

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

I am assuming PR is planned to land in order, so this PR should land before #1868. The size of #1868 is good, please refer to that as example. This pr is still too large and seems risky.

@narendasan
Copy link
Collaborator Author

narendasan commented May 8, 2023

It is not possible to further reduce the size of the PR without the build breaking (i.e. breaking main on merge) since by moving the convert_activation function a number of references must be updated. This constitute 90% of changes in this PR.

There are 3 major themes in this PR

  1. convert_activation is moved and references are updated
  2. an IR flag is added to prevent logging from being misleading (this change is backwards compatible and if split out will create a PR almost identical to this one)
  3. relu converter

You can move the relu change out but that is a trivial change and will not reduce the size of the PR significantly.

…ementation, example changes with ReLU

Signed-off-by: Naren Dasan <naren@narendasan.com>
Copy link

@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.

Code conforms to C++ style guidelines

Copy link

@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.

Code conforms to Python style guidelines

@narendasan
Copy link
Collaborator Author

@wushirong Can you review this PR. This is gating release of 1.4

Copy link
Contributor

@wushirong wushirong left a comment

Choose a reason for hiding this comment

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

LGTM

@narendasan narendasan merged commit b23c980 into main May 23, 2023
narendasan added a commit that referenced this pull request Jun 2, 2023
Signed-off-by: Naren Dasan <naren@narendasan.com>
narendasan added a commit that referenced this pull request Jun 3, 2023
Signed-off-by: Naren Dasan <naren@narendasan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants