Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions transformer_engine/pytorch/module/layernorm_mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2243,14 +2243,23 @@ def onnx_forward(

assert not TEDebugState.debug_enabled, "Debug mode is not supported in ONNX export"
assert_warmed_up(self)

# Get quantizers
(
fc1_input_quantizer,
fc1_weight_quantizer,
_,
_,
_,
_,
fc2_input_quantizer,
fc2_weight_quantizer,
output_quantizer,
*_,
fc2_output_quantizer,
_,
_,
_,
) = self._get_quantizers(False, is_grad_enabled)

inp_dtype = inp.dtype

fc1_weight, fc2_weight = self._get_weight_tensors()
Expand Down Expand Up @@ -2324,7 +2333,7 @@ def _clamped_swiglu(x, limit, alpha):

fc2_out = onnx_gemm(fc2_weight, act_out, fc2_bias)

if output_quantizer is not None:
if fc2_output_quantizer is not None:
raise NotImplementedError("ONNX export of quantized output is not supported")

if self.return_layernorm_output:
Expand Down