perf(kyojin): Skip prefix segments that cannot fit on disk
Bead: nix-overlay-tb3
This commit is contained in:
@@ -1,10 +1,26 @@
|
||||
{
|
||||
pkgs,
|
||||
kyojin,
|
||||
exllamav3,
|
||||
jitCheck,
|
||||
cpuCheck,
|
||||
}:
|
||||
let
|
||||
admissionPatch = ./prefix-disk-admission.patch;
|
||||
engine = exllamav3.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [ admissionPatch ];
|
||||
});
|
||||
# Both the upstream serve wrappers and the CPU check prepend the wheel to PYTHONPATH.
|
||||
withEngine =
|
||||
script:
|
||||
let
|
||||
updated = builtins.replaceStrings [ "${exllamav3}/" ] [ "${engine}/" ] script;
|
||||
in
|
||||
assert updated != script;
|
||||
updated;
|
||||
in
|
||||
kyojin.overrideAttrs (old: {
|
||||
installPhase = withEngine old.installPhase;
|
||||
# Upstream installs tools directly from $src, bypassing the unpacked tree.
|
||||
src = pkgs.applyPatches {
|
||||
src = old.src;
|
||||
@@ -19,7 +35,10 @@ kyojin.overrideAttrs (old: {
|
||||
category = "AI Inference";
|
||||
tests = (old.passthru.tests or { }) // {
|
||||
jit = jitCheck;
|
||||
cpu = cpuCheck;
|
||||
cpu = cpuCheck.overrideAttrs (check: {
|
||||
patches = (check.patches or [ ]) ++ [ admissionPatch ];
|
||||
checkPhase = withEngine check.checkPhase;
|
||||
});
|
||||
};
|
||||
};
|
||||
postFixup = ''
|
||||
|
||||
Reference in New Issue
Block a user