Skip to content
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

Merged
merged 6 commits into from
Aug 10, 2022
Merged

[TVMScript] Printer Registry #12237

merged 6 commits into from
Aug 10, 2022

Conversation

yelite
Copy link
Contributor

@yelite yelite commented Jul 29, 2022

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: #11912

cc @junrushao1994 @gbonik

@github-actions github-actions bot requested a review from junrushao July 29, 2022 19:49
@yelite yelite force-pushed the tunip-registry branch 3 times, most recently from 4c010ca to a472810 Compare August 5, 2022 04:54
@yelite yelite marked this pull request as ready for review August 5, 2022 04:55
yelite and others added 3 commits August 8, 2022 10:03
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
Copy link
Member

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

Copy link
Member

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?

Copy link
Contributor Author

@yelite yelite Aug 8, 2022

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)

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.

LGTM

@junrushao junrushao merged commit fae79bb into apache:main Aug 10, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
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>
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
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>
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.

3 participants