Skip to content

Conversation

@zxybazh
Copy link
Member

@zxybazh zxybazh commented Sep 15, 2022

This PR introduces a clone function for each of the task-level MetaSchedule classes for convenient class deep copying.
Th reason we want to introduce the clone function is for convenient generation of tasks, i.e., instead of creating a class generation lambda function in tuning api we can supply some example classes, i.e., ScheduleRule and clone them. In most cases the tasks share the same type of the classes except IRModule, yet we allow customization of the classes.

  • ScheduleRule
  • Postproc
  • Mutator
  • SpaceGenerator
  • SearchStrategy
  • TuneContext

cc @Hzfengsy @junrushao1994

@zxybazh zxybazh marked this pull request as ready for review September 16, 2022 01:04
@Hzfengsy
Copy link
Member

Could you please explain a bit about why we need clone these structures?

Cloning a function or a module makes sense to me. But I'm not sure why we need to clone a rule or a mutator.

Could you please also add more information to the PR description? Thanks

@junrushao
Copy link
Member

This is used for enhancing UX of the tuning. Considering the current tune API:

sch_rules=lambda: sch_rules,
postprocs=lambda: postprocs,

where users have to provide a lambda function, has become a bit confusing and inconvenient, we want to make it possible for users to directly provide a single object, and our system takes care of cloning

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.

Overall LGTM! BTW, please address my comments in a separate PR

@junrushao junrushao merged commit 02c2eae into apache:main Sep 16, 2022
@github-actions github-actions bot requested a review from Hzfengsy September 16, 2022 05:14
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…2796)

This PR introduces a clone function for each of the task-level MetaSchedule classes for convenient class deep copying.

- [x] ScheduleRule
- [x] Postproc
- [x] Mutator
- [x] SpaceGenerator
- [x] SearchStrategy
- [x] TuneContext
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