-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document supported ops #1475
Document supported ops #1475
Conversation
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
@chentong319 now using the version info from gen_onnx_mlir |
Signed-off-by: Alexandre Eichenberger <[email protected]>
@cjvolzka Please check if the output generated is ok by you. You can visualize this md file. docs/SupportedONNXOps-cpu.md |
At the beginning of this project, only a small portion of backend tests are supported. Therefore, we created a dictionary for enabled tests. Now it is the time to assume the default status of a test is enabled for static, dynamic and constant with every dimension ({-1:{-1}}). Then we can have a dictionary for test cases that can not enabled with the default value. An entry in the dictionary (for one test case) is also a dictionary with following possible entries:
Benefits:
Should we open a new PR after this PR is closed or merged? |
The development team has expressed interest in having the list of supported ops on the GitHub pages, so I think we should merge it in, then you can change the testing logic as you see fit and I will find a way to recreate the info, using either the same or slightly different annotations. |
Sure. I will review this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we in general put the update of the component of third_part in an independent PR?
utils/documentOps.py
Outdated
# | ||
################################################################################ | ||
# | ||
# This file convert .mlir from stdin into a FileCheck file format. It also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the header comment, which seems to be copied from mlir2FileCheck.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, sorry.
if arch != target_arch: | ||
continue | ||
# Scan op (op followed by any text). | ||
p = re.search(r'==OP==\s+(\w+)', l) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The op-set for an Op in ONNX dialect is determined by gen_mlir_onnx.py. If that op-set is not the version specified in the version of onnx we are using, the backend test always goes with the onnx. It is a little confusion to say which op-set we are supporting. Anyway, we should not need to specify op-set in the backend test. Let's fix it in future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a matter of fact, I removed the text after the ==OP== as you rightly suggested to use the gen_onnx_mlir.py info on the opsets.
utils/gen_onnx_mlir.py
Outdated
.format(schema.name)+ | ||
" has a newer version {} over old version {}" | ||
.format(schema.since_version, version_dict[schema.name][0])) | ||
if not list_only: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I miss some code? I did not see the extra work when list_only is true. I just wonder that you print out all the versions of an Op or just the top version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have given more input. The current gen_onnx_mlir.py --check-operation-version
gives additional output, which is disabled when list_only
is on. The reason I needed no additional output is that in the documentOps
, I run a subprocess that run gen_onnx_mlir.py --check-operation-version
which print a dictionary, which I then evaluate in the current python script to gather the proper info. I could not simply include that script as both scripts needs to parse distinct input arguments from the command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussions with @chentong319 , we are now using directly the gen_onnx_mlir version_dict directly. He also requested that we only report the largest opset (and not the list of opsets). All these changes have now been implemented.
Overall looks good. I think it'll be useful info to have but also for debugging. For example if a model doesn't work, it should be easy to reference what Ops are supported and then tell if you have an unsupported op. I do have a couple of small comments/questions related to the column headers:
|
Good suggestion. We will let our model importer read this table and generate error message when there is an unsupported Op in the model. |
Something I don't understand with the
Can you show me how to preserve the '13' for this PR? UPDATE: now implemented, all good. |
@cjvolzka Thanks for looking into the output.
Its the same as in the standard: it list the LAST opset that "improved" the given operation. So Add is in 16, but it was last modified in 14, so it list 14. I will give it an explanation. For loop, we support the "syntax" of 13, but only when the syntax satisfies some constraints, namely that of 9. |
Signed-off-by: Alexandre Eichenberger <[email protected]>
There is a version number for onnx. For example, we are using onnx.1.11.0. In one onnx version, ops may have different opset number, depending on whether the Op is modified or not. Sometimes the highest opset number in a version is used to denote that onnx version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Alexandre Eichenberger <[email protected]>
For the sake of expediency, this PR implement the right thing for the doc. Will tabulate larger changes for supporting opset to a later PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another try to approve
Whenever I submitted an approval, the approval was turned into a comment. Something wrong with my git account. I could not merge my own approved PR, either. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again!
Jenkins Linux s390x Build #6355 [push] Document supported ops (... started at 10:44 |
Jenkins Linux ppc64le Build #5477 [push] Document supported ops (... started at 10:46 |
Jenkins Linux amd64 Build #6339 [push] Document supported ops (... started at 09:44 |
Jenkins Linux amd64 Build #6339 [push] Document supported ops (... passed after 1 hr 8 min |
Jenkins Linux s390x Build #6355 [push] Document supported ops (... passed after 1 hr 19 min |
Jenkins Linux ppc64le Build #5477 [push] Document supported ops (... passed after 1 hr 41 min |
Add format to testing file to register our current support. Example of format:
Where this info will be scanned, parsed, and generate a md file listing our current support