onnx-mlir icon indicating copy to clipboard operation
onnx-mlir copied to clipboard

Upgrade to ONNX opset-16

Open codemzs opened this issue 2 years ago • 10 comments

Hi All,

ONNX 1.11.0 was released recently, it has bf16 type supported added to some of the existing ops like Where, GreaterOrEqual, LessOrEqual. I was wondering if there is a plan to take a dependency on the latest ONNX release?

codemzs avatar Feb 25 '22 19:02 codemzs

@chentong319 @AlexandreEichenberger

codemzs avatar Feb 28 '22 21:02 codemzs

We plan to update to newer opset, it will take some time as sometime there are compatibility breaks with existing (aka older) ops

AlexandreEichenberger avatar Mar 07 '22 16:03 AlexandreEichenberger

Thanks @AlexandreEichenberger . Do you by chance know the timeline?

codemzs avatar Mar 07 '22 16:03 codemzs

I do not know at this time. Is it something that you or your org would be able to help? We need help from the community to make forward on multiple fronts: optimizations, new ops, and latest opset. It is a balancing act, and external involvements are taken into account for priorities.

AlexandreEichenberger avatar Mar 07 '22 18:03 AlexandreEichenberger

Our updating onnx was held off because an incoming release. I checked the changes in onnx and it seems that there are only a few changes affect us. There are several the new operations. Are they used in your models, @codemzs ?

chentong319 avatar Mar 09 '22 19:03 chentong319

@chentong319 It's the bfloat16 support that is added to existing operator that we really need (more than the new operators).

codemzs avatar Mar 14 '22 20:03 codemzs

@codemzs I saw that BF16 is already allowed for some ops in our current onnx dialect definition. BF16 are added for some ops, such as LeakyRelu, Scan, LessOrEqual and etc. Are you using these ops? I am working on upgrading onnx now. But for BF16, we ran into a llvm bug. See issue #1170.

chentong319 avatar Apr 20 '22 01:04 chentong319

I am moving to v1.11.0. The changes in operations w.r.t. to the version supported previously by onnx-mlir are:

Add has a newer version 14 over old version 13
BatchNormalization has a newer version 15 over old version 9
Bernoulli is new  with version 15
CastLike is new  with version 15
CumSum has a newer version 14 over old version 11
Div has a newer version 14 over old version 13
GRU has a newer version 14 over old version 7
GreaterOrEqual has a newer version 16 over old version 12
GridSample is new  with version 16
HardSwish is new  with version 14
Identity has a newer version 16 over old version 13
If has a newer version 16 over old version 13
LSTM has a newer version 14 over old version 7
LeakyRelu has a newer version 16 over old version 6
LessOrEqual has a newer version 16 over old version 12
Loop has a newer version 16 over old version 13
Mul has a newer version 14 over old version 13
Optional is new  with version 15
OptionalGetElement is new  with version 15
OptionalHasElement is new  with version 15
PRelu has a newer version 16 over old version 9
Pow has a newer version 15 over old version 13
RNN has a newer version 14 over old version 7
Relu has a newer version 14 over old version 13
Reshape has a newer version 14 over old version 13
RoiAlign has a newer version 16 over old version 10
Scan has a newer version 16 over old version 11
ScatterElements has a newer version 16 over old version 13
ScatterND has a newer version 16 over old version 13
Shape has a newer version 15 over old version 13
Sub has a newer version 14 over old version 13
Trilu is new  with version 14
Where has a newer version 16 over old version 9
TreeEnsembleClassifier has a newer version 3 over old version 1
TreeEnsembleRegressor has a newer version 3 over old version 1

chentong319 avatar Apr 20 '22 17:04 chentong319

Thanks for the responses @AlexandreEichenberger and @chentong319

I'm happy to continue the conversation in this issue.

I am working on moving the third_party/onnx to v1.11.0.

Upgrading to opset 14 wouldn't require bumping the third party version. I think the commit that we are pegged to at the moment actually goes all the way to opset 14. (v1.9.0).

I also imagine anything done (by me) specifically for 14 won't add any work for you, in the process of doing uplift to 16.

I want to make sure if I do anything in getting towards 14 doesn't add any work on your guys side.

philass avatar Apr 20 '22 23:04 philass

@philass I went over the changes in your PR #1373. Glad that you are working on new ops introduced in the recent releases. onnx-mlir uses onnx package not only for op generation, but also for test, conversion and other tools. It is better for us to keep up with onnx releases. That's why we are moving to v1.11.0. Could you wait for the PR #1371 and update the op version to its latest in one step(if there is difference)? In the meantime, you can work on the new operations.

chentong319 avatar Apr 21 '22 15:04 chentong319