Skip to content

Decouple parameter discovery from data extraction in _get_fit_args (#5200)#5200

Open
hvarfner wants to merge 1 commit into
facebook:mainfrom
hvarfner:export-D104702983
Open

Decouple parameter discovery from data extraction in _get_fit_args (#5200)#5200
hvarfner wants to merge 1 commit into
facebook:mainfrom
hvarfner:export-D104702983

Conversation

@hvarfner
Copy link
Copy Markdown

@hvarfner hvarfner commented May 11, 2026

Summary:
Motivation: model_space/search_space was not properly used - parameter bounds on the search space would be set from the union of source and target, and parameters that were fixed on the target would be RangeParameters if the model_space contained a Fixed/Range change in the parameter.

Adds a data_parameters argument to TorchAdapter._get_fit_args that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set _model_space to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the _expand_ssd_to_joint_space post-hoc expansion.

Reviewed By: saitcakmak

Differential Revision: D104702983

@hvarfner hvarfner force-pushed the export-D104702983 branch from aac1f43 to 10b36ec Compare May 11, 2026 18:58
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 11, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 11, 2026

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

@meta-codesync meta-codesync Bot changed the title Decouple parameter discovery from data extraction in _get_fit_args Decouple parameter discovery from data extraction in _get_fit_args (#5200) May 11, 2026
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request May 11, 2026
…acebook#5200)

Summary:
Pull Request resolved: facebook#5200

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Overrides `_set_search_space` to add source-only RangeParameters from the joint search space to `_model_space` while preserving target bounds for shared params (Normalize stays anchored to target bounds). At gen time, `self.parameters` is temporarily swapped to target-only so `extract_search_space_digest` sees only params present in the gen-time search space.

Deletes `_expand_ssd_to_joint_space` (~90 lines).

Differential Revision: D104702983
@hvarfner hvarfner force-pushed the export-D104702983 branch from 10b36ec to fda67a6 Compare May 11, 2026 19:02
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2026

Codecov Report

❌ Patch coverage is 87.23404% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.51%. Comparing base (bd2ff97) to head (f99000b).

Files with missing lines Patch % Lines
ax/adapter/transfer_learning/adapter.py 64.70% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5200      +/-   ##
==========================================
+ Coverage   96.38%   96.51%   +0.12%     
==========================================
  Files         617      617              
  Lines       69615    69617       +2     
==========================================
+ Hits        67100    67188      +88     
+ Misses       2515     2429      -86     

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

hvarfner pushed a commit to hvarfner/Ax that referenced this pull request May 12, 2026
…acebook#5200)

Summary:

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Overrides `_set_search_space` to add source-only RangeParameters from the joint search space to `_model_space` while preserving target bounds for shared params (Normalize stays anchored to target bounds). At gen time, `self.parameters` is temporarily swapped to target-only so `extract_search_space_digest` sees only params present in the gen-time search space.

Deletes `_expand_ssd_to_joint_space` (~90 lines).

Differential Revision: D104702983
@hvarfner hvarfner force-pushed the export-D104702983 branch from fda67a6 to b99282d Compare May 12, 2026 20:28
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request May 12, 2026
…acebook#5200)

Summary:

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Overrides `_set_search_space` to add source-only RangeParameters from the joint search space to `_model_space` while preserving target bounds for shared params (Normalize stays anchored to target bounds). At gen time, `self.parameters` is temporarily swapped to target-only so `extract_search_space_digest` sees only params present in the gen-time search space.

Deletes `_expand_ssd_to_joint_space` (~90 lines).

Differential Revision: D104702983
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request May 14, 2026
…acebook#5200)

Summary:

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Overrides `_set_search_space` to add source-only RangeParameters from the joint search space to `_model_space` while preserving target bounds for shared params (Normalize stays anchored to target bounds). At gen time, `self.parameters` is temporarily swapped to target-only so `extract_search_space_digest` sees only params present in the gen-time search space.

Deletes `_expand_ssd_to_joint_space` (~90 lines).

Differential Revision: D104702983
@hvarfner hvarfner force-pushed the export-D104702983 branch from b99282d to 080fb36 Compare May 14, 2026 16:57
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request May 14, 2026
…acebook#5200)

Summary:
**Motivation:** model_space/search_space was not properly used - parameter bounds on the search space would be set from the union of source and target, and parameters that were fixed on the target would be RangeParameters if the model_space contained a Fixed/Range change in the parameter.

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Differential Revision: D104702983
…acebook#5200)

Summary:
**Motivation:** model_space/search_space was not properly used - parameter bounds on the search space would be set from the union of source and target, and parameters that were fixed on the target would be RangeParameters if the model_space contained a Fixed/Range change in the parameter.

Adds a `data_parameters` argument to `TorchAdapter._get_fit_args` that decouples SSD construction (model params) from data column extraction (target params). This lets the TL adapter set `_model_space` to include source-only RangeParameters directly, so the SSD naturally covers the full joint feature space -- eliminating the need for the `_expand_ssd_to_joint_space` post-hoc expansion.

Reviewed By: saitcakmak

Differential Revision: D104702983
@hvarfner hvarfner force-pushed the export-D104702983 branch from 080fb36 to f99000b Compare May 22, 2026 19:47
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 meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants