-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TSNE performance regression in 1.5 #29665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report, I confirm that I can reproduce with: df = np.random.rand(3000, 3)
%timeit tsne = TSNE(n_components=2, random_state=42, n_jobs=7, verbose=10, n_iter=1500).fit(df) On 1.3.1:
while on
Sample run on 1.3.1:
Sample run on
This requires more investigation to figure out where the performance hit is coming from. |
Looking at the cc @scikit-learn/core-devs for help. |
I would recommend using |
Something did NOT go well down that
I'll try again EDIT: pretty sure it's because I didn't handle meson/setuptools switch well while bisecting. |
Might it be due to the used of meson for the build system with flags being now different? We have seen this in the past in another issue. |
Yep. Compiling the 1.5.1 tag with cc @lesteve |
After looking at this a bit, it seems like this is maybe linked to OpenMP, it seems like we need to add the diff --git a/sklearn/manifold/meson.build b/sklearn/manifold/meson.build
index b112f63dd4..ee83e8afc5 100644
--- a/sklearn/manifold/meson.build
+++ b/sklearn/manifold/meson.build
@@ -9,7 +9,7 @@ py.extension_module(
py.extension_module(
'_barnes_hut_tsne',
'_barnes_hut_tsne.pyx',
- dependencies: [np_dep],
+ dependencies: [np_dep, openmp_dep],
cython_args: cython_args,
subdir: 'sklearn/manifold',
install: true My guess right now, is that the setuptools OpenMP flags were added everywhere globally, whereas for meson they need to be added explictly to extension modules that need it. |
I have opened #29694 which I think fixes this issue. |
Describe the bug
The performance of TSNE transformation reduces when using n_jobs as 25 for the newer version w.r.t. 1.3.1.
version 1.3.1
1.5.1
Time 1.3.1 vs 1.5.1 :: 59 vs 223
Is this a intended behavior?
Steps/Code to Reproduce
1.5.1
Expected Results
Minimal time discrepancy
Actual Results
Similar time
Versions
The text was updated successfully, but these errors were encountered: