mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-11 13:30:35 +00:00
9c1ba55733
* style: format with nixfmt/rfc101-style * build(nix): Package gguf-py * build(nix): Refactor to new scope for gguf-py * build(nix): Exclude gguf-py from devShells * build(nix): Refactor gguf-py derivation to take in exact deps * build(nix): Enable pytestCheckHook and pythonImportsCheck for gguf-py * build(python): Package python scripts with pyproject.toml * chore: Cleanup * dev(nix): Break up python/C devShells * build(python): Relax pytorch version constraint Nix has an older version * chore: Move cmake to nativeBuildInputs for devShell * fmt: Reconcile formatting with rebase * style: nix fmt * cleanup: Remove unncessary __init__.py * chore: Suggestions from review - Filter out non-source files from llama-scripts flake derivation - Clean up unused closure - Remove scripts devShell * revert: Bad changes * dev: Simplify devShells, restore the -extra devShell * build(nix): Add pyyaml for gguf-py * chore: Remove some unused bindings * dev: Add tiktoken to -extra devShells
46 lines
1.6 KiB
Nix
46 lines
1.6 KiB
Nix
{ 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 = {
|
|
# Note: bringing up https://zimbatm.com/notes/1000-instances-of-nixpkgs
|
|
# again, the below creates several nixpkgs instances which the
|
|
# flake-centric CLI will be forced to evaluate e.g. on `nix flake show`.
|
|
#
|
|
# This is currently "slow" and "expensive", on a certain scale.
|
|
# This also isn't "right" in that this hinders dependency injection at
|
|
# the level of flake inputs. This might get removed in the foreseeable
|
|
# future.
|
|
#
|
|
# Note that you can use these expressions without Nix
|
|
# (`pkgs.callPackage ./devops/nix/scope.nix { }` is the entry point).
|
|
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
}
|