Skip to content

Commit

Permalink
Add support for specifying "experiment name". (#3489)
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet authored Nov 15, 2023
1 parent 1204951 commit 2525ba2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/ci_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ def add_arguments(parser: ArgumentParser) -> ArgumentParser:
action='store_const',
const='nor2r'
)
parser.add_argument(
'--experiment-name',
dest='experiment_name',
required=False,
type=str
)
parser.add_argument(
'--branch',
dest='branch',
Expand Down Expand Up @@ -303,7 +309,8 @@ def __init__(
run_env_vars: Optional[List[str]] = None,
target_windows: bool = True,
physical_promotion_status: Optional[str] = None,
r2r_status: Optional[str] = None):
r2r_status: Optional[str] = None,
experiment_name: Optional[str] = None):
self.channel = channel
self.quiet = quiet
self.commit_sha = commit_sha
Expand Down Expand Up @@ -331,6 +338,7 @@ def __init__(
self.target_windows = target_windows
self.physical_promotion_status = physical_promotion_status
self.r2r_status = r2r_status
self.experiment_name = experiment_name

def main(args: Any):
verbose = not args.quiet
Expand Down Expand Up @@ -386,6 +394,7 @@ def main(args: Any):
pgo_config = ''
physical_promotion_config = ''
r2r_config = ''
experiment_config = ''
showenv = 'set' if args.target_windows else 'printenv'

if args.pgo_status == 'nodynamicpgo':
Expand Down Expand Up @@ -451,6 +460,7 @@ def main(args: Any):
out_file.write(pgo_config)
out_file.write(physical_promotion_config)
out_file.write(r2r_config)
out_file.write(experiment_config)
out_file.write(variable_format % ('PERFLAB_INLAB', '0' if args.not_in_lab else '1'))
out_file.write(variable_format % ('PERFLAB_REPO', '/'.join([owner, repo])))
out_file.write(variable_format % ('PERFLAB_BRANCH', branch))
Expand Down
6 changes: 6 additions & 0 deletions scripts/performance_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PerformanceSetupArgs:
no_dynamic_pgo: bool = False
physical_promotion: bool = False
no_r2r: bool = False
experiment_name: str | None = None
ios_llvm_build: bool = False
ios_strip_symbols: bool = False
maui_version: str | None = None
Expand Down Expand Up @@ -197,6 +198,9 @@ def run(args: PerformanceSetupArgs):
if args.no_r2r:
args.configurations["R2RType"] = "nor2r"

if args.experiment_name:
args.configurations["ExperimentName"] = args.experiment_name

runtime_type = ""

if args.ios_mono:
Expand Down Expand Up @@ -292,6 +296,8 @@ def run(args: PerformanceSetupArgs):
if args.no_r2r:
setup_arguments.r2r_status = "nor2r"

setup_arguments.experiment_name = args.experiment_name

if args.mono_aot:
if args.mono_aot_path is None:
raise Exception("Mono AOT Path must be provided for MonoAOT runs")
Expand Down
2 changes: 2 additions & 0 deletions scripts/run_performance_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class RunPerformanceJobArgs:
pgo_run_type: str | None = None
physical_promotion_run_type: str | None = None
r2r_run_type: str | None = None
experiment_name: str | None = None
codegen_type: str = "JIT"
runtime_type: str = "coreclr"
affinity: str | None = "0"
Expand Down Expand Up @@ -252,6 +253,7 @@ def run_performance_job(args: RunPerformanceJobArgs):
no_dynamic_pgo=args.pgo_run_type == "nodynamicpgo",
physical_promotion=args.physical_promotion_run_type == "physicalpromotion",
no_r2r=args.r2r_run_type == "nor2r",
experiment_name=args.experiment_name,
internal=args.internal,
mono_interpreter=mono_interpreter,
framework=args.framework,
Expand Down

0 comments on commit 2525ba2

Please sign in to comment.