Skip to content

Migrate TL adapter utils tests to non-fb location and drop shims#5217

Closed
saitcakmak wants to merge 1 commit into
facebook:mainfrom
saitcakmak:export-D107429272
Closed

Migrate TL adapter utils tests to non-fb location and drop shims#5217
saitcakmak wants to merge 1 commit into
facebook:mainfrom
saitcakmak:export-D107429272

Conversation

@saitcakmak
Copy link
Copy Markdown
Contributor

Summary:
The TL adapter utilities get_joint_search_space, merge_dependents, merge_parameters (in ax/adapter/transfer_learning/utils.py) and get_mapped_parameter_names (in ax/adapter/transfer_learning/utils_torch.py) were previously migrated out of ax/fb/adapter/, which left behind pure re-export shims at ax/fb/adapter/utils.py and ax/fb/adapter/utils_torch.py. The only remaining coverage for these functions lived in ax/fb/adapter/tests/test_utils.py and test_utils_torch.py, exercising the migrated code through those shims -- and the non-fb destination had no test coverage of its own.

This moves both test files to ax/adapter/transfer_learning/tests/, switches their imports to the real non-fb modules (ax.adapter.transfer_learning.utils/utils_torch, ax.core.auxiliary_source.AuxiliarySource, ax.utils.common.testutils.TestCase), and removes the now-unused get_unordered_choice/get_ordered_choice helpers from test_utils.py.

Since the two test files were the only callers of the ax.fb.adapter.utils/utils_torch shims repo-wide, the shims are deleted and the BUCK targets are updated accordingly: a new test_utils python_unittest is added under ax/adapter/transfer_learning/BUCK, and the old test_utils target, the orphaned :utils library, and the utils_torch.py src are removed from ax/fb/adapter/BUCK.

The broader ax.fb.core.auxiliary_source shim is left in place; it still has many callers across admarket, pts, automl, storage, and docs, so cleaning it up is a separate effort.

Differential Revision: D107429272

Summary:
The TL adapter utilities `get_joint_search_space`, `merge_dependents`, `merge_parameters` (in `ax/adapter/transfer_learning/utils.py`) and `get_mapped_parameter_names` (in `ax/adapter/transfer_learning/utils_torch.py`) were previously migrated out of `ax/fb/adapter/`, which left behind pure re-export shims at `ax/fb/adapter/utils.py` and `ax/fb/adapter/utils_torch.py`. The only remaining coverage for these functions lived in `ax/fb/adapter/tests/test_utils.py` and `test_utils_torch.py`, exercising the migrated code through those shims -- and the non-fb destination had no test coverage of its own.

This moves both test files to `ax/adapter/transfer_learning/tests/`, switches their imports to the real non-fb modules (`ax.adapter.transfer_learning.utils`/`utils_torch`, `ax.core.auxiliary_source.AuxiliarySource`, `ax.utils.common.testutils.TestCase`), and removes the now-unused `get_unordered_choice`/`get_ordered_choice` helpers from `test_utils.py`.

Since the two test files were the only callers of the `ax.fb.adapter.utils`/`utils_torch` shims repo-wide, the shims are deleted and the BUCK targets are updated accordingly: a new `test_utils` `python_unittest` is added under `ax/adapter/transfer_learning/BUCK`, and the old `test_utils` target, the orphaned `:utils` library, and the `utils_torch.py` src are removed from `ax/fb/adapter/BUCK`.

The broader `ax.fb.core.auxiliary_source` shim is left in place; it still has many callers across admarket, pts, automl, storage, and docs, so cleaning it up is a separate effort.

Differential Revision: D107429272
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 3, 2026

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

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (d0ae700) to head (b658583).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5217      +/-   ##
==========================================
+ Coverage   96.50%   96.57%   +0.07%     
==========================================
  Files         617      619       +2     
  Lines       69776    69904     +128     
==========================================
+ Hits        67339    67512     +173     
+ Misses       2437     2392      -45     

☔ 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
Copy link
Copy Markdown

meta-codesync Bot commented Jun 4, 2026

This pull request has been merged in 779b245.

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