Skip to content

Conversation

@cyx-6
Copy link
Contributor

@cyx-6 cyx-6 commented Feb 20, 2022

This PR introduces a function signature printer in the TypedPackedFunc part, so that the log information in detail::unpack_call will be more complete. This PR allows users to obatin the original function signature when the detail::unpack_call fails.

cc @areusch

@junrushao
Copy link
Member

@cyx-6 Would you mind if you could demonstrate what the new error messages look like?

@cyx-6
Copy link
Contributor Author

cyx-6 commented Feb 23, 2022

@junrushao1994 Sure. Here is an example for new error message:

TVMError: In function testadd(int, int) -> int: error while converting argument 0

If we wrongly call function testadd("a", 1), whose definition is
TVM_REGISTER_GLOBAL("testadd").set_body_typed([](int a, int b) -> int { return a + b; });

@junrushao
Copy link
Member

Thanks! Would it be clearer to also show the index like below?

testadd(0: int, 1: int) -> int

Thanks a lot!

@cyx-6
Copy link
Contributor Author

cyx-6 commented Feb 23, 2022

The code has been updated. It looks much clearer now.

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! LGTM

@junrushao junrushao merged commit 1cd42e8 into apache:main Feb 23, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
)

This PR introduces a function signature printer in the `TypedPackedFunc` part, so that the log information in `detail::unpack_call` will be more complete. This PR allows users to obatin the original function signature when the `detail::unpack_call` fails.
@cyx-6 cyx-6 changed the title [runtime] Improved log information with function signature [Runtime] Improved log information with function signature Aug 14, 2022
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