Build with the default protobuf and not with the protobuf21 compat package
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=56
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
3
onnx-1.17.0.tar.gz
Normal file
3
onnx-1.17.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8d5e983c36037003615e5a02d36b18fc286541bf52de1a78f6cf9f32005a820e
|
||||
size 12475304
|
2
python-onnx-rpmlintrc
Normal file
2
python-onnx-rpmlintrc
Normal file
@@ -0,0 +1,2 @@
|
||||
# special library loader
|
||||
addFilter("libonnxifi_dummy.* lto-no-text-in-archive")
|
407
python-onnx.changes
Normal file
407
python-onnx.changes
Normal file
@@ -0,0 +1,407 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 31 23:25:27 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Do not build against the compatibility protobuf21, since the build
|
||||
against the recent protobuf 28.3 and python-protobuf 5.28.3 works
|
||||
just fine
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 16 08:41:19 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Fix numpy version 'Requires'
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 14 08:29:14 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update to 1.17.0:
|
||||
* Key Updates
|
||||
- ai.onnx Opset 22
|
||||
Update to support bfloat16:
|
||||
- Python Changes
|
||||
Support for numpy >= 2.0
|
||||
* Bug fixes and infrastructure improvements
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 25 06:49:15 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- update to 1.16.2:
|
||||
* Mitigate tarball directory traversal risks #6164
|
||||
* Refactor safe extract method #6222
|
||||
* Add check on dimensions in Gemm opset 6 #6217
|
||||
* Update broken URLs #6255
|
||||
- skipped 1.16.1:
|
||||
* Prevent crash on import after GCC 8 builds #6048
|
||||
* Add missing shape inference check for DequantizeLinear #6080
|
||||
* Fix input names for quantize/dequantize ONNX backend tests #6122
|
||||
* fix a skipped shape infer code #6049
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 25 06:48:43 UTC 2024 - Caroline Sena <caroline.sena@suse.com>
|
||||
|
||||
- Changes needed to fix build errors on Leap 15.6 and Tumbleweed
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 22 09:33:24 UTC 2024 - Sarah Kriesch <sarah.kriesch@opensuse.org>
|
||||
|
||||
- Disable tests for s390x based on IBM support without working tests (boo#1215337)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 27 08:37:07 UTC 2024 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- 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
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 26 15:38:11 UTC 2024 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- update to 1.15.0
|
||||
* New Operators (ai.onnx):
|
||||
+ ImageDecoder a new ImageDecoder operator to be used in preprocessing
|
||||
models
|
||||
+ RegexFullMatch a new operator for regex matching that is commonly used in
|
||||
feature preprocessing
|
||||
+ StringConcat takes two string tensors as input and returns the elementwise
|
||||
concatenation of the strings in each tensor
|
||||
+ StringSplit takes a string tensor as input and splits each element based
|
||||
on a delimiter attribute and a maxsplit attribute
|
||||
+ AffineGrid Generates a 2D or 3D flow field (sampling grid), given a batch
|
||||
of affine matrices theta
|
||||
+ Gelu applies gaussian error linear unit function or its approximation to
|
||||
input
|
||||
* Operator Updates (ai.onnx):
|
||||
+ ConstantOfShape extends supported data types
|
||||
+ GridSample extends to ND data
|
||||
+ ReduceMax adds support for boolean
|
||||
+ ReduceMin adds support for boolean
|
||||
+ IsNan adds support of float8 types
|
||||
+ IsInf adds support of float8 types
|
||||
+ DFT promote axis as input
|
||||
* New functionality:
|
||||
+ Enable empty list of values as attribute
|
||||
+ Update diff bakend node tests for auto update doc
|
||||
+ Enable pylint checks with Ruff and remove pylint from lintrunner
|
||||
+ Getting onnx to treat inf/-inf as float literals.
|
||||
+ Create the onnxtxt serialization format
|
||||
+ Support JSON as a serialization target
|
||||
+ Support for parsing and printing empty list value as attribute
|
||||
+ Add auto update doc pipeline to help developers update docs
|
||||
+ Implement GELU as function op
|
||||
+ Integrate function-inlining with version-conversion
|
||||
+ Extend function type inference to handle missing optional parameters
|
||||
+ Create repr functions for OpSchema
|
||||
+ Utility to inline model-local functions
|
||||
+ Faster reference implementation for operator Conv based on im2col
|
||||
+ Support textproto as a serialization format
|
||||
* ONNX now supports serializing to JSON, Text Proto as well as the ONNX Text
|
||||
Representation
|
||||
* Users are now able to serialize the model proto to a text format by
|
||||
specifying supported file extensions or supplying the format= argument in
|
||||
save_model.
|
||||
* Bug fixes
|
||||
+ Do not use LFS64 on non-glibc linu
|
||||
+ Reject absolute path when saving external data
|
||||
+ Support Python editable builds
|
||||
+ Supports float 8 initializers in ReferenceEvaluator
|
||||
+ Transpose scalar shape inference
|
||||
+ Enable RUFF as a formatter
|
||||
+ Fix type constraints of Reshape(19)
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 11 09:34:17 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||
|
||||
- Update to 1.14.1
|
||||
* Bug fixes
|
||||
- Fix shape data propagation function to handle missing optional parameters #5219
|
||||
- Fix a couple of shape inference issues #5223
|
||||
- Extend function type inference to handle missing optional parameters #5169
|
||||
- Fix check_tensor to work with large models on Windows #5227
|
||||
- Fix check_tensor to work with large models on UNIX #5286
|
||||
- Changes from 1.14.0
|
||||
* Opset 19 is released
|
||||
* New operators
|
||||
- DeformConv added in #4783
|
||||
* Operator extensions
|
||||
- Equal - Support for string data type added in #4828
|
||||
- AveragePool - New attribute dilations #4790
|
||||
- Pad - Added new wrap to the mode attribute to support circular padding #4793
|
||||
- Resize - Added half_pixel_symmetric to the coordinate_transformation_mode attribute #4862
|
||||
* IR updates (bump to 9)
|
||||
- Support attributes with default values: #4911
|
||||
- Added 4 new 8-bit floating point data types: #4805
|
||||
* Backend tests
|
||||
- Replaced real models with light models in backend tests. #4861 #4960
|
||||
* Support Protobuf v21
|
||||
- Now ONNX supports Protobuf v21: #4956
|
||||
* Deprecation notice
|
||||
- Python 3.7 support will be deprecated due to EOL in next release: #5191
|
||||
- onnx-weekly package will be deprecated in TestPyPI.
|
||||
Please use them from PyPI instead: #4930
|
||||
- Properties in FormalParameter will be deprecated in future release.
|
||||
Please use newer properties name: #5074
|
||||
- Variables from mapping.py will be deprecated and become private implementation details.
|
||||
Please use public functions to get corresponding types from helper.py instead: #4554
|
||||
- Changes from 1.13.1
|
||||
* Bug fixes
|
||||
- Add missing f-string for DeprecatedWarningDict in mapping.py #4707
|
||||
- Fix types deprecated in numpy==1.24 #4721
|
||||
- Update URL for real models from ONNX Runtime #4865
|
||||
- Fix attribute substitution within subgraphs during function type/shape inference #4792
|
||||
- Handle variants of constant op in shape inference #4824
|
||||
- Fix parser bug in handling non-tensor types #4863
|
||||
- Fix function shape inference bug #4880
|
||||
* Announcement
|
||||
- Deprecate real model tests from onnx repo in next ONNX release #4885
|
||||
- Move onnx-weekly package from TestPyPI to PyPI and stop
|
||||
uploading onnx-weekly to TestPyPI after next ONNX release #4930
|
||||
- Changes from 1.13.0
|
||||
* New operators
|
||||
- Col2Im added in #3948
|
||||
- BitwiseNot added in #4497
|
||||
- BitwiseAnd, BitwiseOr and BitwiseXor added in #4496
|
||||
* Operator extensions
|
||||
- Resize - New attributes: antialias, axes and keep_aspect_ratio_policy, allow for both scales and sizes to be provided when one of them is an empty constant #4126, #4388
|
||||
- Pad - New attribute axes #4190
|
||||
- OptionalHasElement - New input types handling #4326
|
||||
- OptionalHasElement and OptionalGetElement - Accept tensor and sequence types #4421
|
||||
- ScatterElement and ScatterND - Add max and min as supported reduction attributes #4411
|
||||
- Split - Add support for uneven tensor splitting and a new num_outputs attribute #4481
|
||||
- LpPool - New attributes: ceil_mode and dilations #4534
|
||||
* Function updates
|
||||
- CenterCropPad added in #4190
|
||||
- mish added in #4350
|
||||
- GroupNormalization added in #4621
|
||||
* Reference Python runtime
|
||||
- Reference Python runtime dependent on only Python and numpy has been added. #4483
|
||||
* Python 3.11 support
|
||||
- ONNX 1.13.0 supports Python 3.11. #4490
|
||||
* Apple Silicon support
|
||||
- Support for M1/M2 ARM processors has been added. #4642
|
||||
* More
|
||||
ONNX 1.13.0 also comes with numerous:
|
||||
- bugfixes
|
||||
- infrastructure improvements
|
||||
- CI improvements
|
||||
- documentation updates
|
||||
- security updates
|
||||
For full details see
|
||||
https://github.com/onnx/onnx/wiki/Logistics-for-ONNX-Release-1.13.0
|
||||
* Deprecation notice
|
||||
- TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE has been deprecated #4270
|
||||
- ONNXIFI: ONNX Interface for Framework Integration has been deprecated #4431
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 21 17:18:56 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||
|
||||
- Add %{?sle15_python_module_pythons}
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 21 13:09:06 UTC 2023 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Use older protobuf (protobuf21) to fix build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 17 08:07:43 UTC 2022 - pgajdos@suse.com
|
||||
|
||||
- python-six is not required
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 20 12:30:00 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update to version 1.12.0: https://github.com/onnx/onnx/releases/tag/v1.12.0
|
||||
- Drop upstream patch:
|
||||
* 3734-enable-python310.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 3 09:55:18 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Add 3734-enable-python310.patch to make the package Python 3.10
|
||||
compatible (gh#onnx/onnx#3734).
|
||||
- Remove no-python2.patch, it is really better to fix shebang
|
||||
with a sed command.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 14 07:29:10 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update to 1.10.2: https://github.com/onnx/onnx/releases/tag/v1.10.2
|
||||
- Rebase no-python2.patch
|
||||
- Disable python 3.10 support as onnx is not ready yet.
|
||||
- Do not run tests in parallel, since it is not parallel safe.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 15 18:25:39 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- NEP 29: Tumbleweed does not have python36-numpy and depending
|
||||
packages anymore. Skip python36 build.
|
||||
- Make setup.py cmake call and %cmake macros compatible, even for
|
||||
multiple python3 flavors (when we get python39)
|
||||
- Fix boo#1182258
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 5 08:50:45 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1
|
||||
* Bug fixes:
|
||||
- #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling
|
||||
- #3171 Fix bugs in external data helpers and add add size thresholds for converting
|
||||
- #2961 Fix build issues on some distributions of linux due to hard dependency on python2
|
||||
- #3221 Fix mypy wrapper error while using ONNX as a submodule
|
||||
- Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0
|
||||
* Training
|
||||
- Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954
|
||||
- Removed GraphCall; eliminated need to implement GraphCall #2964
|
||||
- Created a tool and example for users to use TrainingInfoProto for training #3008
|
||||
* Shape Inference and Checker
|
||||
- Large model (>2GB model) support added for checker and shape_inference #2744
|
||||
- Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023
|
||||
- Node level shape inference fixes for operators
|
||||
* Version Converter
|
||||
- More operators supported #2664
|
||||
* General Features
|
||||
- Added serialization for inputs and outputs of Sequence and Map data types #2581
|
||||
- Added programmatic access to version-table and extend make-model #2918
|
||||
- Added size check to make_tensor #2987
|
||||
- Drop patch as the related problem has been fixed upstream:
|
||||
* using-onnxruntime-proto.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 14 14:05:18 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- reorganized package in order to have shared library support.
|
||||
Additional packages are:
|
||||
* onnx-devel
|
||||
* libonnxifi_dummy
|
||||
* libonnx
|
||||
* onnx-devel
|
||||
As no so versions for the shared libraries are available, there
|
||||
is not a explicit dependency for the shared libraries.
|
||||
The archive file libonnxifi_loader.a is explicitely allowed in
|
||||
the rpmlintrc as this archive file is consumed by libonnxifi_loader.so
|
||||
- Added the proto files from onnxruntime so that both packages can
|
||||
use the same shared libraries:
|
||||
* added using-onnxruntime-proto.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 7 09:02:56 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- updated to version 1.7.0 with following highlights:
|
||||
* Training Support, as a tech preview
|
||||
* Opset has been updated to version 12
|
||||
- removed not needed patch: protobuf.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 21 06:55:38 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
|
||||
|
||||
- %python3_only -> %python_alternative
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 23 11:49:13 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Force the interpreter to match the one during build
|
||||
- Mypy should use python3 to generate stuff not python2
|
||||
* no-python2.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 23 10:35:15 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Do not pull in py2 devel of pybind11
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 23 15:08:10 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Do also provide/obsolete for the devel to support migration
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 18 09:45:36 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- provide also python-onnx-devel for backcompat
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 15 08:55:22 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Add patch to fix build with new protobuf:
|
||||
* protobuf.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 4 09:44:15 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- created just one package, as other packages require the
|
||||
source file within the package
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 25 13:57:48 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Add missing dependencies and enable testsuite
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 25 11:52:59 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Force onnx static build in cmake round to ensure we do not
|
||||
end up with unresolvable pkg
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 15:43:18 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Remove testing fluff from previous change and properly loop
|
||||
the cmake call for each python variant
|
||||
- Enable python2 (well rather not explicitly disable it as there
|
||||
is no need for that at the momment)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 14:48:07 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Force building with system cmake to respect system definitions
|
||||
and to provide debug information for later on
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 8 09:35:42 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- moved necessary defs from devel to main package
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 28 13:13:34 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Add python-onnx-rpmlintrc to sources
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 18 11:11:02 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Fix armv7 build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 8 11:03:12 UTC 2019 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- updated to version 1.6.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 22 10:44:28 UTC 2019 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
- initial commit of onnx created with py2pack
|
212
python-onnx.spec
Normal file
212
python-onnx.spec
Normal file
@@ -0,0 +1,212 @@
|
||||
#
|
||||
# spec file for package python-onnx
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
# python-nbval needed for test isn't available python39
|
||||
%define skip_python39 1
|
||||
|
||||
# Tumbleweed does not have a python36-numpy anymore: NEP 29 dropped Python 3.6 for NumPy 1.20
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-onnx
|
||||
Version: 1.17.0
|
||||
Release: 0
|
||||
Summary: Open Neural Network eXchange
|
||||
License: MIT
|
||||
URL: https://onnx.ai/
|
||||
Source0: https://github.com/onnx/onnx/archive/v%{version}.tar.gz#/onnx-%{version}.tar.gz
|
||||
Source1: %{name}-rpmlintrc
|
||||
BuildRequires: %{python_module Pillow}
|
||||
BuildRequires: %{python_module dataclasses if %python-base < 3.7}
|
||||
BuildRequires: %{python_module devel >= 3.8}
|
||||
BuildRequires: %{python_module fb-re2}
|
||||
BuildRequires: %{python_module nbval}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module parameterized}
|
||||
BuildRequires: %{python_module protobuf}
|
||||
BuildRequires: %{python_module pybind11-devel}
|
||||
BuildRequires: %{python_module pybind11}
|
||||
BuildRequires: %{python_module pytest-xdist}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: cmake >= 3.5
|
||||
BuildRequires: eigen3-devel
|
||||
BuildRequires: fdupes
|
||||
%if 0%{?suse_version} > 1500
|
||||
BuildRequires: gcc-c++
|
||||
%else
|
||||
BuildRequires: gcc11
|
||||
BuildRequires: gcc11-c++
|
||||
%endif
|
||||
BuildRequires: libstdc++-devel
|
||||
BuildRequires: protobuf-devel
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: libonnx == %version
|
||||
Requires: libonnx_proto == %version
|
||||
Requires: libstdc++-devel
|
||||
Requires: python-numpy
|
||||
Requires: python-protobuf
|
||||
Requires: python-pybind11
|
||||
Requires: python-typing_extensions >= 3.6.2.1
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Provides: python-onnx-devel = %{version}-%{release}
|
||||
Obsoletes: python-onnx-devel < %{version}-%{release}
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%package -n onnx-devel
|
||||
Summary: Header files of onnx
|
||||
Requires: libonnx == %version
|
||||
Requires: libonnx_proto == %version
|
||||
|
||||
%description -n onnx-devel
|
||||
Header files of ONNX.
|
||||
|
||||
%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.
|
||||
|
||||
%prep
|
||||
%setup -q -n onnx-%{version}
|
||||
|
||||
# avoid bundles
|
||||
rm -rf third_party
|
||||
%autopatch -p1
|
||||
|
||||
# fix shebang
|
||||
sed -i "s|^#!\s*%{_bindir}/env python|#!%{_bindir}/python3|" tools/protoc-gen-mypy.py
|
||||
|
||||
# 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
|
||||
# do not require extra pytest modules
|
||||
#sed -i -e '/addopts/d' setup.cfg
|
||||
# do not pull in pytest-runner as it is deprecated
|
||||
sed -i -e '/pytest-runner/d' setup.py
|
||||
|
||||
%build
|
||||
|
||||
%if 0%{?suse_version} <= 1500
|
||||
export CC=%{_bindir}/gcc-11
|
||||
export CXX=%{_bindir}/g++-11
|
||||
%endif
|
||||
|
||||
%{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 \
|
||||
-DONNX_WERROR:BOOL=OFF
|
||||
# the macro stays in build/
|
||||
cd ..
|
||||
}
|
||||
# let setup.py do the cmake build call (for every flavor)
|
||||
|
||||
%python_build
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%cmake_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/backend-test-tools
|
||||
%python_clone -a %{buildroot}%{_bindir}/check-node
|
||||
%python_clone -a %{buildroot}%{_bindir}/check-model
|
||||
%{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"
|
||||
for file in $shebang_files ; do
|
||||
sed -i 's|%{_bindir}/env python.*$|%{_bindir}/$python|' %{buildroot}/$file
|
||||
chmod 755 %{buildroot}/$file
|
||||
done
|
||||
}
|
||||
%{?python_compileall}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
#Disable tests for s390x based on IBM support without working tests boo#1215337
|
||||
%ifnarch s390x
|
||||
%check
|
||||
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}"
|
||||
# copy tests into clean subdir and test the installed lib in sitearch
|
||||
mkdir cleantestdir
|
||||
cp -r onnx/test examples cleantestdir/
|
||||
pushd cleantestdir
|
||||
# skip online tests
|
||||
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 \
|
||||
or test_resnet50_cpu \
|
||||
or reference_evaluator_backend_test"
|
||||
# do not run in parallel yet - https://github.com/onnx/onnx/issues/3946#issuecomment-1015634235
|
||||
%pytest_arch -n 1 -k "not ($donttest)" -ra
|
||||
popd
|
||||
%endif
|
||||
|
||||
%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
|
||||
|
||||
%files %{python_files}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%python_alternative %{_bindir}/check-model
|
||||
%python_alternative %{_bindir}/check-node
|
||||
%python_alternative %{_bindir}/backend-test-tools
|
||||
%{python_sitearch}/onnx*
|
||||
|
||||
%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
|
||||
|
||||
%files -n libonnx_proto
|
||||
%{_libdir}/libonnx_proto.so
|
||||
|
||||
%changelog
|
Reference in New Issue
Block a user