python310Packages.paddle_bfloat: build from source (#243898)
* python310Packages.paddle-bfloat: build from source * Update pkgs/development/python-modules/paddle-bfloat/default.nix Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com> --------- Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>
This commit is contained in:
parent
dd3e1f7f7a
commit
f89973e36a
46
pkgs/development/python-modules/paddle-bfloat/default.nix
Normal file
46
pkgs/development/python-modules/paddle-bfloat/default.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pythonOlder
|
||||
, pythonAtLeast
|
||||
, numpy
|
||||
}:
|
||||
let
|
||||
pname = "paddle-bfloat";
|
||||
version = "0.1.7";
|
||||
in
|
||||
buildPythonPackage {
|
||||
inherit pname version;
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "paddle_bfloat";
|
||||
inherit version;
|
||||
hash = "sha256-mrjQCtLsXOvqeHHMjuMx65FvMfZ2+wTh1ao9ZJE+9xw=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
sed '1i#include <memory>' -i bfloat16.cc # gcc12
|
||||
# replace deprecated function for python3.11
|
||||
substituteInPlace bfloat16.cc \
|
||||
--replace "Py_TYPE(&NPyBfloat16_Descr) = &PyArrayDescr_Type" "Py_SET_TYPE(&NPyBfloat16_Descr, &PyArrayDescr_Type)"
|
||||
'';
|
||||
|
||||
disabled = pythonOlder "3.9" || pythonAtLeast "3.12";
|
||||
|
||||
propagatedBuildInputs = [
|
||||
numpy
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "paddle_bfloat" ];
|
||||
|
||||
# upstream has no tests
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Paddle numpy bfloat16 package";
|
||||
homepage = "https://pypi.org/project/paddle-bfloat";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ happysalada ];
|
||||
};
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
cp39 = {
|
||||
hash = "sha256-qD94RBvzlCDf0mXSszmZw0ilN8p4/5gDpDbBRgEMHZs=";
|
||||
};
|
||||
cp310 = {
|
||||
hash = "sha256-vjUVESLiqPY+r7K5eUlYPX3hK3QtQ8/H1LIz5lZtrMg=";
|
||||
};
|
||||
cp311 = {
|
||||
hash = "sha256-6IVD8DjTMHqD+yZPXP16Do9QQzJbOPxSEbHXVAJbQp8=";
|
||||
};
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pythonOlder
|
||||
, pythonAtLeast
|
||||
, python
|
||||
}:
|
||||
let
|
||||
pname = "paddle_bfloat";
|
||||
version = "0.1.7";
|
||||
format = "wheel";
|
||||
pyShortVersion = "cp${builtins.replaceStrings ["."] [""] python.pythonVersion}";
|
||||
binary-hash = (import ./binary-hashes.nix)."${pyShortVersion}" or {};
|
||||
src = fetchPypi ({
|
||||
inherit pname version format;
|
||||
dist = pyShortVersion;
|
||||
python = pyShortVersion;
|
||||
abi = pyShortVersion;
|
||||
platform = "manylinux_2_17_x86_64.manylinux2014_x86_64";
|
||||
} // binary-hash);
|
||||
in
|
||||
buildPythonPackage {
|
||||
inherit pname version format src;
|
||||
|
||||
disabled = pythonOlder "3.9" || pythonAtLeast "3.12";
|
||||
|
||||
propagatedBuildInputs = [
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Paddle numpy bfloat16 package";
|
||||
homepage = "https://pypi.org/project/paddle-bfloat";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ happysalada ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
@ -1169,7 +1169,7 @@ self: super: with self; {
|
||||
|
||||
pad4pi = callPackage ../development/python-modules/pad4pi { };
|
||||
|
||||
paddle_bfloat = callPackage ../development/python-modules/paddle_bfloat { };
|
||||
paddle-bfloat = callPackage ../development/python-modules/paddle-bfloat { };
|
||||
|
||||
paddle2onnx = callPackage ../development/python-modules/paddle2onnx { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user