Skip to content
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

[Marvell BYOC]: Marvell AI Accelerator Integration - Phase 1 #16570

Merged
merged 1 commit into from Feb 16, 2024

Conversation

f2013519
Copy link
Contributor

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.

@f2013519
Copy link
Contributor Author

cc @Hzfengsy @vinx13

Copy link
Member

@Hzfengsy Hzfengsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. BTW, as we are moving to TVM Unity / Relax, would be great if you could consider supporting MRVL for unity flow for emerging needs (e.g. LLMs)

@f2013519
Copy link
Contributor Author

LGTM. BTW, as we are moving to TVM Unity / Relax, would be great if you could consider supporting MRVL for unity flow for emerging needs (e.g. LLMs)

Thanks @Hzfengsy. We are closely following TVM Unity / Relax development and it is part of our future roadmap. We will work on it once we complete the initial Relay flow support.

@Hzfengsy Hzfengsy merged commit 5645c52 into apache:main Feb 16, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants