Skip to content

Ship the MLX metallib bundle in the template - #22244

Open
shoumikhin wants to merge 2 commits into
swiftpm-macos14from
mlx-template-fixes
Open

Ship the MLX metallib bundle in the template#22244
shoumikhin wants to merge 2 commits into
swiftpm-macos14from
mlx-template-fixes

Conversation

@shoumikhin

Copy link
Copy Markdown
Contributor

Summary

Fix the MLX resource bundle in the SwiftPM package template so it is not empty for consumers.

The metallib bundle used a relative-path existence guard, and SwiftPM evaluates a dependency's manifest with the consumer's working directory, so the guard was always false and the published bundle shipped with zero Metal kernel files. MLX then faults at first device use. Ship all three per-slice metallibs unconditionally, which the release job always commits beside the manifest, so the guard is unnecessary. Also trim the resource-bundle comment to match the main manifest.

The Foundation linked framework is kept: the MLX delegate's Objective-C++ Metal code calls into it, and a static archive in an xcframework carries no autolink hint.

Test plan

Materialized the template and confirmed it parses, and that all three metallib slices are declared as resources.

shoumikhin and others added 2 commits August 26, 2026 23:02
The MLX Metal kernel resources were guarded by a working-directory-relative file
check that is false when the package is resolved as a dependency, so the bundle
shipped empty and MLX could not find its kernels. In the published package the
release job commits all three slice files to this branch beside the manifest, so
they are always present; copy them unconditionally and drop the guard, which also
removes the now-unused Foundation import.

Test Plan:
Materialized the template the way the release job does and confirmed
dump-package includes all three metallib resources on the shared
backend_mlx_resources target.
Shorten the comment above the MLX resource bundle in the SwiftPM package template
so it matches the wording in the main manifest. Comment only.

Test Plan:
Materialized the template and confirmed it parses.
@shoumikhin shoumikhin added the release notes: none Do not include this in the release notes label Aug 27, 2026
@pytorch-bot

pytorch-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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 Aug 27, 2026
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