python310Packages.paddlepaddle: init at 2.5.0 (#250115)
* python310Packages.paddlepaddle: init at 2.5.0 * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * Update pkgs/development/python-modules/paddlepaddle/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> * fix typo * formatting fix --------- Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>
This commit is contained in:
parent
3476a10478
commit
10df61d443
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
x86_64-linux = {
|
||||
platform = "manylinux1_x86_64";
|
||||
cpu = {
|
||||
cp39 = "sha256-Yu/FWoMhYp+behAth/jH0FKlf2LJr8TyvL9MBwmuews=";
|
||||
cp310 = "sha256-O7d/5LY2dEMf5gW5WrN3xzIIEi2vT0RWoMeVOk5lATk=";
|
||||
};
|
||||
gpu = {
|
||||
cp39 = "sha256-XHREY27jc+BrVyCJgpMvPVOFiKgPwuiNXPXO3biMLnc=";
|
||||
cp310 = "sha256-oTEBa26o5g6ruuTBgUljjDqign5fXmCn0EnL/0mv+ao=";
|
||||
};
|
||||
};
|
||||
x86_64-darwin = {
|
||||
platform = "macosx_10_9_x86_64";
|
||||
cpu = {
|
||||
cp39 = "sha256-5g9b2gC6uosMpoJiobpj8yToIS6ifAFRvLEqnc/o/QQ=";
|
||||
cp310 = "sha256-2c1hjwNCOOOx9tVfBk+Pyk/pF0m/2tAmRsBH91834eM=";
|
||||
};
|
||||
};
|
||||
aarch64-darwin = {
|
||||
platform = "macosx_11_0_arm64";
|
||||
cpu = {
|
||||
cp39 = "sha256-JhYNTOx1UkuNf/63lHXBDry6FQjPnbIB8jU5jKcyX2k=";
|
||||
cp310 = "sha256-4ltYEYm2OzPBc6D2bQt2dEh6Sz+5m1mMKGGYgQGLSAY=";
|
||||
};
|
||||
};
|
||||
}
|
97
pkgs/development/python-modules/paddlepaddle/default.nix
Normal file
97
pkgs/development/python-modules/paddlepaddle/default.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
{ stdenv
|
||||
, config
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, python
|
||||
, pythonOlder
|
||||
, pythonAtLeast
|
||||
, openssl_1_1
|
||||
, zlib
|
||||
, setuptools
|
||||
, cudaSupport ? config.cudaSupport or false
|
||||
, cudaPackages_11 ? {}
|
||||
, addOpenGLRunpath
|
||||
# runtime dependencies
|
||||
, httpx
|
||||
, numpy
|
||||
, protobuf
|
||||
, pillow
|
||||
, decorator
|
||||
, astor
|
||||
, paddle-bfloat
|
||||
, opt-einsum
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "paddlepaddle" + lib.optionalString cudaSupport "-gpu";
|
||||
version = "2.5.0";
|
||||
format = "wheel";
|
||||
pyShortVersion = "cp${builtins.replaceStrings ["."] [""] python.pythonVersion}";
|
||||
allHashAndPlatform = import ./binary-hashes.nix;
|
||||
hash = allHashAndPlatform."${stdenv.system}"."${if cudaSupport then "gpu" else "cpu"}"."${pyShortVersion}";
|
||||
platform = allHashAndPlatform."${stdenv.system}".platform;
|
||||
src = fetchPypi ({
|
||||
inherit version format hash platform;
|
||||
pname = builtins.replaceStrings [ "-" ] [ "_" ] pname;
|
||||
dist = pyShortVersion;
|
||||
python = pyShortVersion;
|
||||
abi = pyShortVersion;
|
||||
});
|
||||
in
|
||||
buildPythonPackage {
|
||||
inherit pname version format src;
|
||||
|
||||
disabled = pythonOlder "3.9" || pythonAtLeast "3.11";
|
||||
|
||||
libraryPath = lib.makeLibraryPath (
|
||||
# TODO: remove openssl_1_1 and zlib, maybe by building paddlepaddle from
|
||||
# source as suggested in the following comment:
|
||||
# https://github.com/NixOS/nixpkgs/pull/243583#issuecomment-1641450848
|
||||
[ openssl_1_1 zlib ] ++ lib.optionals cudaSupport (with cudaPackages_11; [
|
||||
cudatoolkit.lib
|
||||
cudatoolkit.out
|
||||
cudnn
|
||||
])
|
||||
);
|
||||
|
||||
postFixup = lib.optionalString stdenv.isLinux ''
|
||||
function fixRunPath {
|
||||
p=$(patchelf --print-rpath $1)
|
||||
patchelf --set-rpath "$p:$libraryPath" $1
|
||||
${lib.optionalString cudaSupport ''
|
||||
addOpenGLRunpath $1
|
||||
''}
|
||||
}
|
||||
fixRunPath $out/${python.sitePackages}/paddle/fluid/libpaddle.so
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
addOpenGLRunpath
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
setuptools
|
||||
httpx
|
||||
numpy
|
||||
protobuf
|
||||
pillow
|
||||
decorator
|
||||
astor
|
||||
paddle-bfloat
|
||||
opt-einsum
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "paddle" ];
|
||||
|
||||
# no tests
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署";
|
||||
homepage = "https://github.com/PaddlePaddle/Paddle";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ happysalada ];
|
||||
platforms = [ "x86_64-linux" ] ++ optionals (!cudaSupport) [ "x86_64-darwin" "aarch64-darwin" ];
|
||||
};
|
||||
}
|
|
@ -1187,6 +1187,8 @@ self: super: with self; {
|
|||
|
||||
paddle2onnx = callPackage ../development/python-modules/paddle2onnx { };
|
||||
|
||||
paddlepaddle = callPackage ../development/python-modules/paddlepaddle { };
|
||||
|
||||
pulumi = callPackage ../development/python-modules/pulumi { inherit (pkgs) pulumi; };
|
||||
|
||||
pulumi-aws = callPackage ../development/python-modules/pulumi-aws { };
|
||||
|
|
Loading…
Reference in a new issue