Skip to content

Commit 07dcc4f

Browse files
committedNov 30, 2016
pythonPackages.Theano: move and rename variants
We have two derivations, one that supports Cuda, and one that does not. The names, TheanoWithCuda and TheanoWithoutCuda, now reflect that. Furthermore, a boolean passthru.cudaSupport was added. In the future the two derivations should be merged in one, with a parameter `cudaSupport`.
1 parent 2605149 commit 07dcc4f

File tree

3 files changed

+49
-31
lines changed

3 files changed

+49
-31
lines changed
 

‎pkgs/development/python-modules/theano/cuda/default.nix ‎pkgs/development/python-modules/Theano/theano-with-cuda/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{ buildPythonPackage
22
, fetchFromGitHub
3-
, blas
43
, numpy
54
, six
65
, scipy
@@ -45,7 +44,7 @@ buildPythonPackage rec {
4544
dontStrip = true;
4645

4746
propagatedBuildInputs = [
48-
blas
47+
numpy.blas
4948
numpy
5049
six
5150
scipy
@@ -59,4 +58,5 @@ buildPythonPackage rec {
5958
libgpuarray
6059
] ++ (stdenv.lib.optional (cudnn != null) [ cudnn ]);
6160

61+
passthru.cudaSupport = true;
6262
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{ stdenv
2+
, fetchurl
3+
, buildPythonPackage
4+
, isPyPy
5+
, pythonOlder
6+
, isPy3k
7+
, nose
8+
, numpy
9+
, pydot_ng
10+
, scipy
11+
, six
12+
}:
13+
14+
buildPythonPackage rec {
15+
name = "Theano-0.8.2";
16+
17+
disabled = isPyPy || pythonOlder "2.6" || (isPy3k && pythonOlder "3.3");
18+
19+
src = fetchurl {
20+
url = "mirror://pypi/T/Theano/${name}.tar.gz";
21+
sha256 = "7463c8f7ed1a787bf881f36d38a38607150186697e7ce7e78bfb94b7c6af8930";
22+
};
23+
24+
#preCheck = ''
25+
# mkdir -p check-phase
26+
# export HOME=$(pwd)/check-phase
27+
#'';
28+
doCheck = false;
29+
# takes far too long, also throws "TypeError: sort() missing 1 required positional argument: 'a'"
30+
# when run from the installer, and testing with Python 3.5 hits github.com/Theano/Theano/issues/4276,
31+
# the fix for which hasn't been merged yet.
32+
33+
# keep Nose around since running the tests by hand is possible from Python or bash
34+
propagatedBuildInputs = [ stdenv nose numpy numpy.blas pydot_ng scipy six ];
35+
36+
meta = {
37+
homepage = http://deeplearning.net/software/theano/;
38+
description = "A Python library for large-scale array computation";
39+
license = stdenv.lib.licenses.bsd3;
40+
maintainers = [ stdenv.lib.maintainers.bcdarwin ];
41+
};
42+
43+
passthru.cudaSupport = false;
44+
}

‎pkgs/top-level/python-packages.nix

+3-29
Original file line numberDiff line numberDiff line change
@@ -23350,37 +23350,11 @@ in {
2335023350
};
2335123351
};
2335223352

23353-
Theano = buildPythonPackage rec {
23354-
name = "Theano-0.8.2";
23353+
Theano = self.TheanoWithoutCuda;
2335523354

23356-
disabled = isPyPy || pythonOlder "2.6" || (isPy3k && pythonOlder "3.3");
23355+
TheanoWithoutCuda = callPackage ../development/python-modules/Theano/theano-without-cuda { };
2335723356

23358-
src = pkgs.fetchurl {
23359-
url = "mirror://pypi/T/Theano/${name}.tar.gz";
23360-
sha256 = "7463c8f7ed1a787bf881f36d38a38607150186697e7ce7e78bfb94b7c6af8930";
23361-
};
23362-
23363-
#preCheck = ''
23364-
# mkdir -p check-phase
23365-
# export HOME=$(pwd)/check-phase
23366-
#'';
23367-
doCheck = false;
23368-
# takes far too long, also throws "TypeError: sort() missing 1 required positional argument: 'a'"
23369-
# when run from the installer, and testing with Python 3.5 hits github.com/Theano/Theano/issues/4276,
23370-
# the fix for which hasn't been merged yet.
23371-
23372-
# keep Nose around since running the tests by hand is possible from Python or bash
23373-
propagatedBuildInputs = [ stdenv ] ++ (with self; [ nose numpy numpy.blas pydot_ng scipy six ]);
23374-
23375-
meta = {
23376-
homepage = http://deeplearning.net/software/theano/;
23377-
description = "A Python library for large-scale array computation";
23378-
license = stdenv.lib.licenses.bsd3;
23379-
maintainers = [ maintainers.bcdarwin ];
23380-
};
23381-
};
23382-
23383-
Theano-cuda = callPackage ../development/python-modules/theano/cuda (
23357+
TheanoWithCuda = callPackage ../development/python-modules/Theano/theano-with-cuda (
2338423358
let
2338523359
boost = pkgs.boost159.override {
2338623360
inherit (self) python numpy scipy;

4 commit comments

Comments
 (4)

tindzk commented on Nov 30, 2016

@tindzk
Contributor

Theano doesn't require CUDA. It also works with OpenCL: http://tinyfool.org/2016/04/how-to-install-theano-opencl-on-mac-os-x-ei-caption/

We might need to modify the libgpuarray package to support OpenCL.

FRidh commented on Nov 30, 2016

@FRidh
MemberAuthor

Yes, eventually the TheanoWithoutCuda should use the open OpenCL

tindzk commented on Nov 30, 2016

@tindzk
Contributor

I was thinking to name it theanoWithGpu and theanoWithoutGpu, then the former would support either OpenCL or CUDA (or both).

Alternatively, both packages could be merged and we can have two boolean options openClSupport and cudaSupport.

FRidh commented on Nov 30, 2016

@FRidh
MemberAuthor

OpenCL can be used on any system, Cuda, because it is proprietary, cannot. Therefore there has to be a derivation or option for Cuda and which is why I renamed them.

Please sign in to comment.