Skip to content

Fix custom metal extension #2446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2025
Merged

Fix custom metal extension #2446

merged 1 commit into from
Jul 31, 2025

Conversation

awni
Copy link
Member

@awni awni commented Jul 30, 2025

Previously (a long time ago) we relied on some implicit behavior of keeping the library loading in a header so it would resolve the right path for the binary. Rather than rely on that which was evidently quite brittle, this makes it explicit in the extension code.

Closes #2436

@awni awni requested a review from angeloskath July 30, 2025 21:22
Copy link
Member

@angeloskath angeloskath left a comment

Choose a reason for hiding this comment

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

🙏

@@ -167,6 +167,7 @@ jobs:
cd examples/extensions
uv pip install -r requirements.txt
uv run --no-project setup.py build_ext -j8
python test.py
Copy link
Member

Choose a reason for hiding this comment

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

Probably uv run --no-project test.py

@awni awni force-pushed the fix_custom_extension branch 2 times, most recently from 712e9d5 to ac7e6f3 Compare July 31, 2025 03:07
@awni awni force-pushed the fix_custom_extension branch from ac7e6f3 to 4426405 Compare July 31, 2025 05:06
@awni awni merged commit da5912e into main Jul 31, 2025
6 checks passed
@awni awni deleted the fix_custom_extension branch July 31, 2025 13:25
LVivona pushed a commit to LVivona/mlx that referenced this pull request Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Custom extensions example fails to run on the gpu
2 participants