-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TVMScript] Printer Registry #12237
[TVMScript] Printer Registry #12237
Conversation
4c010ca
to
a472810
Compare
Co-authored-by: Junru Shao <jshao@octoml.ai> Co-authored-by: Greg Bonik <gbonik@octoml.ai>
const String& token, uint32_t type_index); | ||
void SetDispatchFunction(DispatchTable* dispatch_table, const String& token, uint32_t type_index, | ||
runtime::PackedFunc f); | ||
} // namespace dispatch_table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why we are having an extra namespace? If it's not for name conflict, let's manage to reduce the namespace nesting here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are used only in TracedObjectFunctor
, do you think we could move them to its static members?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the nested namespace. We can't move them to static members of TracedObjectFunction
, because it's a templated class. This will defeat the original purpose of separating those functions (reduce binary bloat and hide implementation detail from header)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR: - Adds the registry of printing function (traced_object_layered_functor.cc) Compared to the prototype version, this: - Consolidates the implementation into a single class, since this class is only for the TVMScript printer. - Deduces the TObjectRef when calling set_dispatch. Tracking issue: apache#11912 Co-authored-by: Greg Bonik <gbonik@octoml.ai>
This PR: - Adds the registry of printing function (traced_object_layered_functor.cc) Compared to the prototype version, this: - Consolidates the implementation into a single class, since this class is only for the TVMScript printer. - Deduces the TObjectRef when calling set_dispatch. Tracking issue: apache#11912 Co-authored-by: Greg Bonik <gbonik@octoml.ai>
This PR:
Compared to the prototype version, this:
Tracking issue: #11912
cc @junrushao1994 @gbonik