onnx / onnx-mlir

Representation and Reference Lowering of ONNX Models in MLIR Compiler Infrastructure
Apache License 2.0
770 stars 321 forks source link

Fix GroupNorm to support Opset21 #2928

Closed hamptonm1 closed 2 months ago

hamptonm1 commented 2 months ago

Updating GroupNorm to create a bias tensor and scale tensor using (C) Channel instead of (G) numGroups. The previous understanding was incorrect, I changed the code to reflect the updates made in ONNX.

Right now I included support for Opset18 as well as Opset21.

Here is more information on why the changes were made: https://github.com/onnx/onnx/issues/5466

hamptonm1 commented 2 months ago

@jenkins-droid test this please

hamptonm1 commented 2 months ago

@AlexandreEichenberger @chentong319 Okay, I took the feedback from you both and made some changes. Let me know what else needs to be fixed and if I got the reshape forbiasScaleShape correct. The backend tests for GroupNormalization Passes and I added two new lit tests for Opset21.

hamptonm1 commented 2 months ago

FYI- @Sunny-Anand

jenkins-droid commented 2 months ago

Jenkins Linux s390x Build #15627 [push] Fix GroupNorm to support... started at 16:50

jenkins-droid commented 2 months ago

Jenkins Linux amd64 Build #15624 [push] Fix GroupNorm to support... started at 15:50

jenkins-droid commented 2 months ago

Jenkins Linux ppc64le Build #14654 [push] Fix GroupNorm to support... started at 17:01

jenkins-droid commented 2 months ago

Jenkins Linux amd64 Build #15624 [push] Fix GroupNorm to support... passed after 1 hr 8 min

jenkins-droid commented 2 months ago

Jenkins Linux s390x Build #15627 [push] Fix GroupNorm to support... passed after 1 hr 29 min

jenkins-droid commented 2 months ago

Jenkins Linux ppc64le Build #14654 [push] Fix GroupNorm to support... passed after 2 hr 1 min