Skip to content

CI Enable LLVM (clang-cl) wheel builds for Win ARM64 - #33435

Closed
dashsantosh-mcw wants to merge 2 commits into
scikit-learn:mainfrom
saravananselvaraj-mcw:main
Closed

dashsantosh-mcw wants to merge 2 commits into
scikit-learn:mainfrom
saravananselvaraj-mcw:main

Conversation

@dashsantosh-mcw

Copy link
Copy Markdown

Reference Issues/PRs

N/A

What does this implement/fix? Explain your changes.

This PR enables clang-cl support for Windows ARM64 builds in the CI pipeline.

Majority of benchmarks show performance improvement with clang-cl (about ~50%).
Minor to low regressions observed in a few cases (upto ~3%).

Changes include:

  • clang-cl based build support
  • Fix for uint32_t redefinition on Windows with clang
  • Updated libomp.dll handling in vendor.py
  • Update test_sizeof_LARGEST_INT_t test to handle clang-cl

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Any other comments?

Benchmark Results

1. cluster.KMeansBenchmark.time_predict

Representation Algorithm MSVC (init_random) Clang-CL (init_random) Δ % MSVC (init_kmeans++) Clang-CL (init_kmeans++) Δ %
dense lloyd 2.61 ms 2.00 ms +23.37% 2.85 ms 2.01 ms +29.47%
dense elkan 2.84 ms 2.03 ms +28.52% 2.76 ms 2.04 ms +26.09%
sparse lloyd 5.81 ms 4.89 ms +15.83% 5.29 ms 4.63 ms +12.48%
sparse elkan 6.30 ms 5.44 ms +13.65% 6.28 ms 5.47 ms +12.90%

2. cluster.KMeansBenchmark.time_transform

Representation Algorithm MSVC (init_random) Clang-CL (init_random) Δ % MSVC (init_kmeans++) Clang-CL (init_kmeans++) Δ %
dense lloyd 38.5 ms 34.5 ms +10.39% 37.0 ms 32.8 ms +11.35%
dense elkan 33.6 ms 32.7 ms +2.68% 31.6 ms 32.1 ms -1.58%
sparse lloyd 4890 ms 5060 ms -3.48% 5030 ms 5050 ms -0.40%
sparse elkan 4950 ms 5060 ms -2.22% 4980 ms 5160 ms -3.61%

3. linear_model.RidgeBenchmark.time_predict

Representation Solver MSVC Clang-CL Δ %
dense auto 14.6 ms 10.3 ms +29.45%
dense svd 10.4 ms 10.0 ms +3.85%
dense cholesky 9.96 ms 10.1 ms -1.41%
dense lsqr 18.4 ms 10.0 ms +45.65%
dense sparse_cg 10.2 ms 10.2 ms 0%
dense sag 14.8 ms 10.2 ms +31.08%
dense saga 10.1 ms 10.3 ms -1.98%
sparse auto 3.22 ms 3.24 ms -0.62%
sparse cholesky 3.27 ms 3.25 ms +0.61%
sparse lsqr 3.32 ms 3.28 ms +1.20%
sparse sparse_cg 3.22 ms 3.24 ms -0.62%
sparse sag 3.19 ms 3.26 ms -2.19%
sparse saga 3.21 ms 3.22 ms -0.31%

4. KNeighborsClassifierBenchmark.time_predict

Algorithm MSVC (low) Clang-CL (low) Δ % MSVC (high) Clang-CL (high) Δ %
brute 89.0 ms 89.5 ms -0.56% 4889 ms 4678 ms +4.32%
kd_tree 308 ms 308 ms 0% 5381 ms 3152 ms +41.42%
ball_tree 761 ms 535 ms +29.70% 5291 ms 2622 ms +50.44%

@dashsantosh-mcw dashsantosh-mcw changed the title Enable LLVM (clang-cl) wheel builds for Win ARM64 CI Enable LLVM (clang-cl) wheel builds for Win ARM64 Mar 2, 2026
@ogrisel

ogrisel commented Mar 2, 2026

Copy link
Copy Markdown
Member

This change impacts the binary we ship and should be discussed in an issue first as per the policy explained in our contribution guide.

Some questions:

  • what motivate the change of compiler on Windows? If this is only for performance, we should check that the improvement are significant on more than just 2 or 3 estimators.
  • why would we do it only for Windows ARM64 and not x86_64?
  • are there risk to break anything by changing compiler on Windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants