-
Notifications
You must be signed in to change notification settings - Fork 32
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
xsec from fortran and cpp differ in gq_ttq tmad tests (wrong order of couplings) #748
Comments
I started looking into this. What I’m doing is to create via our new plugin interface the directories for fortran and c++ code with
and
respectively. My first observation is that there are different numbers of P1 directories produced i.e.
and
Is this related to the Going a bit further I then produce the cross sections for fortran/P1_gq_ttxq and cpp/P1_gu_ttxu, cpp/P1_gux_ttxux where I end up with numbers e.g.
and
can I sum up the two cpp ones to the fortran one? They don’t … there is a factor 2 between them. Before going further I wanted to see if I can reproduce the same numbers in fortran with the two P1 directories generated. Can this generation of the two P1 directories be forced? |
Hi @roiser thanks for looking into this. Apologies, I should have posted the details here of where I see the errors. There is a script already-made where you get everything automatically. For instance with current upstream/master:
This is one of the tests I run every time I do a MR. The log is always here Specifically: the discrepancy is not a factor two, so I am not sure your findings explain it. Also because I do not think you are comparing the right numbers, see below. About the number of directpries produced in pp_ttj and gg_ttj, this is an interesting issue but I think it is a known one (and unrelated to gq_ttq cross ssection mismatch). There was one setting which was the default in fortran-without-second-exporter, which however was giving issues in cudacpp (something about mirroring? something about q and q~ better being in separate P1s?... I will try to find the issue number). As a result, Olivier suggested to disable this setiing for cudacpp, and this is (I think) why you see different numbers of P1 directpries. Anyway, when I see that you are not comparing the right numbers: you are comparing above the fortrran xsec with one seeting for the P1s, against the cpp with a different setting for the P1s. So a facator two may come from that, and might even be normal (instead of one P1 with a xsec 2X, you have two P1s each with xsec X, the sum being 2X anyway?). What I am comparing in the tmad test is instead the cpp with its P1 setting, against the fortran with the same setting as cpp for the P1. In other words: I am generating the cudacpp code, an dthen I am using the fortran that we find inside that same cpp code directory. I have not checked that this is consisten with the fortran in the optimized fortran setting, but I assume that Olivier had done this right an dthere was no need to check. I will try to find the issue for this doubling of directories now. |
(By the way: I think that the difference is essentially using fbridge mode = 0 or 1... actually tmad probably uses two different executables madevent_fortran and madevent_cpp, but I guess that you could also use madevent_cpp in both cases with the options fbridge=0 and1. If you use option fbridge=-1, this will print out event by event comparisons of fortran and cpp MEs, which miught help) |
I think (@oliviermattelaer should confirm) that what @roiser has just described above is related to "mirror processes" and to "nprocesses>1". This was discussed in issue #272 and MR #396. See in particular this figure from issue #272 : |
So, to bring back the focus on gq_ttq: the issue that we should solve is the
|
Thanks Andrea, I'm trying to debug this on a finer grained level, actually when comparing the two "fortran" and "cpp" there are differences in cross sections of most of them (but not all), I wonder if this is a valid way of tracing down the bug. I presume we need @oliviermattelaer for this, e.g. I run
and reveive for fortran
and C++
|
Note also that the madX test runs only one of the P1:
|
Thanks Stefan. I think that what you are testing at another level is also useful - but for the purpose of debugging this issue #748, I would just focus on the way this bug was identified, no need to do it differently. IMHO you are overcomplicating it if you go your way, but then your choice ;-) Note also: cross sections depend in very subtle way on which events are used in the sampling. And if you use different settings you most likely end up with different eventgs. Which means you must run the tests at a statistical level, not bit by bit. I would stick to the madX script... |
PS
|
I started producing the cross sections for processes which only produce a single sub processes and they show differences with gluon quarks in the initial state. |
Thanks again, I think its much better to produce those simpler processes. I can reproduce the error now using the mg5 plugin interface. Just to make sure I also ran a few other processes which look ok always comparing
|
Quick update on the status of things: as seen above g u > t t~ u does produce wrong results. After a chat with Olivier we concluded that the problem should be on the cppcuda side (alphaS?). In order to prove this I want to compare the "standalone" versions of fortran and cudacpp. The problem now is that "output standalone" produces a compilation error (see below). The vector.inc file is not produced. I need to check in the code generating code.
|
A fix for the above issue of the missing vector.inc has been proposed in mg5amcnlo/mg5amcnlo#65 |
I confirm that proc_gu_ttxu_for |
@roiser @valassi @oliviermattelaer For native MGaMC I get:
whereas for cudacpp I get
which differ by roughly but not exactly a factor 2. So, there definitely seems to be an issue in the amplitude evaluation, but as said this is only a single phase space point I've checked. |
Can you check the value of the couplings?
olivier
On 23 Aug 2023, at 14:37, Zenny Wettersten ***@***.***> wrote:
@roiser<https://github.com/roiser> @valassi<https://github.com/valassi> @oliviermattelaer<https://github.com/oliviermattelaer>
I just did a quick standalone check of cudacpp vs upstream for the same phase space point
For native MGaMC I get:
Phase space point:
…-----------------------------------------------------------------------------
n E px py pz m
1 0.7500000E+03 0.0000000E+00 0.0000000E+00 0.7500000E+03 0.0000000E+00
2 0.7500000E+03 0.0000000E+00 0.0000000E+00 -0.7500000E+03 0.0000000E+00
3 0.1354789E+03 0.1344191E+03 -0.1686881E+02 -0.1209253E+01 0.1364261E+00
4 0.6441284E+03 0.2809898E+03 -0.3353039E+03 0.4727762E+03 0.3109229E+00
5 0.7203927E+03 -0.4154090E+03 0.3521728E+03 -0.4715670E+03 0.2978233E+00
-----------------------------------------------------------------------------
Matrix element = 4.4143826846910579E-003 GeV^ -2
-----------------------------------------------------------------------------
whereas for cudacpp I get
--------------------------------------------------------------------------------
Momenta:
1 7.500000e+02 0.000000e+00 0.000000e+00 7.500000e+02
2 7.500000e+02 0.000000e+00 0.000000e+00 -7.500000e+02
3 1.354789e+02 1.344191e+02 -1.686881e+01 -1.209253e+00
4 6.441284e+02 2.809898e+02 -3.353039e+02 4.727762e+02
5 7.203927e+02 -4.154090e+02 3.521728e+02 -4.715670e+02
--------------------------------------------------------------------------------
Matrix element = 0.00203141 GeV^-2
--------------------------------------------------------------------------------
which differ by roughly but not exactly a factor 2. So, there definitely seems to be an issue in the amplitude evaluation, but as said this is only a single phase space point I've checked.
—
Reply to this email directly, view it on GitHub<#748 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AH6535V644PI4PBS2BXB5G3XWX2Q7ANCNFSM6AAAAAA3PPJCUM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks @zeniheisser !! I did the same this morning and saw the same. Another thing worries me a bit. I thought we are able to produce exactly the same values for Fortran and Cudacpp eg for other processes. Eg I tried „g g > t t-“ the values are close but not the same. |
@roiser can you do this? I could take a quick look at it tomorrow otherwise, but I'm not exactly drowning in free time at the moment hehe
@roiser, I think you'll have agreement to the level of momentum precision though, no? That's what I have seen when doing tests --- there is a slight difference, but roughly on the order of precision of the momenta I've explicitly set for the processes. |
I checked now, the G value is the same in fortran and cudacpp |
The G value is the same, but when running the debugger I see that in fortran and cudacpp the GC_10 and GC11 are swapped. E.g. I find in fortran
while in cudacpp the values are for
and
I now swapped the two COUPs entries in the arguments of the ixxx/FFV functions and this renders the same Matrix element value !!! Now we need to find out why only in this case the couplings had been swapped ... |
Good job!! That's a huge findings (and so easy to miss). Thanks so much. |
…qttq xsec is now correct! fixes high-priority issue madgraph5#748 These three tests now succeed (they used to fail) ./tmad/teeMadX.sh +10x -gqttq -makeclean ./tmad/teeMadX.sh +10x -gqttq -makeclean -fltonly ./tmad/teeMadX.sh +10x -gqttq -makeclean -mixonly NB: eemumu code generation remains to be fixed after PR madgraph5#757
…) and gqttq (xsec differs again madgraph5#748) STARTED AT Sat Oct 28 01:08:49 PM CEST 2023 ENDED AT Sat Oct 28 01:30:55 PM CEST 2023 Status=0 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_eemumu_mad/log_eemumu_mad_d_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_eemumu_mad/log_eemumu_mad_f_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_eemumu_mad/log_eemumu_mad_m_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttggg_mad/log_ggttggg_mad_d_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttggg_mad/log_ggttggg_mad_f_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttggg_mad/log_ggttggg_mad_m_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttgg_mad/log_ggttgg_mad_d_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttgg_mad/log_ggttgg_mad_f_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttgg_mad/log_ggttgg_mad_m_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttg_mad/log_ggttg_mad_d_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttg_mad/log_ggttg_mad_f_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggttg_mad/log_ggttg_mad_m_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggtt_mad/log_ggtt_mad_d_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggtt_mad/log_ggtt_mad_f_inl0_hrd0.txt 24 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_ggtt_mad/log_ggtt_mad_m_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_gqttq_mad/log_gqttq_mad_d_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_gqttq_mad/log_gqttq_mad_f_inl0_hrd0.txt 0 /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/tmad/logs_gqttq_mad/log_gqttq_mad_m_inl0_hrd0.txt --- This is a summary of the changes with respect to my previous logs using the August code base Functionality: - ggttggg: madevent crashes - gqttq: xsec differs again Performance (Fortran overhead): -- all very similar Performance (MEs): -- eemumu: fortran 20% faster, cuda slightly slower, simd a factor 2 to 3 slower -- ggtt: fortran and simd 20% faster, cuda similar -- ggttg: fortran 10% faster, simd and cuda similar -- ggttgg: all very similar +ERROR! ' ./madevent_fortran < /tmp/avalassi/input_ggttggg_x1_fortran > /tmp/avalassi/output_ggttggg_x1_fortran' failed +d R # 5 > -0.0 -0.0 -0.0 0.4 0.4 +d R # 6 > -0.0 -0.0 -0.0 -0.0 0.4 +s min # 3> 0.0119716.0 29929.0 29929.0 0.0 +s min # 4> 0.0 0.0 29929.0 29929.0 0.0 +s min # 5> 0.0 0.0 0.0 0.0 0.0 +s min # 6> 0.0 0.0 0.0 0.0 0.0 +xqcutij # 3> 0.0 0.0 0.0 0.0 0.0 +xqcutij # 4> 0.0 0.0 0.0 0.0 0.0 +xqcutij # 5> 0.0 0.0 0.0 0.0 0.0 +xqcutij # 6> 0.0 0.0 0.0 0.0 0.0 +ERROR! xsec from fortran (0.26050333309703716) and cpp (1.2757941949814184) differ by more than 2E-14 (3.8974198518457603)
Hi @valassi thanks, good catch. I quickly checked the cpp vs fortran and indeed the couplings are swapped back in the wrong order for e.g. gu>ttxu. From quickly looking at #761 I realise that the ordering of the couplings following the correct order in |
Ok, I couldn't wait ;-), there is #782, the trick was to swap the two containers when filtering out the running couplings from wanted_couplings, this preserves the order or the filtered keys. NB: This is WIP, I tested a few processes but will do more checks. |
…t23av This is meant to fix gqttq madgraph5#748
Thanks Stefan! I checked gqttq it looks good, I merged PR #782 |
I only checked gu>ttxu and dy+2j, let me re-open this one to remind me to do more checks so we can be sure its really fixed. |
Hi Stefan, did you manage to run your tests here? Is this confirmed fixed? Thanks |
Thanks, yes this is all fine, closing it. |
This is a follow-up to #630, which had originally been files about gq_ttq but eventually focused on gg_uu: xsec from fortran and cpp differ in gq_ttq tmad tests.
In #630, I had also found out that xsec from fortran and cpp also differed in gg_uu tmad tests, but with Zenny's help this was identified as a problem in getGoodHel and fixed. This however fixed gg_uu, but not gq_ttq, where xsecs are still different. For clarity, I move here gq_ttq, while I will soon close #630 about gg_uu.
The text was updated successfully, but these errors were encountered: