DUNE / larnd-sim

Simulation framework for a pixelated Liquid Argon TPC
Apache License 2.0
10 stars 26 forks source link

[Design change] Voxelize larnd-sim #232

Open YifanC opened 2 months ago

YifanC commented 2 months ago

Paraphrasing (largely copy-paste) Kazu's suggestion here:

Voxelize the entire TPC region instead of using segments for drifting. GPU is designed to execute massively parallelizable computation, in particular the matrix multiplication. Processors are advancing towards increasing memory size and bandwidth rather than making smarter use of individual cores. We can utilize sparse tensor to tackle the problem. With the current version, we use segments as a base and then convert it into pixels (some 2D voxelization). The indexing map between segments and pixels need be computed and carried around. We have to write cuda kernels for each index conversion. It increases the manual work, reduces the readibility and is prong to errors. It can be incompatible with batching capability that is often deployed in GPU computation. Rewriting using sparse tensors would allow us to use community developed functions. We can have full vectorization without writing our own kernels every step. Potentially you can batch the time dimension. (I didn't understand this part. I also think it makes backtracking easier.) This would make larndsim more readable and more extendable.

I think it's a cool project. It's a bigger step than #231. Again I'm interested in this project, but cannot promise time at the moment. There is no name tag on these (organic development). Whoever has the interest and time should try it. Tag people who might be interested here @jaafar-chakrani @mjkramer.