Skip to content

Register Log10 for model configuration serialization - #5308

Closed
ltiao wants to merge 1 commit into
facebook:mainfrom
ltiao:export-D126825222
Closed

ltiao wants to merge 1 commit into
facebook:mainfrom
ltiao:export-D126825222

Conversation

@ltiao

@ltiao ltiao commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary:

Why

Saving a model configuration with BoTorch's native Log10 input transform fails because the shared input-transform registry does not recognize the class.

Changes

  • Register BoTorch's native Log10 input transform in the existing serialization registry.
  • Add a JSON round-trip test that preserves the transform class and its options in a ModelConfig.

Examples

Input:

config = ModelConfig(
    input_transform_classes=[Log10],
    input_transform_options={"Log10": {"indices": [1]}},
)

Before

object_to_json(config)
# ValueError: Log10 is not in the Type[InputTransform] registry

After

restored = object_from_json(json.loads(json.dumps(object_to_json(config))))
assert restored == config

Differential Revision: D126825222

Summary:
# Why

Saving a model configuration with BoTorch's native `Log10` input transform fails because the shared input-transform registry does not recognize the class.

# Changes

- Register BoTorch's native `Log10` input transform in the existing serialization registry.
- Add a JSON round-trip test that preserves the transform class and its options in a `ModelConfig`.

# Examples

Input:

```python
config = ModelConfig(
    input_transform_classes=[Log10],
    input_transform_options={"Log10": {"indices": [1]}},
)
```

## Before

```python
object_to_json(config)
# ValueError: Log10 is not in the Type[InputTransform] registry
```

## After

```python
restored = object_from_json(json.loads(json.dumps(object_to_json(config))))
assert restored == config
```

Differential Revision: D126825222
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 22, 2026
@meta-codesync

meta-codesync Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (add8500) to head (9975ff7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5308   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files         621      621           
  Lines       71095    71099    +4     
=======================================
+ Hits        68679    68683    +4     
  Misses       2416     2416           

☔ View full report in Codecov by Harness.
📢 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 closed this in 8a07d83 Oct 22, 2026
@meta-codesync meta-codesync Bot added the Merged label Oct 22, 2026
@meta-codesync

meta-codesync Bot commented Oct 22, 2026

Copy link
Copy Markdown

This pull request has been merged in 8a07d83.

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. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants