Repository navigation
[CUDA] Bundle CCCL for JIT compilation - #2357
Conversation
| return op_t.str(); | ||
| } | ||
|
|
||
| std::filesystem::path current_binary_dir() { |
There was a problem hiding this comment.
There was a comment about this needing to stay inline. I think the purpose of that is to make sure upstream dependencies of MLX get the right binary path. Could you make it inline in the header?
There was a problem hiding this comment.
Maybe a better change would be to have a wrapper around the inline version which sets the static variable so it gets properly cached. But the one used by register_library in metal device.h should be inline in a header.
There was a problem hiding this comment.
The inline version of register_library got removed in #2055 (not sure if it is intentional), so I think there is no longer needs making this inline? The only place using it is device.cpp so it only returns the dir containing libmlx.so.
There was a problem hiding this comment.
Hmm.. good point. get_library can be called by third-party extensions. If it is called without a path then it will attempt to look for a metal library where the current binary is located. Presumably that will be the libmlx now.. which I would have thought is a bug 🤔
There was a problem hiding this comment.
Either way this PR doesn't change that behavior so let's move forward with it.
awni
left a comment
There was a problem hiding this comment.
Looks great!! I left one comment, please address then we can merge.
* Ship CCCL for JIT compilation * Remove cexpf
Close #2348.
Bundle CCCL as part of python distribution (installed in the
includedirectory along with MLX headers), and make JIT compiler search headers from it. This ensure the JIT compilation gets the same result with host compilation.Currently only libcudacxx (i.e.
cuda/std/xxxheaders) are shipped since the JIT code (underbackend/cuda/device) only uses it. It would be very easy to also ship CUB headers if needed. However thrust currently is not compatible with JIT (NVIDIA/cccl#4305) and we should avoid using it in JIT code.This PR also removes code that was used to work around old CCCL versions.