Skip to content

Commit 39197d8

Browse files
shrutipatel31facebook-github-bot
authored andcommitted
(6/6) Port helpers to OSS for the new Complexity Rating Healthcheck - get_tier_msg
Summary: Move `get_tier_msg` utility method to OSS. This method will be used in the new Complexity Rating Healthcheck. Differential Revision: D89044911
1 parent 61ad6d6 commit 39197d8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

ax/utils/common/complexity_utils.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,33 @@ def format_tier_message(
525525
)
526526
msg += why_msg
527527
return msg
528+
529+
530+
def get_tier_msg(
531+
experiment: Experiment,
532+
options: Any,
533+
tier_metadata: dict[str, Any] | None = None,
534+
) -> str:
535+
"""Figure out the tier of the experiment.
536+
537+
Args:
538+
experiment: The Ax Experiment.
539+
options: The orchestrator options.
540+
tier_metadata: tier-related meta-data from the orchestrator.
541+
542+
Returns:
543+
A markdown-formatted string explaining the tier.
544+
"""
545+
tier_metadata = tier_metadata or {}
546+
tier, why_not_is_in_wheelhouse, why_not_supported = check_if_in_wheelhouse(
547+
summarize_ax_optimization_complexity(
548+
experiment=experiment, options=options, tier_metadata=tier_metadata
549+
)
550+
)
551+
552+
# Convert to user-friendly message
553+
return format_tier_message(
554+
tier=tier,
555+
why_not_is_in_wheelhouse=why_not_is_in_wheelhouse,
556+
why_not_supported=why_not_supported,
557+
)

0 commit comments

Comments
 (0)