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

Rustify ome.u.s.{as1, as2} #385

Merged
merged 48 commits into from
Oct 14, 2024
Merged

Rustify ome.u.s.{as1, as2} #385

merged 48 commits into from
Oct 14, 2024

Conversation

tgiani
Copy link
Contributor

@tgiani tgiani commented May 31, 2024

addressing #383 (ome.u.s.as1 and ome.u.s.as2)

@felixhekhorn felixhekhorn added refactor Refactor code rust Rust extension related labels Jun 3, 2024
@felixhekhorn felixhekhorn changed the title ome rust Rustify ome.u.s.{as1, as2} Jun 3, 2024
@felixhekhorn felixhekhorn mentioned this pull request Jun 3, 2024
13 tasks
@felixhekhorn
Copy link
Contributor

@tgiani for whatever reason I hit the same bug you had with your Mac about not being able to run (e.g. LH benchmark) and not being able to read the passed areas ... I seem to have fixed it for me with 31f5d88 - can you please check your Mac again?

@tgiani
Copy link
Contributor Author

tgiani commented Jul 18, 2024

@felixhekhorn mm still getting the segmentation fault on my Mac

@felixhekhorn
Copy link
Contributor

There is something fishy somewhere, but I'm not able (yet) to pin it down: numbers are completely off, but even more strange is that it takes forever: the first row at charm yields Matching: computing operators - 1/60 took: 6.966508 s and at bottom even Matching: computing operators - 1/60 took: 15.570062 s - where as I would have expected the same performance as for evolution, i.e. <1s, and basically independence of $m_h$ ... we're doing somewhere a super expensive operations which destroys us ...

@felixhekhorn
Copy link
Contributor

weeell, setting is_ome=True might be a good idea 🙈 and voilà

$ EKO_LOG_STDOUT=1 poetry poe lha -m "vfns and nlo and not sv"
...
Matching: computing operators - 1/60 took: 4.034305 s
...
Evolution: computing operators - 1/60 took: 0.764231 s
...
Matching: computing operators - 1/60 took: 3.382806 s
...
Evolution: computing operators - 1/60 took: 0.741562 s
...
 ─── 
  S  
 ─── 
               x       Q2         eko     eko_error         LHA  percent_error
0   1.000000e-07  10000.0  332.741565  1.341722e-03  332.937173      -0.058752
1   1.000000e-06  10000.0  164.765584  6.932225e-04  164.893880      -0.077805
2   1.000000e-05  10000.0   77.030911  2.622980e-04   77.078341      -0.061535
3   1.000000e-04  10000.0   33.405733  1.284500e-04   33.429005      -0.069617
4   1.000000e-03  10000.0   13.108947  3.981809e-05   13.116959      -0.061084
5   1.000000e-02  10000.0    4.541797  1.143939e-05    4.543960      -0.047608
6   1.000000e-01  10000.0    1.426570  1.376738e-06    1.426512       0.004038
7   3.000000e-01  10000.0    0.531689  4.139063e-08    0.531585       0.019666
8   5.000000e-01  10000.0    0.156136  7.611243e-09    0.156085       0.032186
9   7.000000e-01  10000.0    0.023277  1.172161e-08    0.023264       0.055160
10  9.000000e-01  10000.0    0.000369  2.737629e-09    0.000370      -0.417440

 ─── 
  g  
 ─── 
               x       Q2          eko     eko_error          LHA  percent_error
0   1.000000e-07  10000.0  1115.529740  4.577419e-03  1116.700000      -0.104796
1   1.000000e-06  10000.0   522.276683  2.292990e-03   522.890000      -0.117294
2   1.000000e-05  10000.0   227.323659  9.689516e-04   227.530000      -0.090688
3   1.000000e-04  10000.0    89.432337  3.311808e-04    89.513000      -0.090114
4   1.000000e-03  10000.0    30.223422  9.473602e-05    30.245000      -0.071343
5   1.000000e-02  10000.0     7.744899  2.514960e-05     7.749100      -0.054216
6   1.000000e-01  10000.0     0.856014  8.421853e-07     0.855860       0.017986
7   3.000000e-01  10000.0     0.079655  5.506701e-08     0.079625       0.038195
8   5.000000e-01  10000.0     0.007731  1.967153e-09     0.007726       0.052698
9   7.000000e-01  10000.0     0.000376  1.017168e-09     0.000376       0.008711
10  9.000000e-01  10000.0     0.000001  8.105807e-11     0.000001       8.022571

 ─── 
  V  
 ─── 
               x       Q2       eko     eko_error       LHA  percent_error
0   1.000000e-07  10000.0  0.000173  3.879139e-10  0.000173      -0.000739
1   1.000000e-06  10000.0  0.000880  2.944259e-09  0.000880       0.000492
2   1.000000e-05  10000.0  0.004341  1.650161e-08  0.004341       0.000635
3   1.000000e-04  10000.0  0.020605  5.476226e-08  0.020605      -0.001092
4   1.000000e-03  10000.0  0.092159  4.117781e-07  0.092159       0.000383
5   1.000000e-02  10000.0  0.361059  3.414830e-07  0.361060      -0.000154
6   1.000000e-01  10000.0  0.825759  5.134189e-06  0.825760      -0.000105
7   3.000000e-01  10000.0  0.481750  1.782121e-06  0.481750      -0.000076
8   5.000000e-01  10000.0  0.152865  1.520803e-06  0.152864       0.000525
9   7.000000e-01  10000.0  0.023197  2.578698e-07  0.023194       0.011017
10  9.000000e-01  10000.0  0.000368  1.654251e-09  0.000370      -0.492932

 ──── 
  V3  
 ──── 
               x       Q2       eko     eko_error       LHA  percent_error
0   1.000000e-07  10000.0  0.000045  1.007756e-10  0.000045      -0.003866
1   1.000000e-06  10000.0  0.000230  7.642486e-10  0.000230      -0.000297
2   1.000000e-05  10000.0  0.001143  4.313288e-09  0.001143      -0.005199
3   1.000000e-04  10000.0  0.005472  1.456479e-08  0.005473      -0.003683
4   1.000000e-03  10000.0  0.024855  1.096205e-07  0.024855      -0.000789
5   1.000000e-02  10000.0  0.101505  1.108249e-07  0.101500       0.005199
6   1.000000e-01  10000.0  0.280726  1.725473e-06  0.280720       0.002175
7   3.000000e-01  10000.0  0.220826  9.082822e-07  0.220830      -0.001616
8   5.000000e-01  10000.0  0.089735  8.724371e-07  0.089736      -0.001229
9   7.000000e-01  10000.0  0.017007  1.824644e-07  0.017008      -0.002210
10  9.000000e-01  10000.0  0.000332  1.492524e-09  0.000334      -0.809578

 ──── 
  T3  
 ──── 
               x       Q2       eko     eko_error       LHA  percent_error
0   1.000000e-07  10000.0  0.000036  1.383132e-10  0.000036      -0.004906
1   1.000000e-06  10000.0  0.000191  7.773563e-10  0.000191      -0.000690
2   1.000000e-05  10000.0  0.000972  4.614924e-09  0.000972      -0.006174
3   1.000000e-04  10000.0  0.004761  9.648254e-09  0.004761      -0.004127
4   1.000000e-03  10000.0  0.021989  1.217926e-07  0.021989      -0.001241
5   1.000000e-02  10000.0  0.090811  1.019132e-07  0.090806       0.005752
6   1.000000e-01  10000.0  0.260785  7.839252e-07  0.260778       0.002417
7   3.000000e-01  10000.0  0.214814  8.928702e-07  0.214818      -0.001642
8   5.000000e-01  10000.0  0.088980  8.641834e-07  0.088982      -0.001373
9   7.000000e-01  10000.0  0.016981  1.820784e-07  0.016981      -0.002083
10  9.000000e-01  10000.0  0.000332  1.492493e-09  0.000334      -0.811554

 ──── 
  T8  
 ──── 
               x       Q2       eko     eko_error       LHA  percent_error
0   1.000000e-07  10000.0  2.153914  1.439704e-05  2.156173      -0.104796
1   1.000000e-06  10000.0  1.711096  7.480120e-06  1.711880      -0.045829
2   1.000000e-05  10000.0  1.361945  9.666445e-06  1.362341      -0.029047
3   1.000000e-04  10000.0  1.094436  1.651851e-06  1.094805      -0.033719
4   1.000000e-03  10000.0  0.923946  7.470550e-06  0.924159      -0.023040
5   1.000000e-02  10000.0  0.927778  5.333332e-07  0.927840      -0.006663
6   1.000000e-01  10000.0  0.988245  2.712411e-06  0.988250      -0.000555
7   3.000000e-01  10000.0  0.498996  1.815975e-06  0.498996      -0.000111
8   5.000000e-01  10000.0  0.154090  1.534709e-06  0.154089       0.000406
9   7.000000e-01  10000.0  0.023225  2.583130e-07  0.023222       0.010323
10  9.000000e-01  10000.0  0.000368  1.654287e-09  0.000370      -0.491260

 ───── 
  T15  
 ───── 
               x       Q2       eko     eko_error       LHA  percent_error
0   1.000000e-07  10000.0  4.307617  2.891693e-05  4.310173      -0.059305
1   1.000000e-06  10000.0  3.421379  1.571022e-05  3.421880      -0.014638
2   1.000000e-05  10000.0  2.719826  2.177753e-05  2.718341       0.054649
3   1.000000e-04  10000.0  2.169014  4.065769e-06  2.169705      -0.031865
4   1.000000e-03  10000.0  1.757060  1.453013e-05  1.757259      -0.011341
5   1.000000e-02  10000.0  1.495468  1.428291e-06  1.495620      -0.010152
6   1.000000e-01  10000.0  1.150784  2.830622e-06  1.150787      -0.000220
7   3.000000e-01  10000.0  0.516242  5.985910e-07  0.516243      -0.000119
8   5.000000e-01  10000.0  0.155315  8.489275e-07  0.155315       0.000313
9   7.000000e-01  10000.0  0.023253  2.418380e-07  0.023251       0.009621
10  9.000000e-01  10000.0  0.000368  2.152576e-09  0.000370      -0.489588

 ───── 
  T24  
 ───── 
               x       Q2        eko     eko_error        LHA  percent_error
0   1.000000e-07  10000.0  32.582545  1.888120e-04  32.582173       0.001140
1   1.000000e-06  10000.0  20.589143  1.133768e-04  20.593880      -0.023002
2   1.000000e-05  10000.0  12.615502  1.000426e-04  12.618341      -0.022500
3   1.000000e-04  10000.0   7.442083  1.566929e-05   7.444505      -0.032539
4   1.000000e-03  10000.0   4.215325  2.697783e-05   4.216459      -0.026905
5   1.000000e-02  10000.0   2.348689  3.860981e-06   2.349260      -0.024309
6   1.000000e-01  10000.0   1.249313  4.184298e-07   1.249307       0.000453
7   3.000000e-01  10000.0   0.522094 -1.496627e-08   0.522065       0.005441
8   5.000000e-01  10000.0   0.155599  1.237903e-08   0.155584       0.009362
9   7.000000e-01  10000.0   0.023259  1.362224e-07   0.023254       0.022523
10  9.000000e-01  10000.0   0.000368  2.453737e-09   0.000370      -0.468914

the old implementation is still compiling for a direct comparison ... the timing is still a bit surprising though ...

@felixhekhorn
Copy link
Contributor

the old implementation is still compiling for a direct comparison ... the timing is still a bit surprising though ...

okay, seems I misremembered the old timings

Matching: computing operators - 1/60 took: 1288.759960 s
Matching: computing operators - 2/60 took: 12.027686 s
...
Evolution: computing operators - 1/60 took: 220.868200 s
Evolution: computing operators - 2/60 took: 2.513458 s
...
Matching: computing operators - 1/60 took: 11.522349 s
...
Evolution: computing operators - 1/60 took: 3.467443 s

i.e. we get a factor ~4 in either case which is fine

numbers are 1:1 the same

@tgiani
Copy link
Contributor Author

tgiani commented Jul 19, 2024

allez

@tgiani
Copy link
Contributor Author

tgiani commented Jul 19, 2024

ok thank you for your work on thi. I guess I can go on with as2

@felixhekhorn felixhekhorn marked this pull request as ready for review October 11, 2024 12:57
@felixhekhorn felixhekhorn merged commit 972edc4 into master Oct 14, 2024
6 of 7 checks passed
@felixhekhorn felixhekhorn deleted the ome_rust branch October 14, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor code rust Rust extension related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants