Skip to content

Use the PyTorch BatchNorm folding instead of a handwritten converter when possible #31

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

Closed
narendasan opened this issue Apr 1, 2020 · 1 comment
Labels
component: lowering Issues re: The lowering / preprocessing passes feature request New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority: high
Milestone

Comments

@narendasan
Copy link
Collaborator

We currently use a handwritten converter for batch norm which fuses the operations into a single convolution. It would be easier to use the _jit_pass_fold_convbn pass in lowering instead where we can.

@narendasan narendasan added feature request New feature or request good first issue Good for newcomers component: lowering Issues re: The lowering / preprocessing passes priority: high help wanted Extra attention is needed labels Apr 1, 2020
@narendasan narendasan added this to the v0.0.2 milestone Apr 1, 2020
@narendasan
Copy link
Collaborator Author

pytorch/pytorch#34835

frank-wei pushed a commit that referenced this issue Jun 4, 2022
Summary:
Pull Request resolved: https://github.com/pytorch/fx2trt/pull/31

1. acc_ops
    a. 'call_method' `torch.Tensor.expand` will map to `acc_op.expand`
    b. 'call_method' `torch.Tensor.expand_as` will map to `acc_op.expand`
2. shape inference will run for `acc_op.expand`
3. acc_normalizer will map `acc_op.expand` to `acc_op.tile` using the required shape information

Reviewed By: 842974287

Differential Revision: D34565863

fbshipit-source-id: ad94694e548f5b03af9cf3ef8e7c35e236bb0745
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: lowering Issues re: The lowering / preprocessing passes feature request New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority: high
Projects
None yet
Development

No branches or pull requests

1 participant