summary refs log tree commit diff
path: root/pkgs/development/python-modules/dm-haiku/default.nix
blob: 2c4c24b93670b6e973d8aabb90d3f4ddedb3d2d2 (plain) (blame)
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
{ buildPythonPackage
, chex
, cloudpickle
, dill
, dm-tree
, fetchFromGitHub
, jaxlib
, jmp
, lib
, pytest-xdist
, pytestCheckHook
, tabulate
, tensorflow
}:

buildPythonPackage rec {
  pname = "dm-haiku";
  version = "0.0.6";

  src = fetchFromGitHub {
    owner = "deepmind";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-qvKMeGPiWXvvyV+GZdTWdsC6Wp08AmP8nDtWk7sZtqM=";
  };

  propagatedBuildInputs = [
    jmp
    tabulate
  ];

  checkInputs = [
    chex
    cloudpickle
    dill
    dm-tree
    jaxlib
    pytest-xdist
    pytestCheckHook
    tensorflow
  ];

  pythonImportsCheck = [
    "haiku"
  ];

  disabledTestPaths = [
    # These tests require `bsuite` which isn't packaged in `nixpkgs`.
    "examples/impala_lite_test.py"
    "examples/impala/actor_test.py"
    "examples/impala/learner_test.py"
    # This test breaks on multiple cases with TF-related errors,
    # likely that's the reason the upstream uses TF-nightly for tests?
    # `nixpkgs` doesn't have the corresponding TF version packaged.
    "haiku/_src/integration/jax2tf_test.py"
    # `TypeError: lax.conv_general_dilated requires arguments to have the same dtypes, got float32, float16`.
    "haiku/_src/integration/numpy_inputs_test.py"
  ];

  disabledTests = [
    # See https://github.com/deepmind/dm-haiku/issues/366.
    "test_jit_Recurrent"
  ];

  meta = with lib; {
    description = "Haiku is a simple neural network library for JAX developed by some of the authors of Sonnet.";
    homepage = "https://github.com/deepmind/dm-haiku";
    license = licenses.asl20;
    maintainers = with maintainers; [ ndl ];
  };
}