@@ -98,6 +98,16 @@ def parse_args(args=None) -> argparse.Namespace:
9898 `date` will be substituted, e.g. ghcr.io/nvidia/jax:{container}-{date} for
9999 the JAX-Toolbox public nightlies.""" ,
100100 )
101+ parser .add_argument ("--metric-name" , type = str , help = "Example: tflops_per_sec" )
102+ parser .add_argument (
103+ "--passing-metric" ,
104+ action = "append" ,
105+ type = float ,
106+ help = "Good value for the metric" ,
107+ )
108+ parser .add_argument (
109+ "--failing-metric" , action = "append" , type = float , help = "Bad value for the metric"
110+ )
101111 parser .add_argument (
102112 "--output-prefix" ,
103113 default = None ,
@@ -316,6 +326,14 @@ def parse_args(args=None) -> argparse.Namespace:
316326 default = "main" ,
317327 help = "The name of the main branch (e.g. main) to derive cherry-picks from" ,
318328 )
329+ parser .add_argument (
330+ "--container-registry" ,
331+ type = str ,
332+ help = """
333+ Remote registry for use with the plugin backend. This can optionally
334+ include a tag prefix, i.e. gitlab.com/USER/containers and
335+ gitlab.com/USER/containers:PREFIX- are both valid.""" ,
336+ )
319337 args = parser .parse_args (args = args )
320338 if args .restart :
321339 if args .output_prefix is None :
@@ -331,12 +349,38 @@ def parse_args(args=None) -> argparse.Namespace:
331349 args .output_prefix = pathlib .Path (
332350 datetime .datetime .now ().strftime ("triage-%Y-%m-%d-%H-%M-%S" )
333351 )
334-
352+ args .optional_software = optional_software .copy ()
353+ if args .exclude_transformer_engine :
354+ args .optional_software .remove ("transformer-engine" )
335355 assert args .container_runtime in {
336356 "docker" ,
337357 "pyxis" ,
338358 "local" ,
359+ "plugin" ,
339360 }, args .container_runtime
361+
362+ # Metric-based triage checks
363+ container_search_options_passed = (
364+ args .container is not None
365+ or args .start_date is not None
366+ or args .end_date is not None
367+ )
368+ if args .metric_name is not None :
369+ if container_search_options_passed :
370+ raise Exception (
371+ "--metric-name is only supported in version-level search; use "
372+ "--{passing,failing}-{container,versions}."
373+ )
374+ if not args .passing_metric or not args .failing_metric :
375+ raise Exception (
376+ "You should pass seed metric values via --passing-metric and "
377+ "--failing-metric if --metric-name is passed."
378+ )
379+ if (args .passing_metric or args .failing_metric ) and args .metric_name is None :
380+ raise Exception (
381+ "--metric-name must be passed if --passing-metric or --failing-metric is."
382+ )
383+
340384 args .workaround_buggy_container = set (args .workaround_buggy_container )
341385 # --{passing,failing}-commits are deprecated aliases for --{passing,failing}-versions.
342386 for prefix in ["passing" , "failing" ]:
@@ -393,9 +437,7 @@ def parse_args(args=None) -> argparse.Namespace:
393437 # If the container-level search is being skipped, because a valid combination
394438 # of --{passing,failing}-{versions,container} is passed, then no container-level
395439 # search options should be passed.
396- assert (
397- args .container is None and args .start_date is None and args .end_date is None
398- ), (
440+ assert not container_search_options_passed , (
399441 "No container-level search options should be passed if the passing/failing"
400442 " containers/versions have been passed explicitly."
401443 )
@@ -417,12 +459,7 @@ def parse_args(args=None) -> argparse.Namespace:
417459 else :
418460 # None of --{passing,failing}-{versions,container} were passed, make sure the
419461 # compulsory arguments for the container-level search were passed
420- assert (
421- args .container is not None
422- ), "--container must be passed for the container-level search"
423-
424- args .optional_software = optional_software .copy ()
425- if args .exclude_transformer_engine :
426- args .optional_software .remove ("transformer-engine" )
427-
462+ assert args .container is not None , (
463+ "--container must be passed for the container-level search"
464+ )
428465 return args
0 commit comments