Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.11 75 lines 2.8 kB view raw
1{ buildPythonPackage 2, fetchFromGitHub 3, lib 4, numpy 5, onnx 6, packaging 7, pytestCheckHook 8, torch 9, torchvision 10, typing-extensions 11, pythonAtLeast 12}: 13 14buildPythonPackage rec { 15 pname = "pytorch-pfn-extras"; 16 version = "0.7.2"; 17 18 src = fetchFromGitHub { 19 owner = "pfnet"; 20 repo = pname; 21 rev = "refs/tags/v${version}"; 22 hash = "sha256-juoLw/qfq4YF7opyR7cTYCVzUa9pXVvQnvGntcQhBr4="; 23 }; 24 25 propagatedBuildInputs = [ numpy packaging torch typing-extensions ]; 26 27 nativeCheckInputs = [ onnx pytestCheckHook torchvision ]; 28 29 # ignore all pytest warnings 30 preCheck = '' 31 rm pytest.ini 32 ''; 33 34 pythonImportsCheck = [ "pytorch_pfn_extras" ]; 35 36 disabledTestPaths = [ 37 # Requires optuna which is currently (2022-02-16) marked as broken. 38 "tests/pytorch_pfn_extras_tests/test_config_types.py" 39 40 # requires onnxruntime which was removed because of poor maintainability 41 # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058 42 "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py" 43 "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py" 44 "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py" 45 "tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py" 46 47 # RuntimeError: No Op registered for Gradient with domain_version of 9 48 "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py" 49 50 # Requires CUDA access which is not possible in the nix environment. 51 "tests/pytorch_pfn_extras_tests/cuda_tests/test_allocator.py" 52 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_batchnorm.py" 53 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py" 54 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_linear.py" 55 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy.py" 56 "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py" 57 "tests/pytorch_pfn_extras_tests/runtime_tests/test_to.py" 58 "tests/pytorch_pfn_extras_tests/handler_tests/test_handler.py" 59 "tests/pytorch_pfn_extras_tests/test_reporter.py" 60 "tests/pytorch_pfn_extras_tests/training_tests/test_trainer.py" 61 "tests/pytorch_pfn_extras_tests/utils_tests/test_checkpoint.py" 62 "tests/pytorch_pfn_extras_tests/utils_tests/test_comparer.py" 63 "tests/pytorch_pfn_extras_tests/utils_tests/test_new_comparer.py" 64 ] ++ lib.optionals (pythonAtLeast "3.11") [ 65 # Remove this when https://github.com/NixOS/nixpkgs/pull/259068 is merged 66 "tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py" 67 ]; 68 69 meta = with lib; { 70 description = "Supplementary components to accelerate research and development in PyTorch"; 71 homepage = "https://github.com/pfnet/pytorch-pfn-extras"; 72 license = licenses.mit; 73 maintainers = with maintainers; [ samuela ]; 74 }; 75}