cntk: 2.2 -> 2.4

Comment for `broken` indicates that it never worked at all, which is strange
since on my machine it did. Anyway it works now for me.
This commit is contained in:
Nikolay Amiantov 2018-02-25 19:58:21 +03:00
parent 605a4d4eed
commit 1bfca90bf7
4 changed files with 34 additions and 18 deletions

View File

@ -12,28 +12,22 @@ let
cub = fetchFromGitHub { cub = fetchFromGitHub {
owner = "NVlabs"; owner = "NVlabs";
repo = "cub"; repo = "cub";
rev = "1.4.1"; rev = "1.7.4";
sha256 = "1lcdwblz03c0yq1lxndg566kg14b5qm14x5qixjbmz6wq85kgmqc"; sha256 = "0ksd5n1lxqhm5l5cd2lps4cszhjkf6gmzahaycs7nxb06qci8c66";
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "CNTK-${version}"; name = "CNTK-${version}";
version = "2.2"; version = "2.4";
# Submodules # Submodules
src = fetchgit { src = fetchgit {
url = "https://github.com/Microsoft/CNTK"; url = "https://github.com/Microsoft/CNTK";
rev = "v${version}"; rev = "v${version}";
sha256 = "0q4knrwiyphb2fbqf9jzqvkz2jzj6jmbmang3lavdvsh7z0n8zz9"; sha256 = "0m28wb0ljixcpi14g3gcfiraimh487yxqhd9yrglgyvjb69x597y";
}; };
patches = [ patches = [ ./fix_std_bind.patch ];
# Fix "'exp' was not declared"
(fetchpatch {
url = "https://github.com/imriss/CNTK/commit/ef1cca6df95cc507deb8471df2c0dd8cbfeef23b.patch";
sha256 = "0z7xyrxwric0c4h7rfs05f544mcq6d10wgs0vvfcyd2pcf410hy7";
})
];
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
@ -50,6 +44,8 @@ in stdenv.mkDerivation rec {
"--with-mpi=${openmpi}" "--with-mpi=${openmpi}"
] ++ lib.optionals cudaSupport [ ] ++ lib.optionals cudaSupport [
"--cuda=yes" "--cuda=yes"
# FIXME
"--asgd=no"
"--with-cuda=${cudatoolkit}" "--with-cuda=${cudatoolkit}"
"--with-gdk-include=${cudatoolkit}/include" "--with-gdk-include=${cudatoolkit}/include"
"--with-gdk-nvml-lib=${nvidia_x11}/lib" "--with-gdk-nvml-lib=${nvidia_x11}/lib"
@ -85,16 +81,12 @@ in stdenv.mkDerivation rec {
cp bin/cntk $out/bin cp bin/cntk $out/bin
''; '';
hardeningDisable = [ "format" ]; enableParallelBuilding = true;
# on 2.2: fatal error: tensorboard/tensorboard.pb.h: No such file or directory
enableParallelBuilding = false;
meta = with lib; { meta = with lib; {
homepage = https://github.com/Microsoft/CNTK; homepage = https://github.com/Microsoft/CNTK;
description = "An open source deep-learning toolkit"; description = "An open source deep-learning toolkit";
license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit; license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit;
maintainers = with maintainers; [ abbradar ]; maintainers = with maintainers; [ abbradar ];
broken = true; # Never succeeded to build.
}; };
} }

View File

@ -0,0 +1,11 @@
diff -ru3 CNTK-old/Source/CNTKv2LibraryDll/EvaluatorWrapper.h CNTK-new/Source/CNTKv2LibraryDll/EvaluatorWrapper.h
--- CNTK-old/Source/CNTKv2LibraryDll/EvaluatorWrapper.h 1970-01-01 03:00:01.000000000 +0300
+++ CNTK-new/Source/CNTKv2LibraryDll/EvaluatorWrapper.h 2018-02-25 18:16:16.330269647 +0300
@@ -9,6 +9,7 @@
#include <boost/noncopyable.hpp>
#include <memory>
#include <vector>
+#include <functional>
#include "CNTKLibrary.h"
#include "CNTKLibraryC.h"

View File

@ -19744,14 +19744,20 @@ with pkgs;
inherit (python3Packages) python future six numpy pydot; inherit (python3Packages) python future six numpy pydot;
protobuf = protobuf3_1; protobuf = protobuf3_1;
python-protobuf = python3Packages.protobuf3_1; python-protobuf = python3Packages.protobuf3_1;
# Used only for image loading.
opencv3 = self.opencv3.override {
enableCuda = false;
};
}; };
cntk = callPackage ../applications/science/math/cntk rec { cntk = callPackage ../applications/science/math/cntk rec {
cudaSupport = pkgs.config.cudaSupport or false; cudaSupport = pkgs.config.cudaSupport or false;
cudnnSupport = cudaSupport; cudnnSupport = cudaSupport;
inherit (linuxPackages) nvidia_x11; inherit (linuxPackages) nvidia_x11;
cudatoolkit = cudatoolkit8; # Used only for image loading.
cudnn = cudnn6_cudatoolkit8; opencv3 = self.opencv3.override {
enableCuda = false;
};
}; };
ecm = callPackage ../applications/science/math/ecm { }; ecm = callPackage ../applications/science/math/ecm { };

View File

@ -2225,6 +2225,7 @@ in {
postPatch = '' postPatch = ''
cd bindings/python cd bindings/python
sed -i 's,"libmpi.so.12","${pkgs.openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
''; '';
postInstall = '' postInstall = ''
@ -2233,6 +2234,12 @@ in {
# It's not installed for some reason. # It's not installed for some reason.
cp cntk/cntk_py.py $out/${python.sitePackages}/cntk cp cntk/cntk_py.py $out/${python.sitePackages}/cntk
''; '';
# Actual tests are broken.
checkPhase = ''
cd $NIX_BUILD_TOP
${python.interpreter} -c "import cntk"
'';
}; };
celery = callPackage ../development/python-modules/celery { pytest = self.pytest_32; }; celery = callPackage ../development/python-modules/celery { pytest = self.pytest_32; };