mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-06-09 02:42:05 +00:00
Nix: switch to hf-nix (#3240)
* Nix: switch to hf-nix * Remove outdated local overrides
This commit is contained in:
parent
f08b44ade5
commit
f58d7cf50e
2
.github/workflows/nix_build.yaml
vendored
2
.github/workflows/nix_build.yaml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- uses: cachix/cachix-action@v14
|
- uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
name: text-generation-inference
|
name: huggingface
|
||||||
# If you chose signing key for write access
|
# If you chose signing key for write access
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
env:
|
env:
|
||||||
|
2
.github/workflows/nix_cache.yaml
vendored
2
.github/workflows/nix_cache.yaml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- uses: cachix/cachix-action@v14
|
- uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
name: text-generation-inference
|
name: huggingface
|
||||||
# If you chose signing key for write access
|
# If you chose signing key for write access
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
env:
|
env:
|
||||||
|
2
.github/workflows/nix_tests.yaml
vendored
2
.github/workflows/nix_tests.yaml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- uses: cachix/cachix-action@v14
|
- uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
name: text-generation-inference
|
name: huggingface
|
||||||
# If you chose signing key for write access
|
# If you chose signing key for write access
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
env:
|
env:
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
FROM nixos/nix:2.18.8 AS builder
|
FROM nixos/nix:2.18.8 AS builder
|
||||||
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||||
RUN nix profile install nixpkgs#cachix
|
RUN nix profile install nixpkgs#cachix
|
||||||
RUN cachix use text-generation-inference
|
RUN cachix use huggingface
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
ADD . .
|
ADD . .
|
||||||
RUN nix build .
|
RUN nix build .
|
||||||
|
@ -256,7 +256,7 @@ Another option is to install `text-generation-inference` locally using [Nix](htt
|
|||||||
we only support Nix on x86_64 Linux with CUDA GPUs. When using Nix, all dependencies can
|
we only support Nix on x86_64 Linux with CUDA GPUs. When using Nix, all dependencies can
|
||||||
be pulled from a binary cache, removing the need to build them locally.
|
be pulled from a binary cache, removing the need to build them locally.
|
||||||
|
|
||||||
First follow the instructions to [install Cachix and enable the TGI cache](https://app.cachix.org/cache/text-generation-inference).
|
First follow the instructions to [install Cachix and enable the Hugging Face cache](https://app.cachix.org/cache/huggingface).
|
||||||
Setting up the cache is important, otherwise Nix will build many of the dependencies
|
Setting up the cache is important, otherwise Nix will build many of the dependencies
|
||||||
locally, which can take hours.
|
locally, which can take hours.
|
||||||
|
|
||||||
|
59
flake.lock
59
flake.lock
@ -102,7 +102,7 @@
|
|||||||
"flake-parts": "flake-parts_3",
|
"flake-parts": "flake-parts_3",
|
||||||
"nix-test-runner": "nix-test-runner_3",
|
"nix-test-runner": "nix-test-runner_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"tgi-nix",
|
"hf-nix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"pre-commit-hooks": "pre-commit-hooks_3"
|
"pre-commit-hooks": "pre-commit-hooks_3"
|
||||||
@ -579,6 +579,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hf-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_4",
|
||||||
|
"flake-utils": "flake-utils_7",
|
||||||
|
"nixpkgs": "nixpkgs_6"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747919133,
|
||||||
|
"narHash": "sha256-VvF1naQOvv7yulQ5/cDiaxkNxlh1Y84QMZnderv1szk=",
|
||||||
|
"owner": "huggingface",
|
||||||
|
"repo": "hf-nix",
|
||||||
|
"rev": "9c71e026d6c7c8588ef85a5f7c77f57d598e038c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "huggingface",
|
||||||
|
"repo": "hf-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-filter": {
|
"nix-filter": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533336,
|
"lastModified": 1731533336,
|
||||||
@ -718,16 +738,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746711195,
|
"lastModified": 1747820358,
|
||||||
"narHash": "sha256-bSpM2ySq12PBOVN7jZdzXsc99iRoYOyolh5wz43+CjQ=",
|
"narHash": "sha256-fTqsZsUX6M3yeEvgyQvXcbGmT2CaRVyVwsi8eK29Oj4=",
|
||||||
"owner": "danieldk",
|
"owner": "danieldk",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6b7a66b06ccb09ac95872ac6ddf952e0660672ab",
|
"rev": "d3c1681180717528068082103bf323147de6ab0b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "danieldk",
|
"owner": "danieldk",
|
||||||
"ref": "kernel-builder-cuda-12.9.0",
|
"ref": "cudatoolkit-12.9-kernel-builder",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -836,19 +856,19 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"crate2nix": "crate2nix",
|
"crate2nix": "crate2nix",
|
||||||
"flake-utils": "flake-utils_6",
|
"flake-utils": "flake-utils_6",
|
||||||
|
"hf-nix": "hf-nix",
|
||||||
"nix-filter": "nix-filter",
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"tgi-nix",
|
"hf-nix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"rust-overlay": "rust-overlay",
|
"rust-overlay": "rust-overlay"
|
||||||
"tgi-nix": "tgi-nix"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"tgi-nix",
|
"hf-nix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -970,27 +990,6 @@
|
|||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"tgi-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat_4",
|
|
||||||
"flake-utils": "flake-utils_7",
|
|
||||||
"nixpkgs": "nixpkgs_6"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1747733488,
|
|
||||||
"narHash": "sha256-LYov4H9zvqXXlFKdytcVcDioH416c+LWfyw/HWta0qw=",
|
|
||||||
"owner": "huggingface",
|
|
||||||
"repo": "text-generation-inference-nix",
|
|
||||||
"rev": "61c730990efa58e64c652bf15253aae47dd0f7dd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "huggingface",
|
|
||||||
"ref": "merge-with-kernel-builder",
|
|
||||||
"repo": "text-generation-inference-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
14
flake.nix
14
flake.nix
@ -2,15 +2,15 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
crate2nix = {
|
crate2nix = {
|
||||||
url = "github:nix-community/crate2nix";
|
url = "github:nix-community/crate2nix";
|
||||||
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
|
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
|
||||||
};
|
};
|
||||||
nix-filter.url = "github:numtide/nix-filter";
|
nix-filter.url = "github:numtide/nix-filter";
|
||||||
tgi-nix.url = "github:huggingface/text-generation-inference-nix/merge-with-kernel-builder";
|
hf-nix.url = "github:huggingface/hf-nix";
|
||||||
nixpkgs.follows = "tgi-nix/nixpkgs";
|
nixpkgs.follows = "hf-nix/nixpkgs";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
url = "github:oxalica/rust-overlay";
|
url = "github:oxalica/rust-overlay";
|
||||||
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
|
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
@ -21,7 +21,7 @@
|
|||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
rust-overlay,
|
rust-overlay,
|
||||||
tgi-nix,
|
hf-nix,
|
||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
system:
|
system:
|
||||||
@ -33,10 +33,10 @@
|
|||||||
};
|
};
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
inherit (tgi-nix.lib) config;
|
inherit (hf-nix.lib) config;
|
||||||
overlays = [
|
overlays = [
|
||||||
rust-overlay.overlays.default
|
rust-overlay.overlays.default
|
||||||
tgi-nix.overlays.default
|
hf-nix.overlays.default
|
||||||
(import nix/overlay.nix)
|
(import nix/overlay.nix)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -13,26 +13,26 @@ final: prev: {
|
|||||||
(
|
(
|
||||||
python-self: python-super: with python-self; {
|
python-self: python-super: with python-self; {
|
||||||
# Python package override example:
|
# Python package override example:
|
||||||
transformers = python-super.transformers.overrideAttrs (
|
#transformers = python-super.transformers.overrideAttrs (
|
||||||
_: _: {
|
# _: _: {
|
||||||
src = final.fetchFromGitHub {
|
# src = final.fetchFromGitHub {
|
||||||
owner = "huggingface";
|
# owner = "huggingface";
|
||||||
repo = "transformers";
|
# repo = "transformers";
|
||||||
rev = "v4.51.0";
|
# rev = "v4.51.0";
|
||||||
hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
|
# hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
|
||||||
};
|
# };
|
||||||
}
|
# }
|
||||||
);
|
#);
|
||||||
huggingface-hub = python-super.huggingface-hub.overrideAttrs (
|
#huggingface-hub = python-super.huggingface-hub.overrideAttrs (
|
||||||
_: _: {
|
# _: _: {
|
||||||
src = final.fetchFromGitHub {
|
# src = final.fetchFromGitHub {
|
||||||
owner = "huggingface";
|
# owner = "huggingface";
|
||||||
repo = "huggingface_hub";
|
# repo = "huggingface_hub";
|
||||||
rev = "v0.30.0";
|
# rev = "v0.30.0";
|
||||||
hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
|
# hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
|
||||||
};
|
# };
|
||||||
}
|
# }
|
||||||
);
|
#);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user