2019-10-18 08:33:29 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-onnx
|
|
|
|
#
|
2024-01-31 09:24:25 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-10-18 08:33:29 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2020-01-08 10:06:57 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2019-10-18 08:33:29 +00:00
|
|
|
|
2023-10-12 12:47:05 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
Accepting request 1162838 from home:mslacken:branches:science:machinelearning
- update to 1.16.0
* Update to support int4 and uint4:
+ Cast, CastLike, Constant, ConstantOfShape, Identity, If,
Loop, Reshape, Scan, Shape, Size
* Update to support float8e4m3fnuz, float8e5m2, float8e5m2fnuz,
int4 and uint4:
+ Flatten, Pad, Squeeze, Transpose, Unsqueeze
* Support blocked quantization. Support int4, uint4, int16, and uint16:
+ DequantizeLinear, QuantizeLinear,
* Support bfloat16 and float16 scales. Support float8e4m3fn,
float8e4m3fnuz, float8e5m2, float8e5m2fnuz quantized tensors:
+ QLinearMatMul,
* Add stash_type attribute and change input shape of scale and
bias from (G) to (C) for GroupNormalization
* ai.onnx.ml Opset 4
* Addeded new operator TreeEnsemble
* IR Version 10
+ Added support for UINT4, INT4 types
+ GraphProto, FunctionProto, NodeProto, TensorProto added
metadata_props field
+ FunctionProto added value_info field
+ FunctionProto and NodeProto added overload field to support
overloaded functions.
- Security Updates
* Fix path sanitization bypass leading to arbitrary read
(CVE-2024-27318)
* Fix Out of bounds read due to lack of string termination in
assert (CVE-2024-27319)
- Several Bug fixes and infrastructure improvements
- removed python39 support
OBS-URL: https://build.opensuse.org/request/show/1162838
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=43
2024-03-27 10:28:58 +00:00
|
|
|
# python-nbval needed for test isn't available python39
|
|
|
|
%define skip_python39 1
|
|
|
|
|
2024-06-25 07:10:21 +00:00
|
|
|
|
2021-02-15 19:57:43 +00:00
|
|
|
# Tumbleweed does not have a python36-numpy anymore: NEP 29 dropped Python 3.6 for NumPy 1.20
|
2019-10-18 08:33:29 +00:00
|
|
|
Name: python-onnx
|
Accepting request 1162838 from home:mslacken:branches:science:machinelearning
- update to 1.16.0
* Update to support int4 and uint4:
+ Cast, CastLike, Constant, ConstantOfShape, Identity, If,
Loop, Reshape, Scan, Shape, Size
* Update to support float8e4m3fnuz, float8e5m2, float8e5m2fnuz,
int4 and uint4:
+ Flatten, Pad, Squeeze, Transpose, Unsqueeze
* Support blocked quantization. Support int4, uint4, int16, and uint16:
+ DequantizeLinear, QuantizeLinear,
* Support bfloat16 and float16 scales. Support float8e4m3fn,
float8e4m3fnuz, float8e5m2, float8e5m2fnuz quantized tensors:
+ QLinearMatMul,
* Add stash_type attribute and change input shape of scale and
bias from (G) to (C) for GroupNormalization
* ai.onnx.ml Opset 4
* Addeded new operator TreeEnsemble
* IR Version 10
+ Added support for UINT4, INT4 types
+ GraphProto, FunctionProto, NodeProto, TensorProto added
metadata_props field
+ FunctionProto added value_info field
+ FunctionProto and NodeProto added overload field to support
overloaded functions.
- Security Updates
* Fix path sanitization bypass leading to arbitrary read
(CVE-2024-27318)
* Fix Out of bounds read due to lack of string termination in
assert (CVE-2024-27319)
- Several Bug fixes and infrastructure improvements
- removed python39 support
OBS-URL: https://build.opensuse.org/request/show/1162838
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=43
2024-03-27 10:28:58 +00:00
|
|
|
Version: 1.16.0
|
2019-10-18 08:33:29 +00:00
|
|
|
Release: 0
|
2020-02-25 13:58:12 +00:00
|
|
|
Summary: Open Neural Network eXchange
|
2020-01-08 10:06:57 +00:00
|
|
|
License: MIT
|
|
|
|
URL: https://onnx.ai/
|
2019-10-18 08:33:29 +00:00
|
|
|
Source0: https://github.com/onnx/onnx/archive/v%{version}.tar.gz#/onnx-%{version}.tar.gz
|
2019-10-28 13:15:22 +00:00
|
|
|
Source1: %{name}-rpmlintrc
|
2024-01-31 09:24:25 +00:00
|
|
|
BuildRequires: %{python_module Pillow}
|
2023-10-12 12:47:05 +00:00
|
|
|
BuildRequires: %{python_module devel >= 3.8}
|
2024-01-31 09:24:25 +00:00
|
|
|
BuildRequires: %{python_module fb-re2}
|
|
|
|
BuildRequires: %{python_module nbval}
|
2020-02-25 13:58:12 +00:00
|
|
|
BuildRequires: %{python_module numpy}
|
2023-10-12 12:47:05 +00:00
|
|
|
BuildRequires: %{python_module parameterized}
|
2020-02-25 13:58:12 +00:00
|
|
|
BuildRequires: %{python_module protobuf}
|
2020-04-23 10:35:54 +00:00
|
|
|
BuildRequires: %{python_module pybind11-devel}
|
2020-02-24 15:44:01 +00:00
|
|
|
BuildRequires: %{python_module pybind11}
|
2020-02-25 13:58:12 +00:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2020-01-08 10:06:57 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-10-18 08:33:29 +00:00
|
|
|
BuildRequires: cmake
|
2020-01-08 10:06:57 +00:00
|
|
|
BuildRequires: fdupes
|
2019-10-18 08:33:29 +00:00
|
|
|
BuildRequires: gcc-c++
|
2023-07-21 13:17:00 +00:00
|
|
|
BuildRequires: protobuf21-devel
|
2020-01-08 10:06:57 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-08-17 06:37:58 +00:00
|
|
|
Requires: libonnx == %version
|
|
|
|
Requires: libonnx_proto == %version
|
2019-10-18 08:33:29 +00:00
|
|
|
Requires: python-numpy
|
|
|
|
Requires: python-protobuf
|
|
|
|
Requires: python-typing_extensions >= 3.6.2.1
|
2020-05-21 08:59:21 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-02-15 12:43:38 +00:00
|
|
|
Requires(postun):update-alternatives
|
2020-03-23 15:09:14 +00:00
|
|
|
Provides: python-onnx-devel = %{version}-%{release}
|
|
|
|
Obsoletes: python-onnx-devel < %{version}-%{release}
|
2019-10-18 08:33:29 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2020-03-18 17:33:28 +00:00
|
|
|
Open format to represent deep learning models. With ONNX, AI developers can
|
|
|
|
more easily move models between state-of-the-art tools and choose the
|
|
|
|
combination that is best for them. ONNX is developed and supported by a
|
|
|
|
community of partners.
|
2019-10-18 08:33:29 +00:00
|
|
|
|
2020-08-17 06:37:58 +00:00
|
|
|
%package -n onnx-devel
|
|
|
|
Summary: Header files of onnx
|
|
|
|
Requires: libonnx == %version
|
|
|
|
Requires: libonnx_proto == %version
|
|
|
|
|
|
|
|
%description -n onnx-devel
|
2021-02-15 12:43:38 +00:00
|
|
|
Header files of ONNX.
|
2020-08-17 06:37:58 +00:00
|
|
|
|
|
|
|
%package -n libonnx
|
|
|
|
Summary: Shared library for onnx
|
|
|
|
|
|
|
|
%description -n libonnx
|
|
|
|
This package exists to create libonnx_proto, so you do no want
|
|
|
|
to install this package.
|
|
|
|
|
|
|
|
%package -n libonnx_proto
|
|
|
|
Summary: Shared library for onnx protocul bufer
|
|
|
|
|
|
|
|
%description -n libonnx_proto
|
|
|
|
Shared library for the protocol buffer library, packaged separately to be
|
|
|
|
used by external project.
|
|
|
|
|
|
|
|
%package -n onnx-backend-test
|
|
|
|
Summary: Test data
|
|
|
|
|
|
|
|
%description -n onnx-backend-test
|
|
|
|
This packages includes the data for testing the backend.
|
|
|
|
|
2019-10-18 08:33:29 +00:00
|
|
|
%prep
|
|
|
|
%setup -q -n onnx-%{version}
|
2022-05-05 10:14:06 +00:00
|
|
|
|
2020-02-24 14:53:41 +00:00
|
|
|
# avoid bundles
|
|
|
|
rm -rf third_party
|
2020-04-23 11:56:53 +00:00
|
|
|
%autopatch -p1
|
2022-05-05 10:14:06 +00:00
|
|
|
|
|
|
|
# fix shebang
|
|
|
|
sed -i "s|^#!\s*%{_bindir}/env python|#!%{_bindir}/python3|" tools/protoc-gen-mypy.py
|
|
|
|
|
2021-02-15 19:57:43 +00:00
|
|
|
# build inside python_expand shuffled build dir also used by the cmake macro instead of upstream's custom dirname
|
|
|
|
sed -i "/^CMAKE_BUILD_DIR = / s/TOP_DIR, '.setuptools-cmake-build'/TOP_DIR, 'build'/" setup.py
|
2020-02-25 13:58:12 +00:00
|
|
|
# do not require extra pytest modules
|
2024-01-31 09:24:25 +00:00
|
|
|
#sed -i -e '/addopts/d' setup.cfg
|
2020-02-25 13:58:12 +00:00
|
|
|
# do not pull in pytest-runner as it is deprecated
|
|
|
|
sed -i -e '/pytest-runner/d' setup.py
|
2019-10-18 08:33:29 +00:00
|
|
|
|
|
|
|
%build
|
2021-02-15 19:57:43 +00:00
|
|
|
%{python_expand # Generate the build system using the distro macro, configuring everything to taste for every python flavor.
|
|
|
|
%cmake -DONNX_USE_PROTOBUF_SHARED_LIBS:BOOL=ON \
|
2024-06-25 13:12:45 +00:00
|
|
|
-DONNX_WERROR:BOOL=OFF
|
2021-02-15 19:57:43 +00:00
|
|
|
# the macro stays in build/
|
|
|
|
cd ..
|
2020-02-24 15:44:01 +00:00
|
|
|
}
|
2021-02-15 19:57:43 +00:00
|
|
|
# let setup.py do the cmake build call (for every flavor)
|
2019-10-18 08:33:29 +00:00
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2020-08-17 06:37:58 +00:00
|
|
|
%cmake_install
|
2020-05-21 08:59:21 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/backend-test-tools
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/check-node
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/check-model
|
2021-02-15 19:57:43 +00:00
|
|
|
%{python_expand # fix shebang
|
|
|
|
shebang_files="%{$python_sitearch}/onnx/backend/test/stat_coverage.py %{$python_sitearch}/onnx/defs/gen_doc.py %{$python_sitearch}/onnx/gen_proto.py"
|
2019-10-18 08:33:29 +00:00
|
|
|
for file in $shebang_files ; do
|
2021-02-15 19:57:43 +00:00
|
|
|
sed -i 's|%{_bindir}/env python.*$|%{_bindir}/$python|' %{buildroot}/$file
|
2019-10-18 08:33:29 +00:00
|
|
|
chmod 755 %{buildroot}/$file
|
|
|
|
done
|
2021-02-15 19:57:43 +00:00
|
|
|
}
|
|
|
|
%{?python_compileall}
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2020-02-24 14:53:41 +00:00
|
|
|
|
2024-06-25 07:10:21 +00:00
|
|
|
#Disable tests for s390x based on IBM support without working tests boo#1215337
|
|
|
|
%ifnarch s390x
|
2020-02-24 14:53:41 +00:00
|
|
|
%check
|
2021-02-15 12:43:38 +00:00
|
|
|
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}"
|
2021-02-15 19:57:43 +00:00
|
|
|
# copy tests into clean subdir and test the installed lib in sitearch
|
|
|
|
mkdir cleantestdir
|
|
|
|
cp -r onnx/test onnx/examples cleantestdir/
|
|
|
|
pushd cleantestdir
|
2020-02-25 13:58:12 +00:00
|
|
|
# skip online tests
|
2021-02-15 19:57:43 +00:00
|
|
|
donttest=" test_bvlc_alexnet_cpu \
|
|
|
|
or test_shufflenet_cpu \
|
|
|
|
or test_densenet121_cpu \
|
|
|
|
or test_squeezenet_cpu \
|
|
|
|
or test_inception_v1_cpu \
|
|
|
|
or test_vgg19_cpu \
|
|
|
|
or test_inception_v2_cpu \
|
|
|
|
or test_zfnet512_cpu \
|
2023-10-12 12:47:05 +00:00
|
|
|
or test_resnet50_cpu \
|
|
|
|
or reference_evaluator_backend_test"
|
2022-01-19 10:13:08 +00:00
|
|
|
# do not run in parallel yet - https://github.com/onnx/onnx/issues/3946#issuecomment-1015634235
|
|
|
|
%pytest_arch -n 1 -k "not ($donttest)" -ra
|
2021-02-15 19:57:43 +00:00
|
|
|
popd
|
2024-06-25 07:10:21 +00:00
|
|
|
%endif
|
2019-10-18 08:33:29 +00:00
|
|
|
|
2020-05-21 08:59:21 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative backend-test-tools
|
|
|
|
%python_install_alternative check-node
|
|
|
|
%python_install_alternative check-model
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative backend-test-tools
|
|
|
|
%python_uninstall_alternative check-node
|
|
|
|
%python_uninstall_alternative check-model
|
|
|
|
|
2019-10-18 08:33:29 +00:00
|
|
|
%files %{python_files}
|
2020-01-08 10:06:57 +00:00
|
|
|
%doc README.md
|
2020-02-24 14:53:41 +00:00
|
|
|
%license LICENSE
|
2020-05-21 08:59:21 +00:00
|
|
|
%python_alternative %{_bindir}/check-model
|
|
|
|
%python_alternative %{_bindir}/check-node
|
|
|
|
%python_alternative %{_bindir}/backend-test-tools
|
2020-03-18 17:33:28 +00:00
|
|
|
%{python_sitearch}/onnx*
|
2019-10-18 08:33:29 +00:00
|
|
|
|
2020-08-17 06:37:58 +00:00
|
|
|
%files -n onnx-devel
|
|
|
|
%{_includedir}/onnx
|
|
|
|
%{_libdir}/cmake/*
|
|
|
|
%exclude %{_includedir}/onnx/backend
|
|
|
|
|
|
|
|
%files -n onnx-backend-test
|
|
|
|
%{_includedir}/onnx/backend
|
|
|
|
|
|
|
|
%files -n libonnx
|
|
|
|
%{_libdir}/libonnx.so
|
2021-02-15 12:43:38 +00:00
|
|
|
|
2020-08-17 06:37:58 +00:00
|
|
|
%files -n libonnx_proto
|
|
|
|
%{_libdir}/libonnx_proto.so
|
|
|
|
|
2019-10-18 08:33:29 +00:00
|
|
|
%changelog
|