Skip to content

Conversation

@davidrohr
Copy link
Collaborator

@shahor02 : For reference. The TrackParCov and propagator now work on the GPU (using sergeys polynomial version of the magnetic field, the MagFieldFast is not compatible). I did a quick benchmark, and it is ~2x slower than Sergey's model on the GPU. On the CPU Sergey's model is still ~30% faster.

shahor02
shahor02 previously approved these changes Jan 4, 2021
Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Was your benchmark with mat.LUT attached? If I understand correctly, with GPU track model a pre-calculated material correction is applied, while with TrackParCov the material is queried per step.

@davidrohr
Copy link
Collaborator Author

@shahor02 : Good point. I actually tried to run the benchmark with the LUT in both cases, but after your question I double-checked and found a bug in the refit code which passed a nullptr in case of the GPU track model... :) I just reran with LUT in all cases:

  • NVIDIA 3090 GPU Track Model: 66.341 us
  • NVIDIA 3090 TrackParCov: 96.374 us
  • AMD Rome 64 core 4 GHz GPU Track Model: 196.900 us
  • AMD Rome 64 core 4 GHz TrackParCov: 221.634

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still on mat.correction: on the CPU this will use by default MatCorrType matCorr = MatCorrType::USEMatCorrTGeo, i.e. slow TGeo query (although, in case of TPC volume it should be faster than average TGeo query).
To avoid this, I can change the default matCorr to USEMatCorrLUT, with fall-back to using TGeo in

GPUd() MatBudget Propagator::getMatBudget(Propagator::MatCorrType corrType, const math_utils::Point3D<float>& p0, const math_utils::Point3D<float>& p1) const
in case the mMatLUT was not set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahor02 : I am quite sure I was not using TGeo but the matLut, because my benchmark is not even aware of TGeo. I have added the forced switch here: https://github.com/AliceO2Group/AliceO2/blob/22cdc82f69322f0710d549944740667d0d3130dd/Detectors/Base/src/Propagator.cxx#L521
So for GPU and for my standalone tool it will always use the matLut.
Perhaps I should throw an exception if the setting points to TGeo, or do you think it is OK as is?
In general, I think it makes sense to use matLut by default.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if for the benchmark you have used GPUCA_... also for CPU / TrackParCov case, then you have used matLUT.
I will change default to USEMatCorrLUT and add a fall-back to TGeo in getMatBudget (respecting your ifdef).

@davidrohr davidrohr merged commit 02cf084 into AliceO2Group:dev Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants