22 buildPythonPackage rec {
23 pname = "pytorch-pfn-extras";
27 src = fetchFromGitHub {
29 repo = "pytorch-pfn-extras";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-6KHVsUHN2KDKAaMdhBpZgTq0XILWUsHJPgeRD0m9m20=";
34 build-system = [ setuptools ];
50 # Requires CUDA access which is not possible in the nix environment.
51 "-m 'not gpu and not mpi'"
52 "-Wignore::DeprecationWarning"
55 pythonImportsCheck = [ "pytorch_pfn_extras" ];
59 # AssertionError: assert 4 == 0
60 # where 4 = <MagicMock id='140733587469184'>.call_count
61 "test_lr_scheduler_wait_for_first_optimizer_step"
63 ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
64 # torch.distributed is not available on darwin
65 "test_create_distributed_evaluator"
66 "test_distributed_evaluation"
67 "test_distributed_evaluator_progress_bar"
72 # Requires optuna which is currently (2022-02-16) marked as broken.
73 "tests/pytorch_pfn_extras_tests/test_config_types.py"
75 # requires onnxruntime which was removed because of poor maintainability
76 # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058
77 "tests/pytorch_pfn_extras_tests/onnx_tests/test_annotate.py"
78 "tests/pytorch_pfn_extras_tests/onnx_tests/test_as_output.py"
79 "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py"
80 "tests/pytorch_pfn_extras_tests/onnx_tests/test_export_testcase.py"
81 "tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py"
82 "tests/pytorch_pfn_extras_tests/onnx_tests/test_load_model.py"
83 "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py"
84 "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py"
86 # RuntimeError: No Op registered for Gradient with domain_version of 9
87 "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py"
89 # torch._dynamo.exc.BackendCompilerFailed: backend='compiler_fn' raised:
90 # AttributeError: module 'torch.fx.experimental.proxy_tensor' has no attribute 'maybe_disable_fake_tensor_mode'
91 "tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py"
93 ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
94 # torch.distributed is not available on darwin
95 "tests/pytorch_pfn_extras_tests/distributed_tests/test_distributed_validation_sampler.py"
96 "tests/pytorch_pfn_extras_tests/nn_tests/parallel_tests/test_distributed.py"
97 "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py"
98 "tests/pytorch_pfn_extras_tests/profiler_tests/test_time_summary.py"
99 "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_accumulate.py"
100 "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_sharded_snapshot.py"
102 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
103 # RuntimeError: internal error
104 # convolution (e.g. F.conv3d) causes runtime error
105 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py"
109 description = "Supplementary components to accelerate research and development in PyTorch";
110 homepage = "https://github.com/pfnet/pytorch-pfn-extras";
111 changelog = "https://github.com/pfnet/pytorch-pfn-extras/releases/tag/v${version}";
112 license = lib.licenses.mit;
113 maintainers = with lib.maintainers; [ samuela ];