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

Think about memory coalescing #67

Open
hahnjo opened this issue Jan 20, 2021 · 2 comments
Open

Think about memory coalescing #67

hahnjo opened this issue Jan 20, 2021 · 2 comments
Labels
performance Type: Runtime and / or memory behavior

Comments

@hahnjo
Copy link
Contributor

hahnjo commented Jan 20, 2021

Once there is a sufficiently advanced prototype that allows realistic profiling, it might be worth thinking about the device memory layout and memory coalescing:

Right now, BlockData stores an array of structures. When accessing the same field of all tracks, this results in strided memory accesses and the hardware may not be able to do much about it. Instead, data accessed for all tracks simultaneously could be stored in a structure of arrays, if memory bandwidth is an issue for one of the kernels and memory coalescing is measured to improve performance.

@agheata
Copy link
Contributor

agheata commented Jan 20, 2021

The new container SparseArray is the evolved version, it will allow both stridden access (based on collected indices of tracks alive or other arbitrary criteria) and coalescing (compacting tracks into a new container). Both operations have overheads, to be seen which one is more efficient in which conditions for the simulation workflow. The alternative of coalescing only the needed data into specific SOA is an evolution to be considered.

@hahnjo
Copy link
Contributor Author

hahnjo commented Jan 20, 2021

The alternative of coalescing only the needed data into specific SOA is an evolution to be considered.

Yes, this is what the hardware can optimize for and what I was referring to.

@hahnjo hahnjo added the performance Type: Runtime and / or memory behavior label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Type: Runtime and / or memory behavior
Projects
None yet
Development

No branches or pull requests

2 participants