Skip to content
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

perf: add SIMD support for if-then-else kernels #15131

Merged
merged 8 commits into from
Mar 19, 2024

Conversation

orlp
Copy link
Collaborator

@orlp orlp commented Mar 18, 2024

All in all this results in the following speedups for when/then/otherwise compared to before we had the kernels on a Xeon Platinum 8481C:

mask%     0.20.10      branch             speedup
polars timings u8
0.00000   0.08115843   0.03505932         2.3x 
0.00100   0.03647457   0.01989060         1.8x             
0.01000   0.07882520   0.01981246         4.0x             
0.10000   0.41174116   0.01978657         20.8x            
0.50000   1.00037619   0.01942829         51.5x            
0.90000   0.39769651   0.01932436         20.6x            
0.99000   0.07776755   0.01975066         3.9x             
0.99900   0.03532240   0.01935847         1.8x             
1.00000   0.03219339   0.01969370         1.6x             
polars timings u8 (broadcast otherwise)        
0.00000   0.66645794   0.01661088         40.1x            
0.00100   0.66248909   0.01575884         42.0x            
0.01000   0.66174044   0.01577423         42.0x            
0.10000   0.66020744   0.01580585         41.8x            
0.50000   0.66131728   0.01591707         41.5x            
0.90000   0.65714505   0.01573395         41.8x            
0.99000   0.66128864   0.01575307         42.0x            
0.99900   0.66259916   0.01570407         42.2x            
1.00000   0.66125512   0.01576144         42.0x            
polars timings f64                             
0.00000   0.21898094   0.25657471         0.9x             
0.00100   0.20521458   0.25726009         0.8x             
0.01000   0.26828827   0.25833386         1.0x             
0.10000   0.52341402   0.25722402         2.0x             
0.50000   1.12231359   0.25894305         4.3x             
0.90000   0.51546188   0.25701572         2.0x             
0.99000   0.26381128   0.25602088         1.0x             
0.99900   0.20374866   0.25483548         0.8x             
1.00000   0.22121774   0.25552775         0.9x             
polars timings f64 (broadcast otherwise)       
0.00000   0.84157705   0.19835374         4.2x             
0.00100   0.88611176   0.19524437         4.5x             
0.01000   0.85838821   0.19667060         4.4x             
0.10000   0.98699411   0.19583061         5.0x             
0.50000   1.45492584   0.19726063         7.4x             
0.90000   0.92819551   0.19708807         4.7x             
0.99000   0.80215534   0.19600758         4.1x             
0.99900   0.79902379   0.19509045         4.1x             
1.00000   0.79653640   0.19531679         4.1x             
polars timings str                             
0.00000   0.81025074   0.40658252         2.0x             
0.00100   0.79277718   0.41019357         1.9x             
0.01000   0.90237664   0.47265907         1.9x             
0.10000   1.20691867   0.59651689         2.0x             
0.50000   1.75795868   0.82901697         2.1x             
0.90000   1.20894155   0.57644851         2.1x             
0.99000   0.92268797   0.47065160         2.0x             
0.99900   0.79767013   0.41163175         1.9x             
1.00000   0.81042450   0.40430602         2.0x             
polars timings str (broadcast otherwise)       
0.00000   2.13609492   0.28432058         7.5x             
0.00100   2.14303083   0.29062434         7.4x             
0.01000   2.21549710   0.34571675         6.4x             
0.10000   2.36127071   0.44268859         5.3x             
0.50000   2.31621091   0.40052368         5.8x             
0.90000   2.16956373   0.40142049         5.4x             
0.99000   2.14197054   0.40084098         5.3x             
0.99900   2.13997730   0.40132523         5.3x             
1.00000   2.14470416   0.39907459         5.4x             

@github-actions github-actions bot added performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars labels Mar 18, 2024
@ritchie46
Copy link
Member

That one's fast, in two ways. :D

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 94.26752% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 81.18%. Comparing base (066c262) to head (379bd53).
Report is 11 commits behind head on main.

Files Patch % Lines
crates/polars-utils/src/cpuid.rs 57.14% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15131      +/-   ##
==========================================
+ Coverage   81.08%   81.18%   +0.09%     
==========================================
  Files        1342     1347       +5     
  Lines      174150   175379    +1229     
  Branches     2459     2506      +47     
==========================================
+ Hits       141210   142381    +1171     
- Misses      32473    32519      +46     
- Partials      467      479      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 1237c03 into pola-rs:main Mar 19, 2024
18 checks passed
@orlp orlp self-assigned this Mar 19, 2024
@c-peters c-peters added the accepted Ready for implementation label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants