Open valassi opened 3 years ago
Looks like madgraph is using the fundamental basis and not the color-flow basis. I still have to better understand that point since I was convinced that we were using the colour-flow basis.
Hi @roiser as discussed, I suggest you use this ticket to document progress in tensor cores for color algebra if you like? (There is also the more general #118 on tensor cores if you want, but for color algebra specifically I think this one is better). Thanks! Andrea
One simple change that may be useful for tensor cores but I fnd useful anyway is streamlining (A-iB)(M)(A+iB) as AMA+BMB #457
I thought this would give a performance boost, it does not. But I would still keep that
Hi @roiser @oliviermattelaer I open a generic issue about color algebra optimisations.
(Hi @ingvildh, this is what we discussed this morning and where I suggested that maybe the A100 tensor cores could be interesting)
This can be considred one issue in the epic of gg to ttgg optimisations, issue #146. I put some snippets of the code using a commit I used there, https://github.com/madgraph5/madgraph4gpu/commit/dd8711d0aa22c85429802b23de3169a68a97f298
This only exists for QCD processes, eg gg to tt(g)(g), not eemumu. It is one of the only places where calculating the "matrix element" (of the scattering matrix) actually involves matrix multiplications.
The more particles in the final state, the larger the "color matrix" involved.
For ggttgg, IIUC this is essentially this snippet here: https://github.com/madgraph5/madgraph4gpu/blob/dd8711d0aa22c85429802b23de3169a68a97f298/epoch2/cuda/gg_ttgg/SubProcesses/P1_Sigma_sm_gg_ttxgg/gCPPProcess.cu#L1133
So here in practice it is a quadratic form using a 24x24 matrix. I think that for gg to ttggg or ttgggg the dimensionality can still increase enormously.
See for instance O. Mattelaer, K. Ostrolenk, Speeding up MadGraph5_aMC@NLO, MCNET-21-01 (2021). https://arxiv.org/abs/2102.00773 Here it is found that for three gluons ie gg to ttggg, the color algebra takes 60% of the computation overall (in the production Fortran code).
Olivier had mentioned that the problem is not only the dimension of the matrix, but also the fact that for each event the calculation is repeated for each helicity (which here are 64 https://github.com/madgraph5/madgraph4gpu/blob/dd8711d0aa22c85429802b23de3169a68a97f298/epoch2/cuda/gg_ttgg/src/mgOnGpuConfig.h#L52)
There are many different schemas for color algebra, but I think we are using the 'color flow' formalism: F. Maltoni, K. Paul, T. Stelzer, S. Willenbrock, Color-flow decomposition of QCD amplitudes, Phys. Rev. D 67 (2003) 014026. https://doi.org/10.1103/PhysRevD.67.014026
This 2009 paper also make many useful comments about the complexity of porting the color algebra to GPUs K. Hagiwara et al., Calculation of HELAS amplitudes for QCD processes using graphics processing unit (GPU), Eur. Phys. J. C 70 (2010) 513. https://doi.org/10.1140/epjc/s10052-010-1465-5
I think that what would need to be done is