[fx2trt] Add layernorm plugin for dynamic shape (#63620)
authorShiyan Deng <dsy842974287@fb.com>
Fri, 20 Aug 2021 17:49:21 +0000 (10:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 20 Aug 2021 17:52:42 +0000 (10:52 -0700)
commit03cc46a0acadcba618402a5b366f1d02bc3e21af
tree5af4e4e6a382a5a8c6b34d28e28976744ec53806
parent5f997a7d2fcd81584d1c9f6e173e30c867892ee8
[fx2trt] Add layernorm plugin for dynamic shape (#63620)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63620

Added layernorm dynamic plugin, so that it works when explicit batch dim is required. Needed for ig model.

Changed the way of how we creating a plugin layer from instantiating the plugin directly to use plugin creator with `PluginFieldCollection`.

Follow ups:
Another way to convert layernorm is by breaking it down to supported trt layers. T97398182

Test Plan: layernorm unittest

Reviewed By: yinghai

Differential Revision: D30138205

fbshipit-source-id: aebe021d8de818e20376634f30e84579b9807f9b
torch/fx/experimental/fx2trt/converters/acc_ops_converters.py