Skip to content

Commit 89bc7f8

Browse files
authored
upgrate to version 0.5.3 (#139)
* update to 0.5.3 * mac * proj * g * upgrade version * k * fix * fix * j * remove 314t
1 parent 34fa2a2 commit 89bc7f8

15 files changed

+45
-38
lines changed

_cmake/constants.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,19 @@ configure_file(
150150
#
151151

152152
# AVX instructions
153+
# Check with bash _cmake/intrin.sh <avx function name>
153154
if(MSVC)
154155
# disable warning for #pragma unroll
155-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX")
156+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2")
156157
add_compile_options(/wd4068)
157158
else()
158-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
159+
# Other possible flags
160+
# "-mavx512f", "-mavx512bw", "-mavx512dq", "-mavx512vl", "-mlzcnt"
161+
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html
162+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
163+
# -march=native selects the best option for AVX instructions
164+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native -mf16c")
165+
endif()
159166
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
160167
endif()
161168

@@ -176,6 +183,7 @@ message(STATUS "CMAKE_C_FLAGS_INIT=${CMAKE_C_FLAGS_INIT}")
176183
message(STATUS "CMAKE_C_FLAGS=${CMAKE_C_FLAGS}")
177184
message(STATUS "CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}")
178185
message(STATUS "CMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}")
186+
message(STATUS "CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
179187
message(STATUS "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
180188
message(STATUS "CMAKE_CXX_FLAGS_INIT=${CMAKE_CXX_FLAGS_INIT}")
181189
message(STATUS "CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")

_doc/examples/plot_decision_tree_logreg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def draw_border(
259259
cmap = plt.cm.tab20
260260
Z = Z.reshape(xx.shape)
261261
if ax is None:
262-
fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
262+
_fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
263263
ax.pcolormesh(xx, yy, Z, cmap=cmap)
264264

265265
# Plot also the training points

_doc/examples/plot_leave_neighbors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def draw_border(
130130
cmap = plt.cm.tab20
131131
Z = Z.reshape(xx.shape)
132132
if ax is None:
133-
fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
133+
_fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
134134
ax.pcolormesh(xx, yy, Z, cmap=cmap)
135135

136136
# Plot also the training points

_doc/examples/plot_logistic_regression_clustering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def draw_border(
8484
cmap = plt.cm.tab20
8585
Z = Z.reshape(xx.shape)
8686
if ax is None:
87-
fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
87+
_fig, ax = plt.subplots(1, 1, figsize=figsize or (4, 3))
8888
ax.pcolormesh(xx, yy, Z, cmap=cmap)
8989

9090
# Plot also the training points

_doc/examples/plot_piecewise_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def graph(X, Y, model):
4343
Z = Z.reshape(xx.shape)
4444

4545
# Put the result into a color plot
46-
fig, ax = plt.subplots(1, 1, figsize=(4, 3))
46+
_fig, ax = plt.subplots(1, 1, figsize=(4, 3))
4747
ax.pcolormesh(xx, yy, Z, cmap=plt.cm.Paired)
4848

4949
# Plot also the training points

_doc/examples/plot_predictable_tsne.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def plot_embedding(Xp, y, imgs, title=None, figsize=(12, 4)):
6060
x_min, x_max = numpy.min(Xp, 0), numpy.max(Xp, 0)
6161
X = (Xp - x_min) / (x_max - x_min)
6262

63-
fig, ax = plt.subplots(1, 2, figsize=figsize)
63+
_fig, ax = plt.subplots(1, 2, figsize=figsize)
6464
for i in range(X.shape[0]):
6565
ax[0].text(
6666
X[i, 0],

_doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ Source are available at `sdpython/mlinsights <https://github.com/sdpython/mlinsi
9898
Older versions
9999
++++++++++++++
100100

101-
* `0.5.2 <../v0.5.1/index.html>`_
102-
* `0.5.1 <../v0.5.1/index.html>`_
101+
* `0.5.3 <../v0.5.3/index.html>`_
102+
* `0.5.2 <../v0.5.2/index.html>`_

_unittests/ut_mlmodel/test_piecewise_decision_tree_experiment_fast.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ def test_criterions(self):
102102
assert_criterion_equal(c1, c2)
103103
left1, right1 = _test_criterion_node_impurity_children(c1)
104104
left2, right2 = _test_criterion_node_impurity_children(c2)
105-
self.assertAlmostEqual(left1, left2)
106-
self.assertAlmostEqual(right1, right2)
105+
self.assertAlmostEqual(left1, left2, atol=1e-8)
106+
self.assertAlmostEqual(right1, right2, atol=1e-8)
107107
v1 = _test_criterion_node_value(c1)
108108
v2 = _test_criterion_node_value(c2)
109109
self.assertEqual(v1, v2)
110110
assert_criterion_equal(c1, c2)
111111
p1 = _test_criterion_impurity_improvement(c1, 0.0, left1, right1)
112112
p2 = _test_criterion_impurity_improvement(c2, 0.0, left2, right2)
113-
self.assertAlmostEqual(p1, p2)
113+
self.assertAlmostEqual(p1, p2, atol=1e-8)
114114

115115
X = numpy.array([[1.0, 2.0, 10.0, 11.0]]).T
116116
y = numpy.array([0.9, 1.1, 1.9, 2.1])
@@ -123,7 +123,7 @@ def test_criterions(self):
123123
_test_criterion_init(c2, ys, w, 1.0, ind, 1, y.shape[0])
124124
i1 = _test_criterion_node_impurity(c1)
125125
i2 = _test_criterion_node_impurity(c2)
126-
self.assertAlmostEqual(i1, i2)
126+
self.assertAlmostEqual(i1, i2, atol=1e-8)
127127
v1 = _test_criterion_node_value(c1)
128128
v2 = _test_criterion_node_value(c2)
129129
self.assertEqual(v1, v2)
@@ -136,14 +136,14 @@ def test_criterions(self):
136136
_test_criterion_update(c2, i)
137137
left1, right1 = _test_criterion_node_impurity_children(c1)
138138
left2, right2 = _test_criterion_node_impurity_children(c2)
139-
self.assertAlmostEqual(left1, left2)
140-
self.assertAlmostEqual(right1, right2)
139+
self.assertAlmostEqual(left1, left2, atol=1e-8)
140+
self.assertAlmostEqual(right1, right2, atol=1e-8)
141141
v1 = _test_criterion_node_value(c1)
142142
v2 = _test_criterion_node_value(c2)
143143
self.assertEqual(v1, v2)
144144
p1 = _test_criterion_impurity_improvement(c1, 0.0, left1, right1)
145145
p2 = _test_criterion_impurity_improvement(c2, 0.0, left2, right2)
146-
self.assertAlmostEqual(p1, p2)
146+
self.assertAlmostEqual(p1, p2, atol=1e-8)
147147

148148
@unittest.skipIf(
149149
pv.Version(skl_ver) < pv.Version("1.3.3"),

_unittests/ut_xrun_doc/test_documentation_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def run_test(self, fold: str, name: str, verbose=0) -> int:
4141
cmds = [sys.executable, "-u", os.path.join(fold, name)]
4242
p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4343
res = p.communicate()
44-
out, err = res
44+
_out, err = res
4545
st = err.decode("ascii", errors="ignore")
4646
if st and "Traceback" in st:
4747
if "No module named 'onnxruntime'" in st:

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
strategy:
156156
matrix:
157157
Python311-Linux:
158-
python.version: '3.11'
158+
python.version: '3.12'
159159
maxParallel: 3
160160

161161
steps:

0 commit comments

Comments
 (0)