Skip to content

Commit cdd9f56

Browse files
committed
Add documentation on how to add ops from not-builtin domains
Signed-off-by: Rickert, Jonas <[email protected]>
1 parent 2be7757 commit cdd9f56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/ImportONNXDefs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,9 @@ necessary.
155155
It is not always needed to keep the code for an older version, which may be rewritten into the new
156156
operation. Thus, we just need to have the dialect definition, but not the code for inference or
157157
lowering.
158+
159+
# Adding Operations from not-builtin domains
160+
To add an operation from a not-builtin domain, it needs to be added to the `additional_op_version_dict` in gen_onnx_mlir.py. The key is the domain name and the value is the per-operation version dictionary.
161+
The new domain also needs to be added to the `domain_abrv_dict` in gen_onnx_mlir.py. The key is the domain name and the value is the abbreviation/prefix used in ONNX-MLIR for this domain.
162+
For operations from not-builtin domains, the operation definition specification needs to be manually provided.
163+
This can be done via custom TableGen records for the operations. See [/src/Dialect/ONNX/AdditionalONNXOps.td](../src/Dialect/ONNX/AdditionalONNXOps.td) for examples.

0 commit comments

Comments
 (0)