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

Refactor AutoTuner as Python module #2487

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eszpotanski
Copy link
Contributor

This PR changes the structure of AutoTuner, so it can be used as a Python module. It also move part of the code (not closely related to tuning) to separate utils file.

tools/AutoTuner/pyproject.toml Show resolved Hide resolved
tools/AutoTuner/src/autotuner/utils.py Outdated Show resolved Hide resolved
return config

def read_tune(this):
from ray import tune
Copy link
Contributor

Choose a reason for hiding this comment

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

ray.tune() is pretty much used in most of the parsing anyways. is it a big overhead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already prepared for #2428, so importing ray.tune is not required when using functions from utils.

As Python does not import modules more than once, this line introduces minimal overhead at most.

@@ -60,33 +53,20 @@ def test_algo_eval(self):
self.assertTrue(successful)


class ASAP7AlgoEvalSmokeTest(BaseAlgoEvalSmokeTest):
platform = "asap7"
Copy link
Contributor

Choose a reason for hiding this comment

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

noticed the removal of make_base() and test_*(). does the tests still run?

i am aware that the autotuner tests are disabled now, but just wanted to double check if tests can still trigger

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, tests still run, they were triggered in some previous CIs, eg. for GCD. I've just reduced code duplication by propagate these methods with inheritance

"License :: OSI Approved :: BSD 3-Clause",
]
readme = "README.md"
dependencies = [
Copy link
Contributor

Choose a reason for hiding this comment

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

potentially consider the separation of requirements and requirements-test

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
optional-dependencies = { dev = { file = ["requirements-test.txt"] } }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea, but are there any test-specific dependencies? From what I've saw only additional dependency in tests is unittest, which is Python built-in module.

Also, is there a specific reason to store dependencies in separate requirements files instead of pyproject.toml (which is default way I believe)?

Copy link
Contributor

@luarss luarss Nov 1, 2024

Choose a reason for hiding this comment

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

No particular reason. Just that we want to make it compatible with package locking in the future. (i.e. pip-compile/ poetry etc).

It might not be called requirements-test.txt but rather requirements-dev.txt, where we want to split out only the core minimal libraries for production vs for dev.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I moved dependencies to separate files - for now requirements-dev.txt have only black formatter.

Copy link
Contributor

@luarss luarss left a comment

Choose a reason for hiding this comment

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

Approval is pending smoke test re-enablement @vvbandeira fyi.

@eszpotanski No action needed for now, for this PR

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