Skip to content

Conversation

@Henryshsieh
Copy link
Contributor

@Henryshsieh Henryshsieh commented Jul 13, 2025

This PR includes two small fixes for the Relax NNAPI backend introduced in PR #17385:

  1. Fix a type mismatch in NNAPICompiler by casting tvm::ffi::Any to tvm::runtime::Module.
  2. Correct a mismatched annotation in the Relax IR used in test_mean.

Verified locally with successful compilation and test run.

Co-authored-by: HMZ mzhuang@pllab.cs.nthu.edu.tw

Henryshsieh and others added 2 commits July 13, 2025 16:14
This commit explicitly casts the `tvm::ffi::Any`
returned by `runtime.nnapi_runtime_create` to
`tvm::runtime::Module` before adding it to the
`Array<runtime::Module>` in response to the recent
FFI refactor (commit 2d964b4) that phased out the
legacy C API.

Co-authored-by: HMZ <mzhuang@pllab.cs.nthu.edu.tw>
This commit corrects the StructInfo annotation of the
tensor returned by `R.mean` from `(1, 10, 15)` to
`(1, 10, 1)` to match the actual output shape.

Co-authored-by: HMZ <mzhuang@pllab.cs.nthu.edu.tw>
@tqchen tqchen merged commit 11f0e42 into apache:main Jul 14, 2025
11 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
)

* [BugFix][NNAPI] Fix type mismatch in NNAPICompiler

This commit explicitly casts the `tvm::ffi::Any`
returned by `runtime.nnapi_runtime_create` to
`tvm::runtime::Module` before adding it to the
`Array<runtime::Module>` in response to the recent
FFI refactor (commit 2d964b4) that phased out the
legacy C API.

Co-authored-by: HMZ <mzhuang@pllab.cs.nthu.edu.tw>

* [BugFix][NNAPI] Fix annotation in test_mean

This commit corrects the StructInfo annotation of the
tensor returned by `R.mean` from `(1, 10, 15)` to
`(1, 10, 1)` to match the actual output shape.

Co-authored-by: HMZ <mzhuang@pllab.cs.nthu.edu.tw>

---------

Co-authored-by: HMZ <mzhuang@pllab.cs.nthu.edu.tw>
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.

2 participants