-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Nix flake #40
Nix flake #40
Conversation
Can you add the A single line
|
Do you plan to add support for the C++ part? BTW, I ended up using this trivial { pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz") {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
clang
black
python
python310Packages.torch-bin
python310Packages.numpy
python310Packages.sentencepiece
];
} Differences so far are, GNU Make, clang, and |
No need to include these, the C/C++ compiler and make (and even CMake I think) are already included automatically by Nix's Edit: CMake is not pre-included in |
@Dietr1ch I have added |
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.
NixOS expert here: I have tested this locally and it works perfectly.
I don't see flake-compat being used anywhere, why is it imported? |
flake-compat has to be referenced by the flake to be included in the lockfile, which |
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.
Is it possible to move these files in a subfolder?
I want root to be clean as possible
I don't think that is possible, Nix expects |
Yeah, let's drop shell/default.nix. I think we can also drop direnv - it's not necessary for running llama as nix flake. |
Done, and I added |
Rebased to the latest master commit, now the build fails in Nix:
Interestingly, this does not happen when building in my normal macOS environment without Nix. |
My guess is because The fix would be to override the stdenv for macos to use Clang 14.x. |
I tried that, it doesn't change anything. The problem appears to be the macOS SDK, not the compiler. Unfortunately, nixpkgs does not include any SDK newer than macOS 12. I suspect that Edit: it's defined in Edit 2: the function is defined in both Nix's standard Clang 11 Edit 3: Thanks to this reddit thread, I have found that |
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
The flake package is now built with CMake instead of Make and passes Also, the flake package is now using the same binary names as in CMakeLists ( |
So I am thinking this kind of deploys (together with docker #132) should probably live in a separate repo(s). The alternative is to create for example For now I think we will merge this to make it easily available during the initial interest, but later we should probably do this. |
As a person interested in a For now, having a flake.nix so that we can do |
@prusnak Merge if you approve |
…r-fix Windows console ANSI color issue fixed
This pull request adds a simple Nix Flake for building and distributing the binaries of this repository in a combined package.
The
main
binary can be executed like this (assumingexperimental-features = nix-command flakes
), for example:When merged into the main branch of this repository,
nix shell github:ggerganov/llama.cpp
would be used instead.The binary names in the Nix package are:
main
=>llama
quantize
=>quantize
convert-pth-to-ggml.py
=>convert-pth-to-ggml
Note that
convert-pth-to-ggml
directly executes in a Python 3.10 environment with the required Python packages.