Ship the MLX metallib bundle in the template - #22244
Open
shoumikhin wants to merge 2 commits into
Open
Conversation
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.
🔗 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Foundationlinked 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.