This repository has been archived by the owner on Apr 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
{ pkgs ? import ../pin/nixpkgs.nix {} }: | ||
{ pkgs ? import ../pin/nixpkgs.nix {}, python ? pkgs.python36 }: | ||
|
||
let | ||
my_cudatoolkit = pkgs.cudatoolkit_10_0; | ||
my_cudnn = pkgs.cudnn_cudatoolkit_10_0; | ||
my_nccl = pkgs.nccl_cudatoolkit_10; | ||
mklSupport = true; | ||
|
||
my_magma = pkgs.callPackage ../deps/magma_250.nix { | ||
inherit mklSupport; | ||
cudatoolkit = my_cudatoolkit; | ||
}; | ||
|
||
mypackageOverrides = gpu: self: super: | ||
let | ||
pytorch36-cpu = (self.callPackage ../pytorch/release.nix {}).pytorch36-vanilla; | ||
pytorch36-cu = (self.callPackage ../pytorch/release.nix {}).pytorch36-cu; | ||
pytorch = if gpu then pytorch36-cu else pytorch36-cpu; | ||
probtorch = self.callPackage ./. { inherit (pkgs.python36Packages) buildPythonPackage; inherit pytorch; }; | ||
pytorchFull = self.callPackage ../pytorch { | ||
inherit mklSupport; | ||
openMPISupport = true; openmpi = pkgs.callPackage ../deps/openmpi.nix { }; | ||
buildNamedTensor = true; | ||
buildBinaries = true; | ||
}; | ||
|
||
pytorchWithCuda10Full = self.callPackage ../pytorch { | ||
inherit mklSupport; | ||
openMPISupport = true; openmpi = pkgs.callPackage ../deps/openmpi.nix { cudaSupport = true; cudatoolkit = my_cudatoolkit; }; | ||
cudaSupport = true; cudatoolkit = my_cudatoolkit; cudnn = my_cudnn; nccl = my_nccl; magma = my_magma; | ||
buildNamedTensor = true; | ||
buildBinaries = true; | ||
}; | ||
|
||
pytorch = if gpu then pytorchWithCuda10Full else pytorchFull; | ||
probtorch = self.callPackage ./. { inherit pytorch; }; | ||
in | ||
{ inherit probtorch pytorch; }; | ||
|
||
generic36 = { gpu }: | ||
generic = { gpu }: | ||
let | ||
mypython = pkgs.python36.override { | ||
mypython = python.override { | ||
packageOverrides = mypackageOverrides gpu; | ||
self = mypython; | ||
}; | ||
in mypython.withPackages (ps: [ ps.pytorch ps.probtorch ]); | ||
in | ||
{ | ||
probtorch36-cpu = generic36 { gpu = false; }; | ||
probtorch36-cu = generic36 { gpu = true; }; | ||
probtorch = generic { gpu = false; }; | ||
probtorchWithCuda = generic { gpu = true; }; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ pkgs ? import ./pin/nixpkgs.nix {} }: | ||
{ pkgs ? import ./pin/nixpkgs.nix {}, python ? pkgs.python36 }: | ||
|
||
let | ||
pytorch-releases = pkgs.callPackage ./pytorch/release.nix { }; | ||
probtorch-releases = pkgs.callPackage ./probtorch/release.nix { }; | ||
libtorch-releases = pkgs.callPackage ./libtorch/release.nix { }; | ||
pytorch-releases = pkgs.callPackage ./pytorch/release.nix { inherit python; }; | ||
probtorch-releases = pkgs.callPackage ./probtorch/release.nix { inherit python; }; | ||
in | ||
{ | ||
inherit (libtorch-releases) libtorch_cpu libtorch_cudatoolkit_10_0; | ||
inherit (pytorch-releases) | ||
# cpu builds | ||
pytorch pytorch-mkl pytorch-openmpi pytorch-mkl-openmpi pytorchFull | ||
# cuda dependencies | ||
magma_250 magma_250mkl | ||
# cuda builds | ||
pytorch-cu pytorch-cu-mkl pytorch-cu-mkl-openmpi pytorchWithCuda10Full | ||
; | ||
|
||
inherit (pytorch-releases) magma_250 pytorch36 pytorch36-mkl-openmpi pytorch36-cu-mkl | ||
pytorch36-openmpi = generic { | ||
pytorch36-mkl-openmpi | ||
pytorch36-cu-mkl-openmpi-implicit = generic { | ||
pytorch36-cu-mkl-openmpi-implicit-extras = generic { | ||
|
||
inherit (probtorch-releases) probtorch36-cpu probtorch36-cu; | ||
inherit (probtorch-releases) probtorch probtorchWithCuda; | ||
} |