python310Packages.fairscale: init at 0.4.13

This commit is contained in:
happysalada 2023-07-10 20:51:46 +08:00 committed by Yt
parent bc508bdf7a
commit 6c0d664eb8
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,65 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
# build inputs
, torch
, numpy
, ninja
# check inputs
, pytestCheckHook
, parameterized
, pytest-cov
, pytest-timeout
, remote-pdb
}:
let
pname = "fairscale";
version = "0.4.13";
in
buildPythonPackage {
inherit pname version;
format = "setuptools";
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "facebookresearch";
repo = "fairscale";
rev = "refs/tags/v${version}";
hash = "sha256-L2Rl/qL6l0OLAofygzJBGQdp/2ZrgDFarwZRjyAR3dw=";
};
nativeBuildInputs = [ ninja ];
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
propagatedBuildInputs = [
torch
numpy
];
nativeCheckInputs = [
pytestCheckHook
parameterized
pytest-cov
pytest-timeout
remote-pdb
];
# Some tests try to build distributed models, which doesn't work in the sandbox.
doCheck = false;
pythonImportsCheck = [
"fairscale"
];
meta = with lib; {
description = "PyTorch extensions for high performance and large scale training";
homepage = "https://github.com/facebookresearch/fairscale";
changelog = "https://github.com/facebookresearch/fairscale/releases/tag/v${version}";
license = with licenses; [ mit asl20 bsd3 ];
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -3519,6 +3519,8 @@ self: super: with self; {
factory_boy = callPackage ../development/python-modules/factory_boy { };
fairscale = callPackage ../development/python-modules/fairscale { };
faiss = toPythonModule (pkgs.faiss.override {
pythonSupport = true;
pythonPackages = self;