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

Log experiment time_created so we can backfill missed events #3078

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions ax/telemetry/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class ExperimentCreatedRecord:
# Runner info
runner_cls: str

experiment_created_time: int

@classmethod
def from_experiment(cls, experiment: Experiment) -> ExperimentCreatedRecord:
(
Expand Down Expand Up @@ -142,6 +144,7 @@ def from_experiment(cls, experiment: Experiment) -> ExperimentCreatedRecord:
}
},
runner_cls=experiment.runner.__class__.__name__,
experiment_created_time=int(experiment.time_created.timestamp()),
)

@staticmethod
Expand Down
7 changes: 7 additions & 0 deletions ax/telemetry/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class OptimizationCreatedRecord:
num_custom_trials: int
support_tier: str

# Allows for backfilling of missed events
# instead of relying on event_time
experiment_created_time: int

@classmethod
def from_scheduler(
cls,
Expand Down Expand Up @@ -148,6 +152,7 @@ def from_scheduler(
num_map_metrics=experiment_created_record.num_map_metrics,
metric_cls_to_quantity=experiment_created_record.metric_cls_to_quantity,
runner_cls=experiment_created_record.runner_cls,
experiment_created_time=experiment_created_record.experiment_created_time,
generation_strategy_name=(
generation_strategy_created_record.generation_strategy_name
),
Expand Down Expand Up @@ -251,6 +256,7 @@ def from_ax_client(
num_map_metrics=experiment_created_record.num_map_metrics,
metric_cls_to_quantity=experiment_created_record.metric_cls_to_quantity,
runner_cls=experiment_created_record.runner_cls,
experiment_created_time=experiment_created_record.experiment_created_time,
generation_strategy_name=(
generation_strategy_created_record.generation_strategy_name
),
Expand Down Expand Up @@ -368,6 +374,7 @@ def from_experiment(
num_map_metrics=experiment_created_record.num_map_metrics,
metric_cls_to_quantity=experiment_created_record.metric_cls_to_quantity,
runner_cls=experiment_created_record.runner_cls,
experiment_created_time=experiment_created_record.experiment_created_time,
generation_strategy_name=(
None
if generation_strategy_created_record is None
Expand Down
1 change: 1 addition & 0 deletions ax/telemetry/tests/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_experiment_created_record_from_experiment(self) -> None:
num_map_metrics=0,
metric_cls_to_quantity={"Metric": 2, "CustomTestMetric": 1},
runner_cls="CustomTestRunner",
experiment_created_time=int(experiment.time_created.timestamp()),
)
self.assertEqual(record, expected)

Expand Down