Skip to content

Add post: Accelerating scikit-learn on Intel hardware: what the benchmarks found so far - #228

Merged
lesteve merged 39 commits into
scikit-learn:mainfrom
cakedev0:intel-benchmarks-update
Nov 5, 2026
Merged

lesteve merged 39 commits into
scikit-learn:mainfrom
cakedev0:intel-benchmarks-update

Conversation

@cakedev0

Copy link
Copy Markdown
Member

This post is a first progress update on the collaboration between Probabl and Intel to make scikit-learn faster on Intel hardware (which most of the time means making it faster overall on CPUs), announced in June. Intel funds the work, and I've been working on it at Probabl since April 2026. So far it's mostly a benchmark suite and the issues and PRs that came out of it.

Some of the PRs it mentions went through the usual scikit-learn review, but most of the work happened in a separate repository (probabl-ai/scikit-learn-benchmarks), so the post is also meant to give the context to people who haven't followed it.

What the post covers:

  • Why we built a new benchmark suite, and how it compares scikit-learn builds (PyPI, conda-forge with MKL or OpenBLAS), implementations (scikit-learn, scikit-learn-intelex, array API backends) and machines (a 2-socket Xeon server with 172 cores, an Intel laptop). The results are public dashboards.
  • What it found
  • The ~20 issues reported to other projects (scikit-learn-intelex, oneDAL, PyTorch XPU, OpenBLAS, joblib, loky...), and the scikit-learn PRs. Most of them are still under review, and the post says so. It was first written ~20 days ago, so it doesn't include all my recently opened PRs.
  • What's next, including the related threading and array API work by Itamar Turner-Trauring (Quansight) and Olivier Grisel.

Engineers from Intel reviewed the text. Feedback from other maintainers is very welcome, especially on anything that reads as overclaiming or as too vendor-specific for the scikit-learn blog.

@welcome

welcome Bot commented Oct 22, 2026

Copy link
Copy Markdown

Thank You Banner

💖 Thanks for opening this pull request! 💖
scikit-learn community really appreciates your time and effort to contribute to the project.
Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.

@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for scikit-learn-blog-view ready!

Name Link
🔨 Latest commit 0f14e56
🔍 Latest deploy log https://app.netlify.com/projects/scikit-learn-blog-view/deploys/6aec48c2b8849c79a85af559
😎 Deploy Preview https://deploy-preview-228--scikit-learn-blog-view.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for scikit-learn-blog ready!

Name Link
🔨 Latest commit 0f14e56
🔍 Latest deploy log https://app.netlify.com/projects/scikit-learn-blog/deploys/6aec48c21b35431dfee9de8f
😎 Deploy Preview https://deploy-preview-228--scikit-learn-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@ogrisel

ogrisel commented Oct 23, 2026

Copy link
Copy Markdown
Member

@cakedev0 can you please try to merge main to check if #230 works?

@cakedev0

Copy link
Copy Markdown
Member Author

Merged main, both deploy previews pass now: https://deploy-preview-228--scikit-learn-blog-view.netlify.app

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is some feedback. It includes cosmetics suggestion to use backtick markers whenever applicable, even in section headers. It would be great to fix them all systematically. I just did some manually below.

There is also one point about missing speed-up values to back the claim about the MKL build for linear models.

Other than that, LGTM. Good work @cakedev0!

cakedev0 and others added 3 commits October 23, 2026 16:44
@ogrisel

ogrisel commented Oct 26, 2026

Copy link
Copy Markdown
Member

It would be great to have one or more maintainers outside of Probabl to give their view about this blog post: e.g. @betatim @virchan @lorentzenchr @thomasjpfan @OmarManzoor @lucyleeow @jjerphan @adrinjalali.

@DeaMariaLeon

DeaMariaLeon commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

When I was asked to write a blog post about my work, I was asked not to promote myself.
On this blog post, there is a section that promotes the author. I wonder why it's different now.

@lorentzenchr

Copy link
Copy Markdown
Member

I think @DeaMariaLeon has a good point.

I started reading and stopped half way. I suggest to tell a story not details about some ongoing work. For example

  • Why is the collaboration a good thing?
  • Why are benchmarks / performance monitoring a good thing
  • How do I as a simple user - not knowing about scikit-intelex - profit from this work

I would also remove the mentions of PRs that are not decided yet or still draft (like scoiding centering for ridge: we might prefer numerical robustness over speed).

I hope this helps.

@lorentzenchr

Copy link
Copy Markdown
Member

And is it possible to see the rendered page?

@cakedev0

cakedev0 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

I will remove the "About me" section, I was not aware of this policy.

I feel the question you're asking Christian are answered in the post already.

  • Why are benchmarks / performance monitoring a good thing: because they guide use to work on the most impactful things, they show the gaps, helps in finding issues that benefit the whole ecosystem.

  • How do I as a simple user - not knowing about scikit-intelex - profit from this work: you don't directly benefit from the benchmarking work if your a "simple user", though you will transparently benefits from the work that those benchmarks guided (fixes upstreams, optimizations in scikit-learn, etc.). And if you're a user that has access to a many-cores machine, you might find useful insights in those results.

  • Why is the collaboration a good thing: because it helps improving scikit-learn.

But I could center the narrative a bit more around those points. Not sure I have the courage though...

I would also remove the mentions of PRs that are not decided yet or still draft (like scoiding centering for ridge: we might prefer numerical robustness over speed).

Fair, I'll look into that. I still want to mention the HGB PR. But the ridge centering can be removed yes.

cakedev0 and others added 4 commits October 26, 2026 21:16
Mention the k-means++ and Lloyd PRs and the long-standing issue #17334
they should close, say the pandas encoder PR is paused, drop the
LogisticRegression PR example (still a draft), and qualify the results of
unmerged PRs as coming from our benchmarks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@virchan

virchan commented Oct 27, 2026

Copy link
Copy Markdown
Member

I will remove the "About me" section, I was not aware of this policy.

We could branch this out into a separate blog post featuring a team-member interview. I'd strongly encourage both you and Dea to consider being interviewed, rather than removing the section entirely.

@DeaMariaLeon

DeaMariaLeon commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

The rendered post in case it's still needed: https://deploy-preview-228--scikit-learn-blog-view.netlify.app/updates/intel-benchmarks-update/


I'd strongly encourage both you and Dea to consider being interviewed, rather than removing the section entirely.

@virchan I was interviewed some months ago, filled out a questionnaire, and I never heard back from the person @ probabl who asked me to do that.

@GaelVaroquaux

GaelVaroquaux commented Oct 27, 2026 via email

Copy link
Copy Markdown
Member

@lorentzenchr

Copy link
Copy Markdown
Member

@DeaMariaLeon Can you (Do you want to) write an email to some people from Probable and put me in the CC. I hope it is just an oversight or internal misunderstanding.

@cakedev0

Copy link
Copy Markdown
Member Author

Normally we should start a "story" with the condensed conclusion, and then a reword at the end. Here the conclusion seems to be scattered in several places but unclear in the end.

I'm not sure what you mean in practice exactly but this blog post is the beginning of a story, it doesn't have a natural conclusion (or maybe just: "we're going to improve performance of scikit-learn" but it's more a prediction/a direction than a conclusion). So I think it's normal it's a bit scattered.

cakedev0 and others added 2 commits October 29, 2026 16:36
…s updates

- Intro without the repeated outcomes, quote moved after it
- "Where we are" points to "What's next" instead of listing PRs
- Builds section renamed so it covers the ExtraTrees isnan story
- "What's next": one set of paragraphs in priority order
- Shorter KMeans paragraph, MKL build now competitive for KMeans

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cakedev0

Copy link
Copy Markdown
Member Author

Thank you for all the reviews, I tried to address everything.

@cakedev0

cakedev0 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member Author

Is it only for me or is the font-size really big? Also, the text column is quite narrow, combined with the font-size, I find it quite hard to read personally.

image

Comparing with substack:

image

Edit: Claude made a PR to fix that, I like it very much: #231

@jjerphan

Copy link
Copy Markdown
Member

Thank you for this very valuable work!

I would also recommend taking conda-forge build variants on libopenblas' threading layer into account.

You can distinguish them using:

libopenblas==*=openmp_*
libopenblas==*=pthreads_*

Depending on the platform, the threading layer is different (due to historical coverage), but we would benefit to know how each one behave for each platform.

To understand more, see the definition and usage of USE_OPENMP in conda-forge/openblas-feedstock, comments and PRs around it.

@cakedev0

cakedev0 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member Author

Thanks Julien! Good news: the benchmarks already cover both variants 😁 I've added a linked to the dedicated dashboard in the blog post 👍

The conda-forge OpenBLAS builds run with both libopenblas=*=pthreads_* and libopenblas=*=openmp_*, and the dashboard compares them per machine.

@jjerphan

jjerphan commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Before posting, I had seen that the implementations of OpenMP are mentioned on the dashboard, but to me it is still not clear which configuration uses a build of OpenBLAS which relies on OpenMP (and if so which implementation) and which configuration uses a build of OpenBLAS which relies on pthreads and not OpenMP at all.

@jjerphan

jjerphan commented Nov 1, 2026

Copy link
Copy Markdown
Member

The conda-forge OpenBLAS builds run with both libopenblas=*=pthreads_* and libopenblas=*=openmp_*, and the dashboard compares them per machine.

I currently understand that sklearn-cf-libgomp-openblas and sklearn-cf-libomp-openblas-omp correspond to builds of OpenBLAS using respectively pthreads and an implementation of OpenMP, libomp. Is that it? I guess making this explicit would be useful.

(Also, one could imagine having sklearn-cf-libomp-openblas and sklearn-cf-libgomp-openblas-omp, but this comparison is already quite complete.)

@cakedev0 cakedev0 added this to Labs Nov 2, 2026
@cakedev0 cakedev0 moved this to PR in progress in Labs Nov 2, 2026
cakedev0 added a commit to cakedev0/my-scikit-learn-backlog that referenced this pull request Nov 2, 2026
done: Blog: [blog#231](scikit-learn/blog#231) (match Substack's font size), merged
todo: move [blog#228](scikit-learn/blog#228) from Waiting to Now: address lorentzenchr's review and answer jjerphan on the OpenBLAS threading layers
todo: move [sklearn#35181](scikit-learn/scikit-learn#35181) from Now to Waiting, adam2392's and antoinebaker's questions answered
add: Maintenance: follow up on [sklearn#35254](scikit-learn/scikit-learn#35254): settle option B with dherrera1911 and betatim (LDA solvers disagree with custom priors)
add: Maintenance: follow up on [sklearn#35209](scikit-learn/scikit-learn#35209): newton-cg LogisticRegressionCV test fails on the macOS x86_64 wheels
add: Maintenance: re-review [sklearn#34619](scikit-learn/scikit-learn#34619) (faster PCA mle; jberg5 addressed my comments)
add: Benchmarks: review [benchmarks#142](probabl-ai/scikit-learn-benchmarks#142) (cuML config) with the results of the AWS L4 run
add: Upstream: upstream to OpenBLAS or close [cakedev0/OpenBLAS#3](cakedev0/OpenBLAS#3) and [cakedev0/OpenBLAS#4](cakedev0/OpenBLAS#4)
todo: since dates on [sklearn#35062](scikit-learn/scikit-learn#35062) and [sklearn#35053](scikit-learn/scikit-learn#35053), and virchan's question on the latter
todo: lorentzenchr's note on [sklearn#35029](scikit-learn/scikit-learn#35029) in the fork#38 line

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@david-cortes-intel

Copy link
Copy Markdown
Contributor

The conda-forge OpenBLAS builds run with both libopenblas=*=pthreads_* and libopenblas=*=openmp_*, and the dashboard compares them per machine.

I currently understand that sklearn-cf-libgomp-openblas and sklearn-cf-libomp-openblas-omp correspond to builds of OpenBLAS using respectively pthreads and an implementation of OpenMP, libomp. Is that it? I guess making this explicit would be useful.

(Also, one could imagine having sklearn-cf-libomp-openblas and sklearn-cf-libgomp-openblas-omp, but this comparison is already quite complete.)

The OMP build of OpenBLAS requires LLVM OMP:
https://github.com/conda-forge/openblas-feedstock/blob/87508a23ee2a6e6304a915f817ef5df302b93438/recipe/recipe.yaml#L62-L63

cakedev0 added a commit to cakedev0/my-scikit-learn-backlog that referenced this pull request Nov 3, 2026
drop: Linear: answer lorentzenchr's inline concerns on [sklearn#35196](scikit-learn/scikit-learn#35196) (minimum norm newton-cholesky), closed without merging in favor of [sklearn#34339](scikit-learn/scikit-learn#34339)
todo: move [sklearn#35267](scikit-learn/scikit-learn#35267) from Now to Waiting, ArturoAmorQ's wording suggestions applied
todo: david-cortes-intel's note on the OpenMP OpenBLAS build on [blog#228](scikit-learn/blog#228)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cakedev0

cakedev0 commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Thanks again for the nice review @lorentzenchr. I think/hope I addressed everything, and I iterated on my side a bit too.


@"all", I think there are no big blockers remaining and that we could merge it soon?

The OpenMP and BLAS threads aren't set through scikit-learn's API, but with
environment variables (`OMP_NUM_THREADS`, `OPENBLAS_NUM_THREADS`,
`MKL_NUM_THREADS`) or, from Python, with
[threadpoolctl](https://github.com/joblib/threadpoolctl):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lesteve

lesteve commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Thanks @cakedev0 for the blog post and everyone for your interest and comments 🙏! I read the blog post and think this is in a good state and I will merge it!

Small reminder for everyone: writing a blog post is hard work. Let's collectively try to reduce the level of nitpicking/bikeshedding side-conversations to an acceptable level so that we encourage people to contribute more posts to the scikit-learn blog 💪!

@lesteve
lesteve merged commit 07e0f09 into scikit-learn:main Nov 5, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from PR in progress to Done in Labs Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.