onnx-mlir
onnx-mlir copied to clipboard
[DOC] Incorrect CMAKE instruction for multiple accelerators
Hello,
I tried to add an accelerator and add it to CMAKE following instructions in this doc page:
https://github.com/onnx/onnx-mlir/blob/5b1d90bbd566f7f46d34b0d156946f1d801f896b/docs/AddCustomAccelerators.md?plain=1#L17-L21
However, it appears it does not work. Using semicolon-separated elements works. For example:
$ cmake .. -DONNX_MLIR_ACCELERATORS=accel1;accel2
Is it a typo in the docs or am I doing something wrong?
@thegoldgoat You are right, it would be a typo. A list in cmake is semicolon-separated. Frankly, we haven't yet had chance to test multiple accelerators, your feedback is really helpful for us. Please feel free to create PRs to update the document. Thanks!
Another thing that should maybe be added: when adding a new accelerator you must define the following macros, even empty.
https://github.com/onnx/onnx-mlir/blob/ee7eaca5fc28586836d169b43ef9f8166ccece54/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.hpp#L20-L35
Then (for a lack of a better way?) include them here:
https://github.com/onnx/onnx-mlir/blob/ee7eaca5fc28586836d169b43ef9f8166ccece54/src/Accelerators/Accelerator.hpp#L26-L27
This detail should probably be added in "Code integration" in the document.
What do you think?
This detail should probably be added in "Code integration" in the document.
Yes, totally agreed. Thanks!