forked from ggerganov/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
243 changed files
with
44,804 additions
and
18,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
perSystem = | ||
{ config, lib, ... }: | ||
{ | ||
apps = | ||
let | ||
inherit (config.packages) default; | ||
binaries = [ | ||
"llama" | ||
"llama-embedding" | ||
"llama-server" | ||
"quantize" | ||
"train-text-from-scratch" | ||
]; | ||
mkApp = name: { | ||
type = "app"; | ||
program = "${default}/bin/${name}"; | ||
}; | ||
in | ||
lib.genAttrs binaries mkApp; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
perSystem = | ||
{ config, lib, ... }: | ||
{ | ||
devShells = | ||
lib.concatMapAttrs | ||
(name: package: { | ||
${name} = package.passthru.shell; | ||
${name + "-extra"} = package.passthru.shell-extra; | ||
}) | ||
config.packages; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ inputs, ... }: | ||
{ | ||
perSystem = | ||
{ | ||
config, | ||
system, | ||
lib, | ||
pkgsCuda, | ||
... | ||
}: | ||
{ | ||
legacyPackages = | ||
let | ||
caps.llamaPackagesXavier = "7.2"; | ||
caps.llamaPackagesOrin = "8.7"; | ||
caps.llamaPackagesTX2 = "6.2"; | ||
caps.llamaPackagesNano = "5.3"; | ||
|
||
pkgsFor = | ||
cap: | ||
import inputs.nixpkgs { | ||
inherit system; | ||
config = { | ||
cudaSupport = true; | ||
cudaCapabilities = [ cap ]; | ||
cudaEnableForwardCompat = false; | ||
inherit (pkgsCuda.config) allowUnfreePredicate; | ||
}; | ||
}; | ||
in | ||
builtins.mapAttrs (name: cap: (pkgsFor cap).callPackage ./scope.nix { }) caps; | ||
|
||
packages = lib.optionalAttrs (system == "aarch64-linux") { | ||
jetson-xavier = config.legacyPackages.llamaPackagesXavier.llama-cpp; | ||
jetson-orin = config.legacyPackages.llamaPackagesOrin.llama-cpp; | ||
jetson-nano = config.legacyPackages.llamaPackagesNano.llama-cpp; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ inputs, ... }: | ||
{ | ||
# The _module.args definitions are passed on to modules as arguments. E.g. | ||
# the module `{ pkgs ... }: { /* config */ }` implicitly uses | ||
# `_module.args.pkgs` (defined in this case by flake-parts). | ||
perSystem = | ||
{ system, ... }: | ||
{ | ||
_module.args = { | ||
pkgsCuda = import inputs.nixpkgs { | ||
inherit system; | ||
# Ensure dependencies use CUDA consistently (e.g. that openmpi, ucc, | ||
# and ucx are built with CUDA support) | ||
config.cudaSupport = true; | ||
config.allowUnfreePredicate = | ||
p: | ||
builtins.all | ||
( | ||
license: | ||
license.free | ||
|| builtins.elem license.shortName [ | ||
"CUDA EULA" | ||
"cuDNN EULA" | ||
] | ||
) | ||
(p.meta.licenses or [ p.meta.license ]); | ||
}; | ||
# Ensure dependencies use ROCm consistently | ||
pkgsRocm = import inputs.nixpkgs { | ||
inherit system; | ||
config.rocmSupport = true; | ||
}; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.