Skip to content

Conversation

manuelcandales
Copy link
Contributor

@manuelcandales manuelcandales commented Oct 22, 2025

This pull request refactors how model weight constants are packaged and loaded in the Metal backend. The main change is separating weight constants from the shared object (.so) file, storing them as a binary blob on disk, and updating the runtime to load these weights from the blob. This speeds up loading time.

[ghstack-poisoned]
@manuelcandales
Copy link
Contributor Author

manuelcandales commented Oct 22, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15341

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

❌ 3 New Failures, 3 Pending, 2 Unrelated Failures

As of commit d8e6d13 with merge base 5d71c9b (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Oct 22, 2025
@manuelcandales manuelcandales added the release notes: none Do not include this in the release notes label Oct 22, 2025
user_input_placeholders.append(node.meta["val"])

# Base options for all devices
options: dict[str, typing.Any] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why we need metal_backend.py? It feels very much like cuda_backend.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. Next week we should begin refactoring, and moving most of this code to a new aoti_backend.py. Same with most of the code in metal_backend.cpp/cuda_backend.cpp

@manuelcandales manuelcandales merged commit b38028d into main Oct 22, 2025
160 of 169 checks passed
@manuelcandales manuelcandales deleted the gh/manuelcandales/145/head branch October 22, 2025 07:34
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. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants