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

[DOC] Incorrect CMAKE instruction for multiple accelerators

Open thegoldgoat opened this issue 10 months ago • 3 comments

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 avatar Apr 11 '24 17:04 thegoldgoat

@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!

tungld avatar Apr 15 '24 01:04 tungld

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?

thegoldgoat avatar Apr 17 '24 09:04 thegoldgoat

This detail should probably be added in "Code integration" in the document.

Yes, totally agreed. Thanks!

tungld avatar Apr 17 '24 12:04 tungld