2020-07-18 16:06:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-09-14 18:05:37 +00:00
|
|
|
, pythonOlder
|
2020-07-18 16:06:22 +00:00
|
|
|
, pytestCheckHook
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "torchgpipe";
|
2020-10-16 20:44:37 +00:00
|
|
|
version = "0.0.7";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kakaobrain";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
sha256 = "0ki0njhmz1i3pkpr3y6h6ac7p5qh1kih06mknc2s18mfw34f2l55";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'pytest-runner'" ""
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
propagatedBuildInputs = [ torch ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-02-17 17:02:09 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_inplace_on_requires_grad"
|
|
|
|
"test_input_requiring_grad"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "GPipe implemented in Pytorch and optimized for CUDA rather than TPU";
|
|
|
|
homepage = "https://torchgpipe.readthedocs.io";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|