Skip to content

Add GenerationStrategy.fit() and make maybe_transition_to_next_node private (#4922)#4922

Closed
sdaulton wants to merge 1 commit intofacebook:mainfrom
sdaulton:export-D93804600
Closed

Add GenerationStrategy.fit() and make maybe_transition_to_next_node private (#4922)#4922
sdaulton wants to merge 1 commit intofacebook:mainfrom
sdaulton:export-D93804600

Conversation

@sdaulton
Copy link
Copy Markdown
Contributor

@sdaulton sdaulton commented Feb 20, 2026

Summary:

Add a public GenerationStrategy.fit(experiment, data) method that
encapsulates the transition-then-fit pattern. This replaces ad-hoc calls
to maybe_transition_to_next_node + current_node._fit that were
scattered across analysis utils, AxClient, and other callers.

fit() transitions to the appropriate node based on experiment state
(e.g. skipping initialization nodes, selecting TL vs non-TL nodes),
fits all GeneratorSpecs on that node, and returns the fitted Adapter.

maybe_transition_to_next_node is made private
(_maybe_transition_to_next_node) per reviewer feedback to limit
external callers of GS internals. The new looping version (which
advances through multiple nodes) replaces the old single-step
_maybe_transition_to_next_node.

Also adds support for skipping the CenterGenerationNode when trials
with data are already present (use_existing_trials_for_initialization).

Reviewed By: mgarrard

Differential Revision: D93804600

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

meta-codesync Bot commented Feb 20, 2026

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

sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 4, 2026
…nter GN when trials are provided (facebook#4922)

Summary:

see title. This important for using a new GS on an experiment with data in model-based analyses.

This adds support for
* skipping the center GN when trials with data are provided
* Transitioning the GS when possible when extracting the adapter in analyses (important for fast-forwarding the GS for an experiment with data).

Differential Revision: D93804600
sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 4, 2026
…nter GN when trials are provided (facebook#4922)

Summary:
Pull Request resolved: facebook#4922

see title. This important for using a new GS on an experiment with data in model-based analyses.

This adds support for
* skipping the center GN when trials with data are provided
* Transitioning the GS when possible when extracting the adapter in analyses (important for fast-forwarding the GS for an experiment with data).

Differential Revision: D93804600
sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 4, 2026
…nter GN when trials are provided (facebook#4922)

Summary:
Pull Request resolved: facebook#4922

see title. This important for using a new GS on an experiment with data in model-based analyses.

This adds support for
* skipping the center GN when trials with data are provided
* Transitioning the GS when possible when extracting the adapter in analyses (important for fast-forwarding the GS for an experiment with data).

Differential Revision: D93804600
@meta-codesync meta-codesync Bot changed the title call maybe transition to next node in Analyses and enable skipping center GN when trials are provided Add GenerationStrategy.fit() and make maybe_transition_to_next_node private Mar 20, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.30%. Comparing base (6e527d5) to head (3ec2029).

Files with missing lines Patch % Lines
ax/service/ax_client.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4922      +/-   ##
==========================================
- Coverage   96.30%   96.30%   -0.01%     
==========================================
  Files         611      611              
  Lines       67534    67572      +38     
==========================================
+ Hits        65040    65073      +33     
- Misses       2494     2499       +5     

☔ 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.

@meta-codesync meta-codesync Bot changed the title Add GenerationStrategy.fit() and make maybe_transition_to_next_node private Add GenerationStrategy.fit() and make maybe_transition_to_next_node private (#4922) Mar 24, 2026
sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 24, 2026
…rivate (facebook#4922)

Summary:

Add a public ``GenerationStrategy.fit(experiment, data)`` method that
encapsulates the transition-then-fit pattern. This replaces ad-hoc calls
to ``maybe_transition_to_next_node`` + ``current_node._fit`` that were
scattered across analysis utils, AxClient, and other callers.

``fit()`` transitions to the appropriate node based on experiment state
(e.g. skipping initialization nodes, selecting TL vs non-TL nodes),
fits all GeneratorSpecs on that node, and returns the fitted Adapter.

``maybe_transition_to_next_node`` is made private
(``_maybe_transition_to_next_node``) per reviewer feedback to limit
external callers of GS internals. The new looping version (which
advances through multiple nodes) replaces the old single-step
``_maybe_transition_to_next_node``.

Also adds support for skipping the CenterGenerationNode when trials
with data are already present (``use_existing_trials_for_initialization``).

Reviewed By: mgarrard

Differential Revision: D93804600
sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 24, 2026
…rivate (facebook#4922)

Summary:
Pull Request resolved: facebook#4922

Add a public ``GenerationStrategy.fit(experiment, data)`` method that
encapsulates the transition-then-fit pattern. This replaces ad-hoc calls
to ``maybe_transition_to_next_node`` + ``current_node._fit`` that were
scattered across analysis utils, AxClient, and other callers.

``fit()`` transitions to the appropriate node based on experiment state
(e.g. skipping initialization nodes, selecting TL vs non-TL nodes),
fits all GeneratorSpecs on that node, and returns the fitted Adapter.

``maybe_transition_to_next_node`` is made private
(``_maybe_transition_to_next_node``) per reviewer feedback to limit
external callers of GS internals. The new looping version (which
advances through multiple nodes) replaces the old single-step
``_maybe_transition_to_next_node``.

Also adds support for skipping the CenterGenerationNode when trials
with data are already present (``use_existing_trials_for_initialization``).

Reviewed By: mgarrard

Differential Revision: D93804600
…rivate (facebook#4922)

Summary:

Add a public ``GenerationStrategy.fit(experiment, data)`` method that
encapsulates the transition-then-fit pattern. This replaces ad-hoc calls
to ``maybe_transition_to_next_node`` + ``current_node._fit`` that were
scattered across analysis utils, AxClient, and other callers.

``fit()`` transitions to the appropriate node based on experiment state
(e.g. skipping initialization nodes, selecting TL vs non-TL nodes),
fits all GeneratorSpecs on that node, and returns the fitted Adapter.

``maybe_transition_to_next_node`` is made private
(``_maybe_transition_to_next_node``) per reviewer feedback to limit
external callers of GS internals. The new looping version (which
advances through multiple nodes) replaces the old single-step
``_maybe_transition_to_next_node``.

Also adds support for skipping the CenterGenerationNode when trials
with data are already present (``use_existing_trials_for_initialization``).

Reviewed By: mgarrard

Differential Revision: D93804600
sdaulton added a commit to sdaulton/Ax-1 that referenced this pull request Mar 25, 2026
…rivate (facebook#4922)

Summary:

Add a public ``GenerationStrategy.fit(experiment, data)`` method that
encapsulates the transition-then-fit pattern. This replaces ad-hoc calls
to ``maybe_transition_to_next_node`` + ``current_node._fit`` that were
scattered across analysis utils, AxClient, and other callers.

``fit()`` transitions to the appropriate node based on experiment state
(e.g. skipping initialization nodes, selecting TL vs non-TL nodes),
fits all GeneratorSpecs on that node, and returns the fitted Adapter.

``maybe_transition_to_next_node`` is made private
(``_maybe_transition_to_next_node``) per reviewer feedback to limit
external callers of GS internals. The new looping version (which
advances through multiple nodes) replaces the old single-step
``_maybe_transition_to_next_node``.

Also adds support for skipping the CenterGenerationNode when trials
with data are already present (``use_existing_trials_for_initialization``).

Reviewed By: mgarrard

Differential Revision: D93804600
@meta-codesync meta-codesync Bot closed this in 168516b Mar 25, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Mar 25, 2026

This pull request has been merged in 168516b.

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.

2 participants