Skip to content

Commit 918c333

Browse files
committed
Merge upstream changes, fix staging buffer usage
2 parents 7b36cea + 24a447e commit 918c333

File tree

90 files changed

+6433
-3504
lines changed

Some content is hidden

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

90 files changed

+6433
-3504
lines changed

.devops/full-cuda.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ARG CUDA_DOCKER_ARCH=all
1414
RUN apt-get update && \
1515
apt-get install -y build-essential python3 python3-pip git
1616

17-
COPY requirements.txt requirements.txt
17+
COPY requirements.txt requirements.txt
18+
COPY requirements requirements
1819

1920
RUN pip install --upgrade pip setuptools wheel \
2021
&& pip install -r requirements.txt

.devops/full-rocm.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ ARG ROCM_DOCKER_ARCH=\
2323
gfx1101 \
2424
gfx1102
2525

26-
COPY requirements.txt requirements.txt
26+
COPY requirements.txt requirements.txt
27+
COPY requirements requirements
2728

2829
RUN pip install --upgrade pip setuptools wheel \
2930
&& pip install -r requirements.txt

.devops/full.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM ubuntu:$UBUNTU_VERSION as build
55
RUN apt-get update && \
66
apt-get install -y build-essential python3 python3-pip git
77

8-
COPY requirements.txt requirements.txt
8+
COPY requirements.txt requirements.txt
9+
COPY requirements requirements
910

1011
RUN pip install --upgrade pip setuptools wheel \
1112
&& pip install -r requirements.txt

.devops/main-rocm.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ ARG ROCM_DOCKER_ARCH=\
2323
gfx1101 \
2424
gfx1102
2525

26-
COPY requirements.txt requirements.txt
26+
COPY requirements.txt requirements.txt
27+
COPY requirements requirements
2728

2829
RUN pip install --upgrade pip setuptools wheel \
2930
&& pip install -r requirements.txt

.devops/nix/apps.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
perSystem =
3+
{ config, lib, ... }:
4+
{
5+
apps =
6+
let
7+
inherit (config.packages) default;
8+
binaries = [
9+
"llama"
10+
"llama-embedding"
11+
"llama-server"
12+
"quantize"
13+
"train-text-from-scratch"
14+
];
15+
mkApp = name: {
16+
type = "app";
17+
program = "${default}/bin/${name}";
18+
};
19+
in
20+
lib.genAttrs binaries mkApp;
21+
};
22+
}

.devops/nix/devshells.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
perSystem =
3+
{ config, lib, ... }:
4+
{
5+
devShells =
6+
lib.concatMapAttrs
7+
(name: package: {
8+
${name} = package.passthru.shell;
9+
${name + "-extra"} = package.passthru.shell-extra;
10+
})
11+
config.packages;
12+
};
13+
}

.devops/nix/jetson-support.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{ inputs, ... }:
2+
{
3+
perSystem =
4+
{
5+
config,
6+
system,
7+
lib,
8+
pkgsCuda,
9+
...
10+
}:
11+
lib.optionalAttrs (system == "aarch64-linux") {
12+
packages =
13+
let
14+
caps.jetson-xavier = "7.2";
15+
caps.jetson-orin = "8.7";
16+
caps.jetson-nano = "5.3";
17+
18+
pkgsFor =
19+
cap:
20+
import inputs.nixpkgs {
21+
inherit system;
22+
config = {
23+
cudaSupport = true;
24+
cudaCapabilities = [ cap ];
25+
cudaEnableForwardCompat = false;
26+
inherit (pkgsCuda.config) allowUnfreePredicate;
27+
};
28+
};
29+
in
30+
builtins.mapAttrs (name: cap: ((pkgsFor cap).callPackage ./scope.nix { }).llama-cpp) caps;
31+
};
32+
}

.devops/nix/nixpkgs-instances.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{ inputs, ... }:
2+
{
3+
# The _module.args definitions are passed on to modules as arguments. E.g.
4+
# the module `{ pkgs ... }: { /* config */ }` implicitly uses
5+
# `_module.args.pkgs` (defined in this case by flake-parts).
6+
perSystem =
7+
{ system, ... }:
8+
{
9+
_module.args = {
10+
pkgsCuda = import inputs.nixpkgs {
11+
inherit system;
12+
# Ensure dependencies use CUDA consistently (e.g. that openmpi, ucc,
13+
# and ucx are built with CUDA support)
14+
config.cudaSupport = true;
15+
config.allowUnfreePredicate =
16+
p:
17+
builtins.all
18+
(
19+
license:
20+
license.free
21+
|| builtins.elem license.shortName [
22+
"CUDA EULA"
23+
"cuDNN EULA"
24+
]
25+
)
26+
(p.meta.licenses or [ p.meta.license ]);
27+
};
28+
# Ensure dependencies use ROCm consistently
29+
pkgsRocm = import inputs.nixpkgs {
30+
inherit system;
31+
config.rocmSupport = true;
32+
};
33+
};
34+
};
35+
}

0 commit comments

Comments
 (0)