[Marvell BYOC]: Marvell AI Accelerator Integration - Phase 1 #16570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for partitioning and compiling the Marvell BYOC target along with initial integration with tvmc. Support for the runtime (simulator based & hardware) and other features (int8) will be added in phases as described in the pre-RFC post: https://discuss.tvm.apache.org/t/prerfc-byoc-integrating-marvell-ml-ai-accelerator-to-the-tvm-byoc-framework/16155.
Please see the pre-RFC for a detailed description of the design and roadmap going forward.
Building
We have introduced a new cmake flag:
USE_MRVL=ON/OFF
This flag enables Marvell BYOC codegen and is required for using the Marvell BYOC functionality, running unit tests, etc.
Usage
The tvmc interface for Marvell BYOC will be similar to other composite targets.
The below command is an example of cross-compilation of an ONNX model for an Octeon target.
python3 -m tvm.driver.tvmc compile
--target="mrvl, llvm"
--target-llvm-mtriple=aarch64-linux-gnu
--target-llvm-mcpu=neoverse-n2
--target-mrvl-num_tiles=4
--cross-compiler aarch64-linux-gnu-gcc
--output model.tar
model.onnx
Supported operators will be partitioned and compiled for the MLIP and the remaining operators will be compiled for the ARM Neoverse cores using the default LLVM target.
TVM Python API based compilation is also supported, please refer to the doc added as part of this PR for details.