Fix function number datatype from char to uint16_t - #11365
Merged
Conversation
rewrite the modified part to pass lint check Use 2 bytes for func num in fun_registry Fix errors in linter Add the declaration of the helper functions set 2 bytes for func num in func_registry test units pass num_func by value This commit change the datatype of the number of the function from 1 Byte to 2 Bytes. Besides, I use some helper functions to access the number of function and the first function name.
driazati
approved these changes
May 18, 2022
alanmacd
reviewed
May 18, 2022
|
|
||
| static const TVMFuncRegistry aot_executor_registry = { | ||
| "\x0aget_input\0" | ||
| "\x0a\0get_input\0" |
Contributor
There was a problem hiding this comment.
Do you need to update src/runtime/crt/graph_executor_module/graph_executor_module.c too?
Contributor
There was a problem hiding this comment.
Sorry, I think that I forget to update src/runtime/crt/graph_executor_module/graph_executor_module.c in #10014.
Contributor
Contributor
There was a problem hiding this comment.
I think this line in python/tvm/micro/func_registry.py can be replaced with the following lines.
import struct
encoded_NumFuncs = [f"\\{v:03o}" for v in struct.pack("H", len(funcs))]
encoded_funcs = "".join(encoded_NumFuncs) + "\\0".join(funcs)
Contributor
Author
There was a problem hiding this comment.
@A1245967 that's a good point. I actually looked at this further and I don't see this function called. I think this approach was from before we emitted the FuncRegistry in codegen. I just went ahead and deleted that file.
* No longer needed and not called anywhere. * Superseded by emitting the FuncRegistry directly in codegen.
alanmacd
approved these changes
May 19, 2022
masahi
approved these changes
May 20, 2022
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 a re-submit of #10014 with a CI fix.
cc @A1245967 @driazati