MS-AMP
MS-AMP copied to clipboard
how can i export the model from pytorch to onnx?
I have try your example, however when I try to export the model to onnx, it's error。
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.