Skip to content

mxtensor: add serialization support#3078

Merged
vkuzo merged 20 commits into
mainfrom
gh/vkuzo/125/head
Sep 26, 2025
Merged

mxtensor: add serialization support#3078
vkuzo merged 20 commits into
mainfrom
gh/vkuzo/125/head

Conversation

@vkuzo

@vkuzo vkuzo commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

Summary:

This is needed to save HF models with MX weights.

Test Plan:

pytest test/prototype/mx_formats/test_inference_workflow.py -s -k test_inference_workflow_mx

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo

vkuzo commented Sep 26, 2025

Copy link
Copy Markdown
Contributor Author

@pytorch-bot

pytorch-bot Bot commented Sep 26, 2025

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3078

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 26, 2025
vkuzo added a commit that referenced this pull request Sep 26, 2025
Summary:

This is needed to save HF models with MX weights.

Test Plan:

```
pytest test/prototype/mx_formats/test_inference_workflow.py -s -k test_inference_workflow_mx
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 92b1b58
ghstack-comment-id: 3338428571
Pull Request resolved: #3078
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Sep 26, 2025
f.seek(0)

# temporary workaround for https://github.com/pytorch/ao/issues/3077
torch.serialization.add_safe_globals([getattr])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on this issue, let me know if it works for this case: #3077 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code in inference_workflow already does that :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I needed to expend/open more lines to see... Thanks

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/124/head to main September 26, 2025 19:36
@vkuzo vkuzo merged commit cf9ea8a into main Sep 26, 2025
34 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants