2022-02-20 05:27:41 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2022-02-20 05:27:41 +00:00
|
|
|
, numpy
|
|
|
|
, onnx
|
2022-04-27 09:35:20 +00:00
|
|
|
, packaging
|
2022-02-20 05:27:41 +00:00
|
|
|
, pytestCheckHook
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2022-04-27 09:35:20 +00:00
|
|
|
, torchvision
|
2022-02-20 05:27:41 +00:00
|
|
|
, typing-extensions
|
2023-11-16 04:20:00 +00:00
|
|
|
, pythonAtLeast
|
2022-02-20 05:27:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytorch-pfn-extras";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.7.4";
|
|
|
|
pyproject = true;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pfnet";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "pytorch-pfn-extras";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-X7N2RQS8he9FJPfEjPJH6GdxkAPV6uxOIfRVOnJId0U=";
|
2022-02-20 05:27:41 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
propagatedBuildInputs = [ numpy packaging torch typing-extensions ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ onnx pytestCheckHook torchvision ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# ignore all pytest warnings
|
|
|
|
preCheck = ''
|
|
|
|
rm pytest.ini
|
|
|
|
'';
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# requires onnxruntime which was removed because of poor maintainability
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058
|
|
|
|
"tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py"
|
|
|
|
"tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py"
|
|
|
|
"tests/pytorch_pfn_extras_tests/onnx_tests/utils.py"
|
2023-11-16 04:20:00 +00:00
|
|
|
"tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py"
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# RuntimeError: No Op registered for Gradient with domain_version of 9
|
|
|
|
"tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py"
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# 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"
|
2023-11-16 04:20:00 +00:00
|
|
|
"tests/pytorch_pfn_extras_tests/handler_tests/test_handler.py"
|
2022-02-20 05:27:41 +00:00
|
|
|
"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"
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
# Remove this when https://github.com/NixOS/nixpkgs/pull/259068 is merged
|
|
|
|
"tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py"
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|