Skip to content

Fix prior deserialization for priors with buffered attributes (#5167)#5167

Closed
hvarfner wants to merge 1 commit intofacebook:mainfrom
hvarfner:export-D100341242
Closed

Fix prior deserialization for priors with buffered attributes (#5167)#5167
hvarfner wants to merge 1 commit intofacebook:mainfrom
hvarfner:export-D100341242

Conversation

@hvarfner
Copy link
Copy Markdown

@hvarfner hvarfner commented Apr 10, 2026

Summary:

The Ax JSON decoder's botorch_component_from_json strips the
BUFFERED_PREFIX from state_dict keys only for TransformedDistribution
subclasses. This misses priors like BetaPrior whose underlying
distribution (Beta) uses property descriptors delegating to an
internal Dirichlet, causing _bufferize_attributes to use the prefix.

Broaden the check from TransformedDistribution to
(TransformedDistribution, Prior) so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242

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

meta-codesync Bot commented Apr 10, 2026

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.42%. Comparing base (89c2c67) to head (cf271ba).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5167   +/-   ##
=======================================
  Coverage   96.42%   96.42%           
=======================================
  Files         619      619           
  Lines       69308    69318   +10     
=======================================
+ Hits        66829    66839   +10     
  Misses       2479     2479           

☔ 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 hvarfner force-pushed the export-D100341242 branch from 4a7a898 to 84a9d69 Compare April 21, 2026 15:24
@meta-codesync meta-codesync Bot changed the title Fix prior deserialization for priors with buffered attributes Fix prior deserialization for priors with buffered attributes (#5167) Apr 21, 2026
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from 84a9d69 to 0765601 Compare April 21, 2026 16:49
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from 0765601 to 813551c Compare April 21, 2026 16:53
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from 813551c to a1f5b5d Compare April 21, 2026 21:23
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from a1f5b5d to 3dd0b43 Compare April 21, 2026 21:27
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from 3dd0b43 to cc15802 Compare April 21, 2026 23:04
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 21, 2026
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Differential Revision: D100341242

Reviewed By: sdaulton
hvarfner pushed a commit to hvarfner/Ax that referenced this pull request Apr 22, 2026
…ok#5167)

Summary:

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from cc15802 to 235eeb9 Compare April 22, 2026 02:43
…ok#5167)

Summary:
Pull Request resolved: facebook#5167

The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.

Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.

Reviewed By: sdaulton

Differential Revision: D100341242
@hvarfner hvarfner force-pushed the export-D100341242 branch from 235eeb9 to cf271ba Compare April 22, 2026 02:46
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 22, 2026

This pull request has been merged in 63346cc.

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