Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 63 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/python:3.8.6-buster
- image: circleci/python:3.8.7

working_directory: ~/repo

Expand All @@ -11,8 +11,8 @@ jobs:

- restore_cache:
keys:
- v3-dependencies-{{ checksum "requirements.txt" }}
- v3-dependencies-
- v2-dependencies-{{ checksum "requirements.txt" }}
- v2-dependencies-

# - run:
# name: Install omp
Expand All @@ -23,8 +23,8 @@ jobs:
name: Install pandoc
command: |
sudo apt-get update
wget https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb
sudo dpkg -i pandoc-2.10.1-1-amd64.deb
wget https://github.com/jgm/pandoc/releases/download/2.11.3.2/pandoc-2.11.3.2-1-amd64.deb
sudo dpkg -i pandoc-2.11.3.2-1-amd64.deb

- run:
name: Install tex
Expand Down Expand Up @@ -52,14 +52,50 @@ jobs:
name: Install graphviz
command: |
sudo apt-get install -y graphviz

- run:
name: install dependencies (1)
name: Install llvmlite
command: |
python3 -m venv venv
sudo apt-get install lsb-release wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 10
ls /usr/bin/llvm*

- run:
name: Install protobuf-compiler cmake
command: |
sudo apt-get install protobuf-compiler libprotoc-dev cmake

- run:
name: Install standard libraries
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements_conda.txt
pip install scipy matplotlib numpy cython pandas wheel pybind11

- run:
name: Install numba, llvmlite
command: |
python -m venv venv
. venv/bin/activate
# export LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config
sudo ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config
pip install llvmlite numba

# - run:
# name: Build onnx
# command: |
# python3 -m venv venv
# git clone -b master --single-branch https://github.com/onnx/onnx.git --recursive
# cd onnx
# export ONNX_ML=1
# export ONNX_BUILD_TESTS=1
# export ONNXIFI_DUMMY_BACKEND=1
# python setup.py bdist_wheel
# ls dist
# python setup.py install
# cd ..

- run:
name: install dependencies (2)
Expand All @@ -74,13 +110,13 @@ jobs:
python3 -m venv venv
. venv/bin/activate
pip freeze | grep onnx
pip install onnxruntime>=1.4.0 --verbose
pip install onnxruntime>=1.6.0 --verbose
pip show onnxruntime

- save_cache:
paths:
- ./venv
key: v3-dependencies-{{ checksum "requirements.txt" }}
key: v2-dependencies-{{ checksum "requirements.txt" }}

- run:
name: install sklearn-onnx, onnxconverter-common
Expand All @@ -90,11 +126,13 @@ jobs:
pip install git+https://github.com/xadupre/sklearn-onnx.git@jenkins --upgrade

- run:
name: pip freeze
name: check list of dependencies
command: |
python -m venv venv
. venv/bin/activate
pip freeze

apt list --installed

- run:
name: compile and build
command: |
Expand All @@ -118,17 +156,17 @@ jobs:
mkdir -p test-reports/src
cp -r mlprodict test-reports/src

#- run:
# name: documentation
# command: |
# . venv/bin/activate
# python setup.py build_sphinx
#- run:
# name: copy documentation
# command: |
# mkdir -p test-reports/doc
# zip -r -9 test-reports/doc/documentation_html.zip _doc/sphinxdoc/build/html
# - run:
# name: documentation
# command: |
# . venv/bin/activate
# python setup.py build_sphinx
#
# - run:
# name: copy documentation
# command: |
# mkdir -p test-reports/doc
# zip -r -9 test-reports/doc/documentation_html.zip _doc/sphinxdoc/build/html

- store_artifacts:
path: test-reports
Expand Down
3 changes: 1 addition & 2 deletions .local.jenkins.lin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
language: python

python:
- { PATH: "{{Python37}}", VERSION: 3.7, DIST: std, PYINT: python3.7 }
- { PATH: "{{Python38}}", VERSION: 3.8, DIST: std, PYINT: python3.8 }
- { PATH: "{{Python39}}", VERSION: 3.9, DIST: std, PYINT: python3.9 }

virtualenv:
- path: {{ospathjoin(root_path, pickname("$NAME_JENKINS", project_name + "_$VERSION_$DIST_$NAME"), "_venv")}}
Expand Down
6 changes: 5 additions & 1 deletion .local.jenkins.win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language: python

python:
- { PATH: "{{replace(Python37, '\\', '\\\\')}}", VERSION: 3.7, DIST: std }
- { PATH: "{{replace(Python39, '\\', '\\\\')}}", VERSION: 3.9, DIST: std }

virtualenv:
- path: {{ospathjoin(root_path, pickname("%NAME_JENKINS%", project_name + "_%VERSION%_%DIST%_%NAME%"), "_venv")}}
Expand All @@ -14,13 +14,17 @@ install:
- pip install -r requirements.txt
- pip freeze
- pip freeze > pip_freeze.txt

before_script:
- python -u setup.py build_ext --inplace

script:
- { CMD: "python -u setup.py unittests", NAME: "UT" }

after_script:
- python -u setup.py bdist_wheel
- if [ ${DIST} != "conda" and ${NAME} == "UT" ] then copy dist\*.whl {{root_path}}\..\..\local_pypi\local_pypi_server fi

documentation:
- if [ ${NAME} == "UT" ] then python -u setup.py build_sphinx fi
- if [ ${NAME} == "UT" ] then xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html fi
39 changes: 29 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
dist: bionic
dist: focal
sudo: true
language: python
python:
- "3.8"

matrix:
include:
- python: 3.9
name: "Python39"

before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install libomp-dev
- sudo apt-get install libgeos-dev libproj-dev proj-data graphviz libblas-dev liblapack-dev
- wget https://apt.llvm.org/llvm.sh
- chmod +x llvm.sh
- sudo ./llvm.sh 10
- ls /usr/bin/llvm*
- export LLVM_CONFIG=/usr/bin/llvm-config
# - sudo ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config
- sudo apt-get -y install graphviz
# onnx
- sudo apt-get install protobuf-compiler libprotoc-dev cmake
- git clone -b master --single-branch https://github.com/onnx/onnx.git --recursive
- cd onnx
- export ONNX_ML=1
- export ONNX_BUILD_TESTS=1
- export ONNXIFI_DUMMY_BACKEND=1
- pip install -e .
- cd ..

install:
- gcc --version
- pip install -r requirements_conda.txt
- pip install -r requirements.txt
#- pip install -i https://test.pypi.org/simple/ ort-nightly
- pip install onnxruntime
- pip install -i https://test.pypi.org/simple/ ort-nightly
# - pip install onnxruntime

before_script:
- python setup.py build_ext --inplace

script:
- python setup.py unittests -g ".*((LONG)|(SKIP)|(notebooks)).*"
35 changes: 21 additions & 14 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,44 @@
History
=======

current - 2020-12-11 - 0.00Mb
current - 2021-01-02 - 0.00Mb
=============================

* `200`: Add support for bfloat16 (2020-12-30)
* `201`: Fixes #200, add support for float16 (2020-12-30)
* `199`: Fix unit tests recently failing due to onnxruntime update. (2020-12-15)

0.4.1352 - 2020-12-11 - 1.42Mb
==============================

* `196`: Fixes operator Slice for opset 9 (2020-12-11)
* `197`: Add a function to plot an onnx graph into matplotlib (2020-12-09)
* `198`: Fixes #197, add function to plot onnx graph with matplotlib (2020-12-09)
* `194`: Add a function to insert a cast operator between two nodes (2020-12-08)
* `197`: Add a function to plot an onnx graph into matplotlib (2020-12-09)
* `195`: Fixes #194, add function to add an operator in the graph (2020-12-08)
* `194`: Add a function to insert a cast operator between two nodes (2020-12-08)
* `193`: Improves notebook coverage, update CI (2020-11-29)
* `191`: Improves performance of TreeEnsemble (2020-11-28)
* `192`: Fixes #191, improves performance of TreeEnsemble (2020-11-28)
* `189`: Introduce parallelization in experimental einsum implementation (2020-11-17)
* `191`: Improves performance of TreeEnsemble (2020-11-28)
* `190`: Fixes #189, parallelization of Einsum (2020-11-17)
* `187`: Custom implementation for operator Einsum (2020-11-15)
* `189`: Introduce parallelization in experimental einsum implementation (2020-11-17)
* `188`: Fixes #187, custom implementation for operator Einsum (2020-11-15)
* `185`: Add operator LessOrEqual (2020-11-15)
* `187`: Custom implementation for operator Einsum (2020-11-15)
* `186`: Fixes #185, add operator LessOrEqual (2020-11-15)
* `185`: Add operator LessOrEqual (2020-11-15)
* `181`: Fix converter xgboost when ntree_limit is set up (2020-11-14)
* `178`: Fixes unit test testing OnnxConv (issue with shapes) (2020-11-07)
* `182`: Fixes #178, fix xgboost issue with ntree_limit (2020-11-07)
* `183`: Fix error in OnnxPipeline, parameter black_op not found (2020-11-07)
* `184`: Fixes #183, fix missing parameter black_op in OnnxPipeline (2020-11-07)
* `179`: guess_schema_data_type fails with category in dataframe (2020-11-03)
* `183`: Fix error in OnnxPipeline, parameter black_op not found (2020-11-07)
* `182`: Fixes #178, fix xgboost issue with ntree_limit (2020-11-07)
* `178`: Fixes unit test testing OnnxConv (issue with shapes) (2020-11-07)
* `180`: Fixes #179, fix guess_schema_from_data for categories (2020-11-03)
* `175`: Add operator Dropout (2020-09-29)
* `179`: guess_schema_data_type fails with category in dataframe (2020-11-03)
* `176`: Fixes #175, add operator dropout (2020-09-29)
* `175`: Add operator Dropout (2020-09-29)
* `174`: Add support for ReduceSum >= 13 (2020-09-21)
* `172`: Add runtime for operator MaxPool (2020-09-16)
* `173`: Fixes #172, add runtime for operator MaxPool (2020-09-16)
* `170`: Add runtime for operator Pad (2020-09-10)
* `172`: Add runtime for operator MaxPool (2020-09-16)
* `171`: Fixes #170, add operator Pad (2020-09-10)
* `170`: Add runtime for operator Pad (2020-09-10)

0.4.1259 - 2020-09-03 - 1.32Mb
==============================
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-2020, Xavier Dupré
Copyright (c) 2017-2021, Xavier Dupré

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 8 additions & 6 deletions _doc/sphinxdoc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
local_template = os.path.join(os.path.abspath(
os.path.dirname(__file__)), "phdoc_templates")

set_sphinx_variables(__file__, "mlprodict", "Xavier Dupré", 2020,
"alabaster", alabaster.get_path(),
locals(), extlinks=dict(
issue=('https://github.com/sdpython/mlprodict/issues/%s', 'issue')),
title="Python Runtime for ONNX", book=True)
set_sphinx_variables(
__file__, "mlprodict", "Xavier Dupré", 2021,
"alabaster", alabaster.get_path(),
locals(), extlinks=dict(
issue=('https://github.com/sdpython/mlprodict/issues/%s', 'issue')),
title="Python Runtime for ONNX", book=True)

blog_root = "http://www.xavierdupre.fr/app/mlprodict/helpsphinx/"
extensions.extend([
Expand All @@ -42,7 +43,8 @@
])

html_context = {
'css_files': get_default_stylesheet() + ['_static/my-styles.css', '_static/gallery.css'],
'css_files': get_default_stylesheet() + [
'_static/my-styles.css', '_static/gallery.css'],
}

html_logo = "phdoc_static/project_ico.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_model_label_encoder_int(self):
model = LabelEncoder()
data = numpy.array([10, 3, 5, -34, 0], dtype=numpy.int64)
model.fit(data)
for op in sorted(set([9, 10, 11, 12, TARGET_OPSET])):
for op in sorted(set([9, 10, 11, 12, 13, TARGET_OPSET])):
if op > TARGET_OPSET:
continue
with self.subTest(opset=op):
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_module/test_code_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_style_src(self):
pylint_ignore=('C0103', 'C1801', 'R0201', 'R1705', 'W0108', 'W0613',
'R1702', 'W0212', 'W0640', 'W0223', 'W0201',
'W0622', 'C0123', 'W0107',
'C0415', 'R1721'),
'C0415', 'R1721', 'C0411'),
skip=["Instance of 'tuple' has no ",
"do not compare types, use 'isinstance()'",
"Instance of 'AutoAction' has no 'children' member",
Expand All @@ -34,7 +34,7 @@ def test_style_test(self):
check_pep8(test, fLOG=fLOG, neg_pattern="temp_.*",
pylint_ignore=('C0103', 'C1801', 'R0201', 'R1705', 'W0108', 'W0613',
'C0111', 'W0107', 'C0415',
'R1721', 'C0302'),
'R1721', 'C0302', 'C0411'),
skip=["Instance of 'tuple' has no ",
"R1720",
'if __name__ == "__main__":',
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_onnx_conv/test_onnx_conv_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def onnx_test_knn_single_classreg(self, dtype, n_targets=1, debug=False,

if target_opset is None:
opsets = list(sorted(set([
9, 10, 11, 12, get_opset_number_from_onnx()])))
9, 10, 11, 12, 13, get_opset_number_from_onnx()])))
else:
opsets = [target_opset]
for ops in opsets:
Expand Down Expand Up @@ -436,7 +436,7 @@ def test_onnx_test_knn_transform(self):
clr = NearestNeighbors(n_neighbors=3)
clr.fit(X_train)

for to in (10, 11, 12):
for to in (10, 11, 12, 13):
if to > get_opset_number_from_onnx():
break
try:
Expand Down
Loading