[microNPU] Add support for TFLite concatenate#9589
Conversation
| ), | ||
| output_pointer, | ||
| replace_pointer, | ||
| is_allocator, |
There was a problem hiding this comment.
is_allocator is missing in the docstring.
| ), | ||
| output_pointer, | ||
| replace_pointer, | ||
| is_allocator, |
There was a problem hiding this comment.
is_allocator is missing in the docstring.
| None, | ||
| True, |
There was a problem hiding this comment.
The docstring for the last two return values is missing.
5c3d5c3 to
8aab6ff
Compare
|
@NicolaLancellotti thanks for the review! :) |
| concat_buffer = replace_info.buffer | ||
| new_indices = list(stmt.indices) | ||
| new_indices[replace_info.axis] += replace_info.offset | ||
| # DODGY STORE NODE |
There was a problem hiding this comment.
Maybe a comment would be good here to describe why?
There was a problem hiding this comment.
That comment is courtesy of @mbaret so I'm not exactly sure what makes this store node dodgy, but I updated that comment anyway :)
|
|
||
| def is_valid(self): | ||
| """Checks whether Concatenate has compatible attributes with the hardware""" | ||
| if not check_valid_dtypes(self.input_tensors, supported_dtypes=[np.int8]): |
There was a problem hiding this comment.
Is there any reason we can't support any other data type for concatenate?
There was a problem hiding this comment.
uint8 should be supported as well, but I didn't enable it since we don't test it... It would be trivial to enable it in the future if we need to support TFLite 1
There was a problem hiding this comment.
Make sense, thanks for clarifying :)
8aab6ff to
df852a7
Compare
manupak
left a comment
There was a problem hiding this comment.
LGTM!
Seems not a trivial implementation. :). Lets do a rebase -- so that we could get this in...
| ) | ||
|
|
||
| # Assumes only two runtime.Modules are created -- i.e. single offload module | ||
| imported_modules = compiled_models[0].executor_factory.lib.imported_modules |
There was a problem hiding this comment.
I think this needs changing after target hooks but you ll find it anyway after a rebase :)
There was a problem hiding this comment.
I have resolved all the conflicts (for now) and all the tests pass (except the mean tests which we will fix)!
539e21c to
1f779ce
Compare
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
Change-Id: Ifddd103ba2aed5aa37200e66040cc6f5ad3cf9bb
1f779ce to
7fc9668
Compare
|
Thanks! @ekalda @lhutton1 @NicolaLancellotti @mbaret . This is merged now! |
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
* Add legalization pass and is_valid checks for concatenate * Add TIR pass for removing concatenates and replacing them with direct writes to the final buffer * Add tests Co-authored-by: Matthew Barrett <Matthew.Barrett@arm.com>
writes to the final buffer
Co-authored-by: Matthew Barrett Matthew.Barrett@arm.com