From 47f62faffe5c0f72e5bccbc65ef3a32d2b1ca48a Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Thu, 17 Feb 2022 08:48:22 +0000 Subject: [PATCH] python3Packages.pytorch-pfn-extras: init at 0.5.6 --- .../pytorch-pfn-extras/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/pytorch-pfn-extras/default.nix diff --git a/pkgs/development/python-modules/pytorch-pfn-extras/default.nix b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix new file mode 100644 index 000000000000..46bd35b9cfb8 --- /dev/null +++ b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix @@ -0,0 +1,55 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, numpy +, onnx +, pytestCheckHook +, pytorch +, typing-extensions +}: + +buildPythonPackage rec { + pname = "pytorch-pfn-extras"; + version = "0.5.6"; + + src = fetchFromGitHub { + owner = "pfnet"; + repo = pname; + rev = "v${version}"; + sha256 = "1ch4vhz3zjanj5advqsj51yy7idrp8yvydvcg4ymwa3wsfjrx58g"; + }; + + propagatedBuildInputs = [ numpy pytorch typing-extensions ]; + + checkInputs = [ onnx pytestCheckHook ]; + + pythonImportsCheck = [ "pytorch_pfn_extras" ]; + + disabledTestPaths = [ + # Requires optuna which is currently (2022-02-16) marked as broken. + "tests/pytorch_pfn_extras_tests/test_config_types.py" + + # Requires CUDA access which is not possible in the nix environment. + "tests/pytorch_pfn_extras_tests/cuda_tests/test_allocator.py" + "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_batchnorm.py" + "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py" + "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_linear.py" + "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy.py" + "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py" + "tests/pytorch_pfn_extras_tests/runtime_tests/test_to.py" + "tests/pytorch_pfn_extras_tests/test_handler.py" + "tests/pytorch_pfn_extras_tests/test_logic.py" + "tests/pytorch_pfn_extras_tests/test_reporter.py" + "tests/pytorch_pfn_extras_tests/training_tests/test_trainer.py" + "tests/pytorch_pfn_extras_tests/utils_tests/test_checkpoint.py" + "tests/pytorch_pfn_extras_tests/utils_tests/test_comparer.py" + "tests/pytorch_pfn_extras_tests/utils_tests/test_new_comparer.py" + ]; + + meta = with lib; { + description = "Supplementary components to accelerate research and development in PyTorch"; + homepage = "https://github.com/pfnet/pytorch-pfn-extras"; + license = licenses.mit; + maintainers = with maintainers; [ samuela ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8feee2e01230..f918f0fe2f1e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8227,6 +8227,8 @@ in { pytorch-metric-learning = callPackage ../development/python-modules/pytorch-metric-learning { }; + pytorch-pfn-extras = callPackage ../development/python-modules/pytorch-pfn-extras { }; + pytorchWithCuda = self.pytorch.override { cudaSupport = true; };