Skip to content

[Runtime] Improved log information with function signature#10326

Merged
junrushao merged 6 commits into
apache:mainfrom
cyx-6:PackedFuncSigHelper
Feb 23, 2022
Merged

[Runtime] Improved log information with function signature#10326
junrushao merged 6 commits into
apache:mainfrom
cyx-6:PackedFuncSigHelper

Conversation

@cyx-6

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

Copy link
Copy Markdown
Contributor

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

Comment thread include/tvm/runtime/packed_func.h
@junrushao

Copy link
Copy Markdown
Member

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

@cyx-6

cyx-6 commented Feb 23, 2022

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

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

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

Thanks a lot!

@cyx-6

cyx-6 commented Feb 23, 2022

Copy link
Copy Markdown
Contributor Author

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

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

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