-
Notifications
You must be signed in to change notification settings - Fork 27
feat: support metal cpp #295
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
base: main
Are you sure you want to change the base?
Conversation
danieldk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool!
Added some comments. Maybe you can also copy over the test from the relu example?
| #[serde(rename = "cutlass_sycl")] | ||
| CutlassSycl, | ||
| #[serde(rename = "metal-cpp")] | ||
| MetalCpp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a version like cutlass? My first guess is not, since on Mac we always have everything the latest, but I thought I'd check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question! I agree we probably do not need a version here and we'll always prefer latest
examples/relu-metal-cpp/build.toml
Outdated
| "relu.cpp", | ||
| "metallib_loader.mm", | ||
| "relu_cpp.metal", | ||
| "common.h", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nicer to have these in a directory, since it's an example, we want best practices :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally agree, i've updated the folder struct and build.toml in latest
lib/torch-extension/arch.nix
Outdated
| # Build inputs | ||
| apple-sdk_26, | ||
| clr, | ||
| metal-cpp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
danieldk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more small comment (file to remove), CI should work again after a rebase on main.
| @@ -0,0 +1,23 @@ | |||
| # /// script | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is another development file that can be removed? (I think I missed it the first time.)
This PR supersedes #291
This PR adds support for a new
metal-cppkernel dependency. This is a follow up to the metal-cpp support in hf nix: huggingface/hf-nix#128 and enables kernels to use the cpp headers to drive metal kernels.Changes:
example usage
test_relu_metal_cpp.pyoutput