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

Add generate-pgo stub #26384

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tools/perf/components/common_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class PerfMode(Enum):
COMPARE = 2
UPDATE_PROFILE = 3
RECORD_WPR = 4
GENERATE_PGO = 5

class CommonOptions:
mode: PerfMode = PerfMode.RUN
Expand Down Expand Up @@ -73,7 +74,9 @@ def add_parser_args(cls, parser: argparse.ArgumentParser) -> None:
parser.add_argument(
'--mode',
type=str,
choices=['run', 'compare', 'update-profile', 'record-wpr'],
choices=[
'run', 'compare', 'update-profile', 'record-wpr', 'generate-pgo'
],
help='The operating mode.' +
'"run" is run the tests and report to the backend (the default).' +
'"compare" is evaluate a few configurations with a local HTML output.' +
Expand Down Expand Up @@ -162,6 +165,8 @@ def from_args(cls, args) -> 'CommonOptions':
options.mode = PerfMode.UPDATE_PROFILE
elif args.mode == 'record-wpr':
options.mode = PerfMode.RECORD_WPR
elif args.mode == 'generate-pgo':
options.mode = PerfMode.GENERATE_PGO

options.verbose = args.verbose
options.ci_mode = args.ci_mode
Expand Down
26 changes: 26 additions & 0 deletions tools/perf/configs/pgo/win-x64.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"configurations": [{
"dashboard-bot-name": "test-agent",
"browser-type": "brave",
"profile": "brave-typical-win",
"extra-browser-args": [
"--disable-features=CalculateNativeWinOcclusion",
],
"extra-benchmark-args": [
"--also-run-disabled-tests"
],
"save-artifacts": true,
}],
"benchmarks": [
{
"name": "system_health.common_desktop",
"pageset-repeat": 1,
"stories": [
"load:site:example:2023",
]
},
{
"name": "speedometer3",
},
]
}
4 changes: 3 additions & 1 deletion tools/perf/run_perftests.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main():
android_tools.RebootAndroid()
android_tools.SetupAndroidDevice()

if options.mode == PerfMode.RUN:
if options.mode == PerfMode.RUN or options.mode == PerfMode.GENERATE_PGO:
if len(config.runners) != 1:
raise RuntimeError('Only one configuration should be specified.')

Expand All @@ -152,6 +152,8 @@ def main():
if options.mode == PerfMode.RECORD_WPR:
return 0 if wpr_utils.record_wpr(config, options) else 1

# if options.mode == PerfMode.GENERATE_PGO:
# return 0 # TODO
raise RuntimeError('Unknown mode')

if __name__ == '__main__':
Expand Down
Loading