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

[USMP] Hill Climb allocator #9704

Merged
merged 5 commits into from
Jan 14, 2022
Merged

[USMP] Hill Climb allocator #9704

merged 5 commits into from
Jan 14, 2022

Conversation

d-smirnov
Copy link
Contributor

This PR adds HillClimb allocator "tir.usmp.algo.hill_climb"
to memory allocation algorithm set

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Thanks @d-smirnov.

I did a pass.

Most of my comments are on cleaning up the code, improving clarity and possibly re-using the code rather than duplicating it here.

See if you agree.

src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
tests/python/unittest/test_tir_usmp_algo_hill_climb.py Outdated Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Outdated Show resolved Hide resolved
@manupak
Copy link
Contributor

manupak commented Dec 14, 2021

Should we merge the testing here into https://github.com/apache/tvm/blob/af869bc79cecdc18371862524ea241803dc78c7a/tests/python/unittest/test_tir_usmp_algo.py ?

By doing so, we could improve the current testing scope to consider hill climbing allocation while augmenting the tests here to run other algorithms as well, because the tests here seems not special just only to hill climbing algorithm.

This PR adds HillClimb allocator "tir.usmp.algo.hill_climb"
to the memory allocation algorithm set.

Change-Id: Ib7485df93757eb512da040528ec86c920db8d03b
Change-Id: I6700a24c1608d92f87be7dde33cc24f5de1f7063
Change-Id: I0dac5c6d75ade8f813b077c8708aad59d2722933
Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Looking good now... Thanks @d-smirnov

Some early feedback for the header file creation.

It is better if we can enable hill climb in other tests in test_tir_usmp_algo.py as well.

src/tir/usmp/algo/greedy.cc Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Show resolved Hide resolved
src/tir/usmp/algo/hill_climb.cc Show resolved Hide resolved
Change-Id: If8ed159eceef32d3f22b51e0252161d09222eb1e
Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Hi @d-smirnov,

Thanks for working with me on this. This looks good now!
One last request is to enable hill_climb in the tests in test_tir_usmp_algo.py that are parameterized on greedy algorithm. Would we able to do that ?

e.g. :

@pytest.mark.parametrize("algorithm", ["greedy_by_size", "greedy_by_conflicts"])
def test_name_based_ordering(algorithm):

Also, lets just re-trigger the CI once more since this is 19 days old.

Added "hill_climb" into test_tir_usmp_algo.py
Amended sorting to be consistent with "greedy" family

Change-Id: I8e9f5282f15baaab71d6d129aeb9643376b14763
Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @d-smirnov

@manupak manupak merged commit 89ae603 into apache:main Jan 14, 2022
crazydemo pushed a commit to crazydemo/tvm that referenced this pull request Jan 27, 2022
* [USMP] Hill Climb allocator

This PR adds HillClimb allocator "tir.usmp.algo.hill_climb"
to the memory allocation algorithm set.

Change-Id: Ib7485df93757eb512da040528ec86c920db8d03b

* requested changes

Change-Id: I6700a24c1608d92f87be7dde33cc24f5de1f7063

* Conda-related linter small fixes

Change-Id: I0dac5c6d75ade8f813b077c8708aad59d2722933

* Moved implementation from greedy.h to greedy.cc

Change-Id: If8ed159eceef32d3f22b51e0252161d09222eb1e

* Integrated into test_tir_usmp_algo.py unit test

Added "hill_climb" into test_tir_usmp_algo.py
Amended sorting to be consistent with "greedy" family

Change-Id: I8e9f5282f15baaab71d6d129aeb9643376b14763
Raghav-Chakravarthy pushed a commit to Raghav-Chakravarthy/tvm that referenced this pull request Jan 28, 2022
* [USMP] Hill Climb allocator

This PR adds HillClimb allocator "tir.usmp.algo.hill_climb"
to the memory allocation algorithm set.

Change-Id: Ib7485df93757eb512da040528ec86c920db8d03b

* requested changes

Change-Id: I6700a24c1608d92f87be7dde33cc24f5de1f7063

* Conda-related linter small fixes

Change-Id: I0dac5c6d75ade8f813b077c8708aad59d2722933

* Moved implementation from greedy.h to greedy.cc

Change-Id: If8ed159eceef32d3f22b51e0252161d09222eb1e

* Integrated into test_tir_usmp_algo.py unit test

Added "hill_climb" into test_tir_usmp_algo.py
Amended sorting to be consistent with "greedy" family

Change-Id: I8e9f5282f15baaab71d6d129aeb9643376b14763
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* [USMP] Hill Climb allocator

This PR adds HillClimb allocator "tir.usmp.algo.hill_climb"
to the memory allocation algorithm set.

Change-Id: Ib7485df93757eb512da040528ec86c920db8d03b

* requested changes

Change-Id: I6700a24c1608d92f87be7dde33cc24f5de1f7063

* Conda-related linter small fixes

Change-Id: I0dac5c6d75ade8f813b077c8708aad59d2722933

* Moved implementation from greedy.h to greedy.cc

Change-Id: If8ed159eceef32d3f22b51e0252161d09222eb1e

* Integrated into test_tir_usmp_algo.py unit test

Added "hill_climb" into test_tir_usmp_algo.py
Amended sorting to be consistent with "greedy" family

Change-Id: I8e9f5282f15baaab71d6d129aeb9643376b14763
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