Repository navigation
Conversation
symv uses every thread from n = 200, and the threads' partial results are summed serially. Use max(4, n / 64) threads, and all of them once that reaches half: on an M2 (4 P + 4 E cores), symv n = 200 took 3.1 us on 4 of 8 threads and 2.8 us on all 8. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
I ran this PR against develop c2fc6cf on more machines, including Arm servers. Speed-up in GFLOP/s (median over 3 interleaved rounds, PR / develop), all cores of each machine, threads pinned, conda-forge build flags:
Machines: the two Intel client machines from the description, AWS Graviton4 (Neoverse V2) m8g.4xlarge and m8g.16xlarge, EPYC 7R13 Milan m6a.8xlarge (2 NUMA nodes), EPYC 9R45 Turin m8a.16xlarge (no SMT, OpenBLAS picks its Cooperlake kernels there), and one socket of the Xeon 6787P for reference. "whole grid" is the range over every shape of the run at that thread count. Data and scripts: LOG.md, exp 31. |
cakedev0
added a commit
to cakedev0/my-scikit-learn-backlog
that referenced
this pull request
Nov 25, 2026
…ev0/OpenBLAS#8, cakedev0/OpenBLAS#11, cakedev0/OpenBLAS#10 (he's interested) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
symvuses every thread from n = 200, and the threads' partial results are summed serially, so small calls get slower with more threads. On one socket of a Xeon 6 (86 cores),dsymvwith n = 200 takes 2 µs on 4 threads and 17 µs on 86.This PR uses
min(T, max(4, n / 64))threads, and all T once that reaches half of T. On an M2 (4 P + 4 E cores), 4 of 8 threads were slower than 8 for n = 200, hence the half. Only the thread count changes.Results
Best time of 2 rounds, develop c2fc6cf vs this PR, conda-forge build flags, double precision unless noted:
ssymvon the Xeon at 43-86 threads is 3.6-3.9x faster for n = 200, 3.5-5.9x for n = 500 and 2.6-4.4x for n = 1000. On the EPYC VM at 32-48 threads, it is 2.6-3.5x, 3.3-4.3x and 3.8-4.5x.Once the thread count reaches half of T, this PR runs develop's code path. Those cells stay within noise, including n = 4000 at 43 threads on the Xeon, which measured 0.79x in this short run. On the M2 at 8 threads, that's every size: 0.98-1.02x on the final code.
On the previous version, a Core Ultra 9 285 (8 P + 16 E cores) was 1.2-3.2x faster for n ≤ 500 at 12-24 threads, and end-to-end
eighstayed within noise on both Intel client machines (±3% laptop, ±5% desktop).Caveats
dsymv4000 ~190 → ~222 µs afterdsymv2000 on 31 threads. Measured alone or for 2 s, it matches develop. The socket has Efficiency Latency Control on: the uncore runs at full speed only when >95% of the cores are busy. Develop's idle threads spin on every core, while with this PR most of them sleep, and the uncore takes a few hundred ms to come back up.dsyevr1000 eigenvectors differ from a 1-thread call by 1.07e-10, against 1-2e-11 on develop.dsymvitself is bitwise identical to 1 thread.On the EPYC VM, 48 threads on 48 vCPUs sometimes hit a stall where two threads share a CPU (see the last caveat of #8), so
dsymv1000 took 1 ms on develop there. I don't count that as a gain.Not tested: Arm servers. The Core Ultra 9 285 wasn't rerun on this rebase, which doesn't change the code, and the EPYC is a VM with 48 of its 64 cores.
Split out of #8, since
symvis the one change there with data from several kinds of CPU.Code and data: probabl-ai/scikit-learn-benchmarks, branch gemm-experiments (
LOG.mdexp20-23,scripts/run_tc.sh).🤖 Generated with Claude Code