-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[1/3][AOT][DeviceAPI] Connecting devices structure to relevant operators #9395
Conversation
@areusch I've done the bare minimum to wire this through here, and want to follow up later with the |
4198fb6
to
9959a13
Compare
f76040d
to
90dbe95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mousius thanks for this. just a couple comments here
45f05d6
to
442ab30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A personal appeal from Mark not to add more to te_compiler.cc
:-)
LGTM from me. |
78bffcc
to
21c2832
Compare
This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com>
f63a0c8
to
4cea8a4
Compare
thanks @Mousius @mbs-octoml the PR is now merged! |
…ors (apache#9395) * [AOT][DeviceAPI] Connecting devices structure to relevant operators This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com> * Correct "use_device_api" attribute name on Target Co-authored-by: Grant Watson <grant.watson@arm.com>
…ors (apache#9395) * [AOT][DeviceAPI] Connecting devices structure to relevant operators This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com> * Correct "use_device_api" attribute name on Target Co-authored-by: Grant Watson <grant.watson@arm.com>
…ors (apache#9395) * [AOT][DeviceAPI] Connecting devices structure to relevant operators This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com> * Correct "use_device_api" attribute name on Target Co-authored-by: Grant Watson <grant.watson@arm.com>
…ors (apache#9395) * [AOT][DeviceAPI] Connecting devices structure to relevant operators This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com> * Correct "use_device_api" attribute name on Target Co-authored-by: Grant Watson <grant.watson@arm.com>
…ors (apache#9395) * [AOT][DeviceAPI] Connecting devices structure to relevant operators This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary: ```c /*! * \brief Device context pointers for TVM module "default" */ struct tvmgen_default_devices { void* npu; }; ``` Which is then added as an argument to the entry function: ```c /*! * \brief entrypoint function for TVM module "default" * \param inputs Input tensors for the module * \param outputs Output tensors for the module * \param devices Device context pointers for the module */ int32_t tvmgen_default_run( struct tvmgen_default_inputs* inputs, struct tvmgen_default_outputs* outputs, struct tvmgen_default_devices* devices ); ``` I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions. Co-authored-by: Grant Watson <grant.watson@arm.com> * Correct "use_device_api" attribute name on Target Co-authored-by: Grant Watson <grant.watson@arm.com>
This patch adds support for passing the device context via the unpacked API in AOT, generating an additional struct if necessary:
Which is then added as an argument to the entry function:
I've temporarily added the collection of external code generators to the TE compiler pending proper annotation of the eventual functions.
Co-authored-by: Grant Watson grant.watson@arm.com