SIGN IN SIGN UP

Add pattern + replacement for Embedding with padding_idx

Summary:
This diff adds a pattern/replacement for embedding with padding_idx, which causes embedding in the NLU model to be quantized successfully.

Previously, the embedding op in the NLU model was not being quantized. This was happening because embedding in NLU includes an extra arg, padding_idx, which was not expected by the pattern used to match embedding ops for replacement in model graphs.

This change also reduces the size of the NLU model from 11.4 MB to 4.4 MB since embedding weight tensors are stored in quantized form instead of fp32.

Reviewed By: digantdesai, mcr229

Differential Revision: D48191947

fbshipit-source-id: 47283aa8c4990325238c362d130d7e2d141fcf0f
S
Salil Desai committed
e023d8f43a6b47ea286eb5a83655d3f55500c9d9
Parent: 0b317e5
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/11/2023, 7:42:27 PM