-
Notifications
You must be signed in to change notification settings - Fork 409
[Autotuner] Feature: add --cpu_budget and --timeout_per_trial
#2395
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
Draft
luarss
wants to merge
35
commits into
The-OpenROAD-Project:master
Choose a base branch
from
luarss:feat/autotuner-budget
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
cb3caa2
add initial scaffold
luarss 3cfffe3
fix args.job syntax error
luarss 1be04bf
add smoke test timeout
luarss 2a3ff66
consistent file names and fix smoke_test_sweep
luarss 7486249
move resources_per_trial to sweep_parser
luarss 5f46d5d
fix timeout test and add cpu_budget logic
luarss a86b771
add `--yes` to avoid prompt.
luarss e5c2e3e
add prototype for CPUBudgetSmokeTest
luarss 236b1b7
fix timeout
luarss b319e5e
reintroduce args.jobs, and recalculate timeouts accordingly
luarss a2dac19
test_trial_timeout -> test_timeout
luarss 3b358fb
fix cpu_budget default to be None and reduce timeout fail
luarss bc886f4
use cpu_budget default -1 to mean unlimited
luarss 6e96a64
fix smoke timeout
luarss c311101
fix test timeout by timeout check in subprocess.run, also fix typo in…
luarss 582fffe
add tooltip, update readmes
luarss 15e2a07
fix black
luarss 6e12df6
update test suite
luarss 6522488
add --yes flag
luarss f2b7883
do not exit code
luarss d05ea70
fixes to smoke_test_timeout
luarss 27b0a73
fix test_tune_resume
luarss 0468020
shorten timeout
luarss 220e641
fix subprocess invocation
luarss cd4455a
more generous timeout for resume check
luarss d5019d1
uniquify experiment dir
luarss 5e27fca
Fix experiment name checks
luarss 26ecb7c
cpubudget test fixes
luarss 4c61459
fix lint
luarss 81ad4e5
fix global args, restore ihp smoke test tune
luarss 6361372
remove cpubudget from sweep test
luarss a06b8ae
standardise cpubudget test
luarss cb0f283
standardise ref_file resume tests
luarss e841bbc
standardise and fix smoke_test_timeout
luarss 0693b7c
fix typo
luarss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import unittest | ||
| import subprocess | ||
| import os | ||
|
|
||
| cur_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
|
||
|
|
||
| class BaseCPUBudgetSmokeTest(unittest.TestCase): | ||
| platform = "" | ||
| design = "" | ||
|
|
||
| def setUp(self): | ||
| self.config = os.path.join( | ||
| cur_dir, | ||
| f"../../../flow/designs/{self.platform}/{self.design}/autotuner.json", | ||
| ) | ||
| self.experiment = f"smoke-test-cpubudget-{self.platform}" | ||
|
|
||
| # Tests should fail with such a low budget. | ||
| self.cpu_budget = 1 | ||
| self.expected_timeout = self.cpu_budget / os.cpu_count() * 3600 | ||
|
|
||
| self.command = ( | ||
| "python3 -m autotuner.distributed" | ||
| f" --design {self.design}" | ||
| f" --platform {self.platform}" | ||
| f" --experiment {self.experiment}" | ||
| f" --config {self.config}" | ||
| f" --cpu_budget {self.cpu_budget}" | ||
| f" --yes" | ||
| f" tune --samples 1" | ||
| ) | ||
| self.command = self.command.split() | ||
|
|
||
| def test_cpu_budget(self): | ||
| if not (self.platform and self.design): | ||
| raise unittest.SkipTest("Platform and design have to be defined") | ||
| try: | ||
| _ = subprocess.run( | ||
| self.command, | ||
| stderr=subprocess.PIPE, | ||
| timeout=self.expected_timeout, | ||
| ) | ||
| failed = False | ||
| except subprocess.TimeoutExpired: | ||
| failed = True | ||
| self.assertTrue(failed) | ||
|
|
||
|
|
||
| class asap7CPUBudgetSmokeTest(BaseCPUBudgetSmokeTest): | ||
| platform = "asap7" | ||
| design = "gcd" | ||
|
|
||
|
|
||
| class sky130hdCPUBudgetSmokeTest(BaseCPUBudgetSmokeTest): | ||
| platform = "sky130hd" | ||
| design = "gcd" | ||
|
|
||
|
|
||
| class ihpsg13g2CPUBudgetSmokeTest(BaseCPUBudgetSmokeTest): | ||
| platform = "ihp-sg13g2" | ||
| design = "gcd" | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.