Skip to content

fix: Move all aten PRs to Dynamo converter registry #2070

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

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Jun 30, 2023

Description

The below are now squashed

The structure of this PR is as follows:

  • The first commit is a squashed set of 16 PRs which add aten improvements and converters, from existing PRs with the label Story: ATen Op Support
  • The second commit reverts all of the changes to py/torch_tensorrt/fx
  • The third commit contains all of the changes made to py/torch_tensorrt/fx, replayed on py/torch_tensorrt/dynamo, with required import, reference, and code updates. This sometimes includes code duplication where absolutely necessary to add some new functionality
  • Subsequent commits add various improvements or modifications to these converters

Fixes #2068

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

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

@gs-olive gs-olive added Story: ATen Op Support component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Jun 30, 2023
@gs-olive gs-olive requested a review from apbose June 30, 2023 01:14
@gs-olive gs-olive self-assigned this Jun 30, 2023
@github-actions github-actions bot added the component: api [Python] Issues re: Python API label Jun 30, 2023
@github-actions github-actions bot requested a review from narendasan June 30, 2023 01:14
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

@gs-olive gs-olive added the WIP Work is in progress, pull request should not be merged yet label Jun 30, 2023
@gs-olive gs-olive marked this pull request as ready for review June 30, 2023 03:47
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

@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

}
rounding_mode = kwargs.get("rounding_mode")
if rounding_mode is None:
return acc_ops_converters.acc_ops_div(network, target, None, kwargs_new, name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we calling out to acc_ops here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since there was a change to this operator in the trunc_div PR #1869, we need to copy the entire converter to ensure the changes are reflected

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

Base automatically changed from dynamo_compile_64bit_support to main July 24, 2023 21:41
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

@gs-olive gs-olive removed the WIP Work is in progress, pull request should not be merged yet label Jul 25, 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

@gs-olive gs-olive requested a review from narendasan July 25, 2023 18:09
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

refactor: Moving elementwise and unary core to impl

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

	new file:   ../converters/impl/unary/base.py

Moving elementwise core to impl - rsqrt (FX Converter Refactor [9/N]) <Target: converter_reorg_elementwise> (#1905)

Converter reorg fmod

Converter reorg and rsub

Rsub error fixes and linting error fixed

Rsub test case to include different inputs

Converter reorg batch norm

batch norm error fix and linting issue error fix

layer_norm converter

Layer norm linting correction

ops file correction

fixing lint

Acc_ops layer_norm correction

Converter reorg and softmax operation

softmax linting error fix

Converter reorg and gelu

Linting error

Converter reorg and squeeze operator

Correcting squeeze operator implementation, linting error and acc squeeze test

Adding the condition to convert dim to int and removing the comment

Converter reorg and select operation

select operation correction and linting changes

converter reorg and slice

converter reorg slice op

Correcting linting error and slice changes

Correcting the slice operation

converter reorg and matmul

Matmul issue fixes and lint error check

moving matmul to individual file

Converter reorg and where operator

adding where aten op

aten::where correction and linting error changes

aten::unsqueeze impl refactor

Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>

Moved clamp to impl

Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>

fixed method name

Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>

fix: Add automatic type promotion for FX ops

- Implement functionality to cast tensors to alternative types
- Add functionality to elementwise ops to promote types and perform
necessary casts
- Address issues in FX ops where mixed-precision computations can
cause errors
- Add test cases to validate fix

Revert all changes to py/torch_tensorrt/fx

Revert "fix: Add automatic type promotion for FX ops"

This reverts commit f1f3716.

Revert "Moved clamp to impl"

This reverts commit df401dd.

Revert "aten::unsqueeze impl refactor"

This reverts commit b424735.

Revert "Converter reorg and where operator"

This reverts commit b4da15e.

Revert "converter reorg and matmul"

This reverts commit 7551eee.

Revert "converter reorg and slice"

This reverts commit 9bbdc9e.

Revert "Converter reorg and select operation"

This reverts commit fb70253.

Revert "Converter reorg and squeeze operator"

This reverts commit 294545c.

Revert "Converter reorg and gelu"

This reverts commit 37d1168.

Revert "Converter reorg and softmax operation"

This reverts commit 1ba6d13.

Revert "layer_norm converter"

This reverts commit e0b34b1.

Revert "Converter reorg batch norm"

This reverts commit 59354e5.

Revert "Converter reorg and rsub"

This reverts commit db15d27.

Revert "Converter reorg fmod"

This reverts commit ce3fa67.

Revert "Moving elementwise core to impl - rsqrt (FX Converter Refactor [9/N]) <Target: converter_reorg_elementwise> (#1905)"

This reverts commit 7158ca5.

Revert "refactor: Moving elementwise and unary core to impl"

This reverts commit 45e43ca.

fix: Replay all FX changes in Dynamo

- Add multiple fixes to make FX changes appear in Dynamo directory,
using Dynamo registry
- All converters with open PRs are linked and shown
- Update references, imports, code, merges, rebases accordingly
- Add new test cases to Dynamo for converters

Temporarily removing rsub pending fix

Fixing clamp to not use Torch

Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>

Fixing select to not use torch

fix: Reorganize folders in latest implementation

- Update test references and imports accordingly

Embedding operator in dynamo

reciprocal lowering pass

fix: Fix for Dynamic Shape Tests + Input class

feat: Add permute operation implementation

chore: Move converter registry, update imports
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
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: fx component: tests Issues re: Tests Story: ATen Op Support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add all open aten converter PRs to new branch
5 participants