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

[AutoTVM] Introducing multi_filter into ConfigSpace autotvm #12545

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

Icemist
Copy link
Contributor

@Icemist Icemist commented Aug 22, 2022

multi_filter can restrict combination of parameters in difference to the knob filter, that restricts only single parameter.

Here is a small example to show the workflow and the difference:

Pre-requisites

candidates = [[16, 64], [32, 32], [64, 16]]
filter = lambda v: v.size[0] != 16
multi_filter = lambda e: (e["tile_x"].size[0] + e["tile_y"].size[0]) <= 64

Case 1 - without filtering

cfg.define_split("tile_x", x, num_outputs=2, policy="candidate", candidate=candidates)
cfg.define_split("tile_y", y, num_outputs=2, policy="candidate", candidate=candidates)

[('tile_x', [16, 64]), ('tile_y', [16, 64])],None,0
[('tile_x', [32, 32]), ('tile_y', [16, 64])],None,1
[('tile_x', [64, 16]), ('tile_y', [16, 64])],None,2
[('tile_x', [16, 64]), ('tile_y', [32, 32])],None,3
[('tile_x', [32, 32]), ('tile_y', [32, 32])],None,4
[('tile_x', [64, 16]), ('tile_y', [32, 32])],None,5
[('tile_x', [16, 64]), ('tile_y', [64, 16])],None,6
[('tile_x', [32, 32]), ('tile_y', [64, 16])],None,7
[('tile_x', [64, 16]), ('tile_y', [64, 16])],None,8

Case 2 - with filter

cfg.define_split("tile_x", x, num_outputs=2, policy="candidate", candidate=candidates, filter=filter)
cfg.define_split("tile_y", y, num_outputs=2, policy="candidate", candidate=candidates, filter=filter)

[('tile_x', [32, 32]), ('tile_y', [32, 32])],None,0
[('tile_x', [64, 16]), ('tile_y', [32, 32])],None,1
[('tile_x', [32, 32]), ('tile_y', [64, 16])],None,2
[('tile_x', [64, 16]), ('tile_y', [64, 16])],None,3

Case 3 - with filter and multi_filter

cfg.define_split("tile_x", x, num_outputs=2, policy="candidate", candidate=candidates, filter=filter)
cfg.define_split("tile_y", y, num_outputs=2, policy="candidate", candidate=candidates, filter=filter)
cfg.multi_filter(filter=multi_filter)

[('tile_x', [32, 32]), ('tile_y', [32, 32])],None,0

Co-authored-by: Andrey Malyshev elvin.nnov@gmail.com
Co-authored-by: Egor Churaev egor.churaev@gmail.com

@Icemist Icemist changed the title Introducing multi_filter into ConfigSpace autotvm. [AutoTVM] Introducing multi_filter into ConfigSpace autotvm. Aug 23, 2022
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch 2 times, most recently from 1585196 to 6578df8 Compare August 24, 2022 15:13
@Icemist
Copy link
Contributor Author

Icemist commented Aug 30, 2022

CC @merrymercy @eqy

@TejashShah
Copy link

cc @csullivan

@TejashShah
Copy link

cc @vinx13 @junrushao @masahi

Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

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

Quickly looked into this PR. I don't really like that now we need to call tsk.config_space.filtered_length instead of len(tsk.config_space). I think that len(smth) is more intuitive. But I didn't dive deeply into the details. I'll do it later. I think that @elvin-n can provide more useful and detailed review.

python/tvm/autotvm/task/space.py Outdated Show resolved Hide resolved
python/tvm/autotvm/task/space.py Outdated Show resolved Hide resolved
python/tvm/autotvm/tuner/ga_tuner.py Outdated Show resolved Hide resolved
python/tvm/topi/adreno/conv2d_nchw.py Outdated Show resolved Hide resolved
python/tvm/autotvm/task/space.py Show resolved Hide resolved
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch 2 times, most recently from 5da9a68 to 5b85a2d Compare September 11, 2022 04:45
@Icemist Icemist changed the title [AutoTVM] Introducing multi_filter into ConfigSpace autotvm. [AutoTVM] Introducing multi_filter into ConfigSpace autotvm Sep 11, 2022
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch 5 times, most recently from bb9c460 to c800055 Compare September 12, 2022 22:49
python/tvm/autotvm/task/space.py Outdated Show resolved Hide resolved
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch from c800055 to 011b59e Compare September 13, 2022 17:22
Co-authored-by: Andrey Malyshev elvin.nnov@gmail.com
Co-authored-by: Egor Churaev egor.churaev@gmail.com
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch from 011b59e to e88f350 Compare September 16, 2022 11:42
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch from e88f350 to 7c68a30 Compare September 16, 2022 13:21
@Icemist Icemist force-pushed the avoronov/multi_filter_finish branch from 7c68a30 to bbbed0f Compare September 16, 2022 13:44
@elvin-n
Copy link
Contributor

elvin-n commented Sep 16, 2022

@masahi @merrymercy could you please take a look?

@tmoreau89
Copy link
Contributor

CC @tqchen @merrymercy this PR makes some in depth changes to autoTVM, PTAL

@elvin-n
Copy link
Contributor

elvin-n commented Sep 22, 2022

can we merge this PR into main?

@masahi masahi merged commit fe75f00 into apache:main Sep 22, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…2545)

* [AutoTVM] Introducing multi_filter into ConfigSpace autotvm

Co-authored-by: Andrey Malyshev elvin.nnov@gmail.com
Co-authored-by: Egor Churaev egor.churaev@gmail.com

* update multi_filter for adreno conv's
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.

7 participants