-
Notifications
You must be signed in to change notification settings - Fork 233
/
flake.nix
156 lines (144 loc) · 4.28 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
description = "A framework for automatic performance optimization of DNN training and inference";
nixConfig = {
bash-prompt-prefix = "(ff) ";
extra-substituters = [
"https://ff.cachix.org"
"https://cuda-maintainers.cachix.org/"
];
extra-trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
"ff.cachix.org-1:/kyZ0w35ToSJBjpiNfPLrL3zTjuPkUiqf2WH0GIShXM="
];
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
proj-repo = {
url = "github:lockshaw/proj";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, proj-repo, ... }: flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = pkgs.lib;
mkShell = pkgs.mkShell.override {
stdenv = pkgs.cudaPackages.backendStdenv;
};
in
{
packages = {
legion = pkgs.callPackage ./.flake/pkgs/legion.nix { };
hpp2plantuml = pkgs.python3Packages.callPackage ./.flake/pkgs/hpp2plantuml.nix { };
rapidcheckFull = pkgs.symlinkJoin {
name = "rapidcheckFull";
paths = (with pkgs; [ rapidcheck.out rapidcheck.dev ]);
};
doctest = pkgs.doctest.overrideAttrs ( old: rec {
version = "2.4.9";
src = pkgs.fetchFromGitHub {
owner = "doctest";
repo = "doctest";
rev = "v${version}";
sha256 = "sha256-ugmkeX2PN4xzxAZpWgswl4zd2u125Q/ADSKzqTfnd94=";
};
patches = [
./.flake/patches/doctest-template-test.patch
];
});
};
devShells = rec {
ci = mkShell {
shellHook = ''
export PATH="$HOME/ff/.scripts/:$PATH"
'';
CMAKE_FLAGS = lib.strings.concatStringsSep " " [
"-DFF_USE_EXTERNAL_LEGION=ON"
"-DFF_USE_EXTERNAL_NCCL=ON"
"-DFF_USE_EXTERNAL_JSON=ON"
"-DFF_USE_EXTERNAL_FMT=ON"
"-DFF_USE_EXTERNAL_SPDLOG=ON"
"-DFF_USE_EXTERNAL_DOCTEST=ON"
"-DFF_USE_EXTERNAL_RAPIDCHECK=ON"
"-DFF_USE_EXTERNAL_EXPECTED=ON"
"-DFF_USE_EXTERNAL_RANGEV3=ON"
"-DFF_USE_EXTERNAL_BOOST_PREPROCESSOR=ON"
"-DFF_USE_EXTERNAL_TYPE_INDEX=ON"
];
RC_PARAMS = "max_discard_ratio=100";
buildInputs = builtins.concatLists [
(with pkgs; [
zlib
boost
nlohmann_json
spdlog
range-v3
fmt
cmakeCurses
ccache
pkg-config
python3
cudatoolkit
cudaPackages.cuda_nvcc
cudaPackages.cudnn
cudaPackages.nccl
cudaPackages.libcublas
cudaPackages.cuda_cudart
tl-expected
doxygen
lcov # for code coverage
])
(with proj-repo.packages.${system}; [
proj
])
(with self.packages.${system}; [
legion
hpp2plantuml
rapidcheckFull
doctest
])
];
};
default = mkShell {
inputsFrom = [ ci ];
inherit (ci) CMAKE_FLAGS RC_PARAMS;
VIMPLUGINS = lib.strings.concatStringsSep "," [
"${proj-repo.packages.${system}.proj-nvim}"
];
buildInputs = builtins.concatLists [
(with pkgs; [
clang-tools
gh-markdown-preview
shellcheck
plantuml
gdb
ruff
compdb
jq
gh
lcov # for code coverage
])
(with pkgs.python3Packages; [
gitpython
ipython
mypy
python-lsp-server
pylsp-mypy
python-lsp-ruff
pygithub
sqlitedict
frozendict
black
toml
])
];
};
};
}
);
}