MS-AMP icon indicating copy to clipboard operation
MS-AMP copied to clipboard

how can i export the model from pytorch to onnx?

Open 221588 opened this issue 11 months ago • 1 comments

I have try your example, however when I try to export the model to onnx, it's error。

221588 avatar Mar 19 '24 06:03 221588

Thanks for your attention to our work! You can replace FP8Linear with torch.nn.Linear, where the weight and bias with ScalingTensor can be converted to torch.float32 by 'weight = weight.float(), bias = bias.float()'. Then the FP32 model can be converted to onnx.

wkcn avatar Mar 20 '24 00:03 wkcn