2020-07-16 20:28:49 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy27
|
|
|
|
, pytest
|
|
|
|
, pytestrunner
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytorch
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "torchgpipe";
|
2020-10-15 14:25:20 +01:00
|
|
|
version = "0.0.7";
|
2020-07-16 20:28:49 +01:00
|
|
|
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kakaobrain";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-10-15 14:25:20 +01:00
|
|
|
sha256 = "0ki0njhmz1i3pkpr3y6h6ac7p5qh1kih06mknc2s18mfw34f2l55";
|
2020-07-16 20:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ pytorch ];
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytestrunner pytestCheckHook ];
|
|
|
|
disabledTests = [ "test_inplace_on_requires_grad" ];
|
|
|
|
# seems like a harmless failure:
|
|
|
|
## AssertionError:
|
|
|
|
## Pattern 'a leaf Variable that requires grad has been used in an in-place operation.'
|
|
|
|
## does not match 'a leaf Variable that requires grad is being used in an in-place operation.'
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|