[1/3][AOT][DeviceAPI] Connecting devices structure to relevant operators#9395
Merged
areusch merged 2 commits intoapache:mainfrom Nov 12, 2021
Merged
[1/3][AOT][DeviceAPI] Connecting devices structure to relevant operators#9395areusch merged 2 commits intoapache:mainfrom
areusch merged 2 commits intoapache:mainfrom
Conversation
Member
Author
|
@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
areusch
reviewed
Nov 9, 2021
45f05d6 to
442ab30
Compare
mbs-octoml
suggested changes
Nov 10, 2021
Contributor
mbs-octoml
left a comment
There was a problem hiding this comment.
A personal appeal from Mark not to add more to te_compiler.cc
:-)
Contributor
|
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
areusch
approved these changes
Nov 12, 2021
Contributor
|
thanks @Mousius @mbs-octoml the PR is now merged! |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Dec 1, 2021
…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>
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Dec 1, 2021
…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>
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
…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>
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 11, 2022
…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>
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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