Skip to content

Commit 63ac36b

Browse files
committed
Merge branch 'master' into compilade/refactor-kv-cache
2 parents 4bb4b22 + 822b632 commit 63ac36b

File tree

144 files changed

+11352
-6701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+11352
-6701
lines changed

.devops/full-cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
2727
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
2828
fi && \
2929
cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
30-
cmake --build build --config Release --target llama-cli -j$(nproc) && \
30+
cmake --build build --config Release -j$(nproc) && \
3131
cp build/bin/* .
3232

3333
ENTRYPOINT ["/app/.devops/tools.sh"]

.devops/nix/devshells.nix

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,52 @@
1+
{ inputs, ... }:
2+
13
{
24
perSystem =
3-
{ config, lib, ... }:
5+
{
6+
config,
7+
lib,
8+
system,
9+
...
10+
}:
411
{
512
devShells =
6-
lib.concatMapAttrs
7-
(name: package: {
8-
${name} = package.passthru.shell;
9-
${name + "-extra"} = package.passthru.shell-extra;
10-
})
11-
config.packages;
13+
let
14+
pkgs = import inputs.nixpkgs { inherit system; };
15+
stdenv = pkgs.stdenv;
16+
scripts = config.packages.python-scripts;
17+
in
18+
lib.pipe (config.packages) [
19+
(lib.concatMapAttrs (
20+
name: package: {
21+
${name} = pkgs.mkShell {
22+
name = "${name}";
23+
inputsFrom = [ package ];
24+
shellHook = ''
25+
echo "Entering ${name} devShell"
26+
'';
27+
};
28+
"${name}-extra" =
29+
if (name == "python-scripts") then
30+
null
31+
else
32+
pkgs.mkShell {
33+
name = "${name}-extra";
34+
inputsFrom = [
35+
package
36+
scripts
37+
];
38+
# Extra packages that *may* be used by some scripts
39+
packages = [
40+
pkgs.python3Packages.tiktoken
41+
];
42+
shellHook = ''
43+
echo "Entering ${name} devShell"
44+
addToSearchPath "LD_LIBRARY_PATH" "${lib.getLib stdenv.cc.cc}/lib"
45+
'';
46+
};
47+
}
48+
))
49+
(lib.filterAttrs (name: value: value != null))
50+
];
1251
};
1352
}

.devops/nix/nixpkgs-instances.nix

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@
2626
config.cudaSupport = true;
2727
config.allowUnfreePredicate =
2828
p:
29-
builtins.all
30-
(
31-
license:
32-
license.free
33-
|| builtins.elem license.shortName [
34-
"CUDA EULA"
35-
"cuDNN EULA"
36-
]
37-
)
38-
(p.meta.licenses or [ p.meta.license ]);
29+
builtins.all (
30+
license:
31+
license.free
32+
|| builtins.elem license.shortName [
33+
"CUDA EULA"
34+
"cuDNN EULA"
35+
]
36+
) (p.meta.licenses or [ p.meta.license ]);
3937
};
4038
# Ensure dependencies use ROCm consistently
4139
pkgsRocm = import inputs.nixpkgs {

.devops/nix/package-gguf-py.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
lib,
3+
llamaVersion,
4+
numpy,
5+
tqdm,
6+
sentencepiece,
7+
pyyaml,
8+
poetry-core,
9+
buildPythonPackage,
10+
pytestCheckHook,
11+
}:
12+
13+
buildPythonPackage {
14+
pname = "gguf";
15+
version = llamaVersion;
16+
pyproject = true;
17+
nativeBuildInputs = [ poetry-core ];
18+
propagatedBuildInputs = [
19+
numpy
20+
tqdm
21+
sentencepiece
22+
pyyaml
23+
];
24+
src = lib.cleanSource ../../gguf-py;
25+
pythonImportsCheck = [
26+
"numpy"
27+
"gguf"
28+
];
29+
nativeCheckInputs = [ pytestCheckHook ];
30+
doCheck = true;
31+
meta = with lib; {
32+
description = "Python package for writing binary files in the GGUF format";
33+
license = licenses.mit;
34+
maintainers = [ maintainers.ditsuke ];
35+
};
36+
}

0 commit comments

Comments
 (0)