From 44866de4d11506208d7b0b5e35fe1ffaaa0516a2 Mon Sep 17 00:00:00 2001 From: Alexander Tsvyashchenko Date: Sat, 1 Jan 2022 22:35:46 +0100 Subject: [PATCH] python3Packages.jmp: init at unstable-2021-10-03 (#152972) --- .../python-modules/jmp/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/jmp/default.nix diff --git a/pkgs/development/python-modules/jmp/default.nix b/pkgs/development/python-modules/jmp/default.nix new file mode 100644 index 000000000000..dc096b93ae46 --- /dev/null +++ b/pkgs/development/python-modules/jmp/default.nix @@ -0,0 +1,42 @@ +{ buildPythonPackage +, fetchFromGitHub +, jax +, jaxlib +, lib +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "jmp"; + # As of 2022-01-01, the latest stable version (0.0.2) fails tests with recent JAX versions, + # IIUC it's fixed in https://github.com/deepmind/jmp/commit/4969392f618d7733b265677143d8c81e44085867 + version = "unstable-2021-10-03"; + + src = fetchFromGitHub { + owner = "deepmind"; + repo = pname; + rev = "4b94370b8de29b79d6f840b09d1990b91c1afddd"; + sha256 = "0hh4cmp93wjyidj48gh07vhx2kjvpwd23xvy79bsjn5qaaf6q4cm"; + }; + + # Wheel requires only `numpy`, but the import needs both `jax` and `jaxlib`. + propagatedBuildInputs = [ + jax + jaxlib + ]; + + pythonImportsCheck = [ + "jmp" + ]; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + description = "This library implements support for mixed precision training in JAX."; + homepage = "https://github.com/deepmind/jmp"; + license = licenses.asl20; + maintainers = with maintainers; [ ndl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d3976c969cf5..fafac2e8f246 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4119,6 +4119,8 @@ in { jmespath = callPackage ../development/python-modules/jmespath { }; + jmp = callPackage ../development/python-modules/jmp { }; + joblib = callPackage ../development/python-modules/joblib { }; johnnycanencrypt = callPackage ../development/python-modules/johnnycanencrypt {