Skip to content

Scheduler updates experiment status from generation strategy#4891

Closed
CristianLara wants to merge 4 commits intofacebook:mainfrom
CristianLara:export-D87589267
Closed

Scheduler updates experiment status from generation strategy#4891
CristianLara wants to merge 4 commits intofacebook:mainfrom
CristianLara:export-D87589267

Conversation

@CristianLara
Copy link
Contributor

Summary:

Summary

This change enables the Ax Scheduler (Orchestrator) to receive and propagate suggested experiment status from the generation strategy, then persist it to the database. This is a key integration point that connects the experiment lifecycle tracking system to the scheduler workflow.

What Changed

  1. Updated GenerationStrategy.gen() signature (/data/sandcastle/boxes/fbsource/fbcode/ax/generation_strategy/generation_strategy.py):

    • Changed return type from list[list[GeneratorRun]] to tuple including status
  2. Updated Orchestrator flow (/data/sandcastle/boxes/fbsource/fbcode/ax/service/orchestrator.py):

    • Modified _get_next_trials() to return suggested experiment status as third element in tuple
    • Updated _gen_new_trials_from_generation_strategy() to receive and return suggested status from generation_strategy.gen()
    • Updated generate_candidates() to receive suggested status and pass it to _save_or_update_trials_and_generation_strategy_if_possible()
  3. Updated database persistence (/data/sandcastle/boxes/fbsource/fbcode/ax/service/utils/with_db_settings_base.py):

    • Added suggested_experiment_status parameter to _save_or_update_trials_and_generation_strategy_if_possible()
    • Calls _update_experiment_status_in_db_if_possible() when suggested status is provided

Why This Change

This integrates the experiment lifecycle tracking feature (added in D86801911, D88089767, D88091834, D88096914) into the Scheduler/Orchestrator workflow. When the generation strategy suggests an experiment status (e.g., INITIALIZATION for Sobol exploration, OPTIMIZATION for model-based optimization), the scheduler now:

  1. Receives this suggestion from the generation strategy
  2. Updates the experiment status accordingly
  3. Persists the status to the database

This enables automatic experiment lifecycle management based on what optimization phase the generation strategy is in, providing users with clear visibility into experiment progression.

Differential Revision: D87589267

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 11, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 11, 2026

@CristianLara has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87589267.

CristianLara added a commit to CristianLara/Ax that referenced this pull request Feb 11, 2026
…k#4891)

Summary:

Connect the experiment lifecycle tracking system to the Ax Scheduler (Orchestrator), enabling automatic experiment status updates based on which optimization phase the generation strategy is in.

Key Changes 🔧
1. Orchestrator (orchestrator.py): After generating new trials, extracts suggested experiment status from generator runs and updates experiment.status

2. DB Persistence (save.py + with_db_settings_base.py): Added update_experiment_status() function and wired it to save status changes to DB after trial generation

3. Tests: Added test_generate_candidates_updates_experiment_status() to verify the whole flow works

Differential Revision: D87589267
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 99.15254% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.80%. Comparing base (5cf011e) to head (0303af7).

Files with missing lines Patch % Lines
ax/storage/sqa_store/save.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4891      +/-   ##
==========================================
+ Coverage   96.79%   96.80%   +0.01%     
==========================================
  Files         595      595              
  Lines       62841    62949     +108     
==========================================
+ Hits        60826    60937     +111     
+ Misses       2015     2012       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

CristianLara added a commit to CristianLara/Ax that referenced this pull request Feb 13, 2026
…k#4891)

Summary:

Connect the experiment lifecycle tracking system to the Ax Scheduler (Orchestrator), enabling automatic experiment status updates based on which optimization phase the generation strategy is in.

Key Changes 🔧
1. Orchestrator (orchestrator.py): After generating new trials, extracts suggested experiment status from generator runs and updates experiment.status

2. DB Persistence (save.py + with_db_settings_base.py): Added update_experiment_status() function and wired it to save status changes to DB after trial generation

3. Tests: Added test_generate_candidates_updates_experiment_status() to verify the whole flow works

Reviewed By: lena-kashtelyan

Differential Revision: D87589267
CristianLara added a commit to CristianLara/Ax that referenced this pull request Feb 13, 2026
…k#4891)

Summary:

Connect the experiment lifecycle tracking system to the Ax Scheduler (Orchestrator), enabling automatic experiment status updates based on which optimization phase the generation strategy is in.

Key Changes 🔧
1. Orchestrator (orchestrator.py): After generating new trials, extracts suggested experiment status from generator runs and updates experiment.status

2. DB Persistence (save.py + with_db_settings_base.py): Added update_experiment_status() function and wired it to save status changes to DB after trial generation

3. Tests: Added test_generate_candidates_updates_experiment_status() to verify the whole flow works

Reviewed By: lena-kashtelyan

Differential Revision: D87589267
Summary:

## Summary

Add `suggested_experiment_status` column to `GeneratorRun`. Some benefits:

1. We don't need to modify the GS.gen() or Orchestrator methods to pass along a suggested status via tuple, instead it's baked into the GeneratorRuns that are already being passed along
2. The suggested status are more clearly stored in the database for historical tracking

Prior to this approach I tried changing `GS.gen()` to return a tuple including the `suggested_experiment_status` but that over-complicated callsites.

## AOSC DIFF

D92476170

Reviewed By: lena-kashtelyan

Differential Revision: D88091530
…rRun (facebook#4885)

Summary:

In the previous diff (D88091530) we added `suggested_experiment_status` the column to GeneratorRun, now we populate it during creation from GenerationNode.

Reviewed By: lena-kashtelyan

Differential Revision: D92555215
…#4900)

Summary:

Add a new static method `experiment_status_from_generator_runs()` to `GenerationStrategy` that extracts and validates a suggested ExperimentStatus from a list of GeneratorRun objects. It collects all unique suggested_experiment_status values from the runs and:

- Returns None with a warning if there are conflicting statuses across runs
- Returns None with an info log if no statuses are found
- Returns the single agreed-upon status otherwise

Reviewed By: lena-kashtelyan

Differential Revision: D92985915
…k#4891)

Summary:

Connect the experiment lifecycle tracking system to the Ax Scheduler (Orchestrator), enabling automatic experiment status updates based on which optimization phase the generation strategy is in.

Key Changes 🔧
1. Orchestrator (orchestrator.py): After generating new trials, extracts suggested experiment status from generator runs and updates experiment.status

2. DB Persistence (save.py + with_db_settings_base.py): Added update_experiment_status() function and wired it to save status changes to DB after trial generation

3. Tests: Added test_generate_candidates_updates_experiment_status() to verify the whole flow works

Reviewed By: lena-kashtelyan

Differential Revision: D87589267
@meta-codesync
Copy link

meta-codesync bot commented Feb 14, 2026

This pull request has been merged in f0bd257.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants