nix: CUDA support#416
Conversation
Release v1.0.0
release: fix the Windows job shell in release.yml (v1.0.0 tag build)
This sets the formatter to alejandra. I was trying to stay as close as the original as I could; otherwise we could set it to `nixfmt` which would keep list spacing more similar, but would introduce additional indentation in a few places.
The tests now require Python so the env should be added to the check inputs, otherwise the build fails.
This makes the build actually reproducible by committing a working lockfile to the repo.
This is the higher-level user interface, which should be the main entry point to the binary, not the engine itself. The engine is still available.
|
Thanks for this, and sorry for the slow reply — the flake work is welcome and Nix users have asked for it. Before merging I need a bit more from the PR itself, because right now I can't tell what it does or whether it works. The description is the unfilled template, all three validation boxes are unchecked, and the change is 119 lines across Could you fill in:
The compatibility question matters most to me: the CPU build must stay dependency-free by default. If Not asking for a rewrite — the code may well be right. I just can't merge packaging for hardware I can't test on the strength of a diff alone. Fill those in and I'll look again properly. |
|
Follow-up to my earlier note: this now also conflicts with So the state is: draft, conflicting, no CI, and the description is still the unfilled template with all three validation boxes unchecked. I'm not able to review CUDA packaging for hardware I don't own on the strength of a diff alone. The three things I asked for still stand — what the flake exposes after this, what you ran and on which GPU/driver (with the Genuinely happy to have Nix support; I just can't merge it blind. |
|
Hey, sorry for leaving this in draft for so long. I didn't have much time to look at it these days. I have a box with an RTX CUDA GPU I was testing this on, and I haven't made much progress since I haven't seen the speedups I was hoping for. It builds with CUDA 13.2, 13.3 too but using that globally in NixOS right now is problematic due to a compiler bug that breaks the ONNX runtime (unrelated to this repo), that will be fixed in CUDA 13.4. I saw no speedups vs. CPU then I realised my bottleneck was elsewhere. Then I found out I haven't downloaded the 8 bit quants for the speculative pass, I did so but then too I couldn't push it past 1 tok/s, so eventually I had no more time to debug this. I'll get back to this in the next few days, ideally I'd also want to bake in But thanks for the reminder :) I'll get back to this soon and address your points too. Right now the branch is in a bit of an unfinished state, even though technically it still builds. One problem I don't know how to solve yet is passing what GPU to compile against, Nix will build this in isolation so the build toolchain won't be able to detect a GPU the way it does with the CPU. Building in impure mode would be a workaround but a bit against the Nix philosophy IMO. |
|
builds and runs for CPU-only as expected |
Summary
Describe the problem and the smallest change that solves it.
Validation
make -C c checkmake -C c cuda-test(if applicable)Compatibility