git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #154115 from ndl/submit/elegy

python3Packages.elegy: init at 0.8.4

commitae69ff6554c0a4ab6e396cc2b5dd15aaa6d40ef3 authorSamuel Ainsworth <skainsworth@gmail.com> dateMon 10 Jan 2022, 12:32 (5 years ago) parent31f8c0e6e1b142
4 files changed+88−3
pkgs/development/python-modules/einops/default.nix+5 pkgs/development/python-modules/elegy/default.nix+75 pkgs/development/python-modules/treex/relax-deps.patch+6−3 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/einops/default.nix+5
@@ -44,6 +44,11 @@ buildPythonPackage rec {
4444
4545 checkPhase = ''
4646 export HOME=$TMPDIR
47+
48+ # Prevent hangs on PyTorch-related tests, see
49+ # https://discuss.pytorch.org/t/pytorch-cpu-hangs-on-nn-linear/17748/4
50+ export OMP_NUM_THREADS=1
51+
4752 nosetests -v -w tests
4853 '';
4954
pkgs/development/python-modules/elegy/default.nixnew file+75
@@ -0,0 +1,75 @@
1+{ buildPythonPackage
2+, cloudpickle
3+, deepdish
4+, deepmerge
5+, dm-haiku
6+, fetchFromGitHub
7+, lib
8+, poetry
9+, pytestCheckHook
10+, pytorch
11+, pyyaml
12+, sh
13+, tables
14+, tabulate
15+, tensorboardx
16+, tensorflow
17+, toolz
18+, treex
19+, typing-extensions
20+}:
21+
22+buildPythonPackage rec {
23+ pname = "elegy";
24+ version = "0.8.4";
25+ format = "pyproject";
26+
27+ src = fetchFromGitHub {
28+ owner = "poets-ai";
29+ repo = pname;
30+ rev = version;
31+ sha256 = "11w8lgl31b52w2qri8j8cgzd30sn8i3769g8nkkshvgkjgca9r4g";
32+ };
33+
34+ nativeBuildInputs = [
35+ poetry
36+ ];
37+
38+ propagatedBuildInputs = [
39+ cloudpickle
40+ deepdish
41+ deepmerge
42+ dm-haiku
43+ pyyaml
44+ tables
45+ tabulate
46+ tensorboardx
47+ toolz
48+ treex
49+ typing-extensions
50+ ];
51+
52+ pythonImportsCheck = [
53+ "elegy"
54+ ];
55+
56+ checkInputs = [
57+ pytestCheckHook
58+ pytorch
59+ sh
60+ tensorflow
61+ ];
62+
63+ disabledTests = [
64+ # Fails with `Could not find compiler for platform Host: NOT_FOUND: could not find registered compiler for platform Host -- check target linkage`.
65+ # Runs fine in docker with Ubuntu 22.04. I suspect the issue is the sandboxing in `nixpkgs` but not sure.
66+ "test_saved_model_poly"
67+ ];
68+
69+ meta = with lib; {
70+ description = "Neural Networks framework based on Jax inspired by Keras and Haiku";
71+ homepage = "https://github.com/poets-ai/elegy";
72+ license = licenses.asl20;
73+ maintainers = with maintainers; [ ndl ];
74+ };
75+}
pkgs/development/python-modules/treex/relax-deps.patch+6−3
@@ -1,10 +1,13 @@
11diff --git a/pyproject.toml b/pyproject.toml
2−index 7b9ef68..ec11f32 100644
2+index f0ff8a0..56787ca 100644
33--- a/pyproject.toml
44+++ b/pyproject.toml
5−@@ -18,7 +18,7 @@ python = "^3.7"
5+@@ -16,9 +16,9 @@ secondary = true
6+ [tool.poetry.dependencies]
7+ python = "^3.7"
68 flax = "^0.3.4"
7− PyYAML = "^5.4.1"
9+-PyYAML = "^5.4.1"
10++PyYAML = ">=5.4.1"
811 rich = "^10.7.0"
912-optax = "^0.0.9"
1013+optax = ">=0.0.9"
pkgs/top-level/python-packages.nix+2
@@ -2520,6 +2520,8 @@ in {
25202520
25212521 elasticsearchdsl = self.elasticsearch-dsl;
25222522
2523+ elegy = callPackage ../development/python-modules/elegy { };
2524+
25232525 elementpath = callPackage ../development/python-modules/elementpath { };
25242526
25252527 elevate = callPackage ../development/python-modules/elevate { };