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

optimize computation and memory #43

Merged
merged 10 commits into from
Aug 15, 2023
Merged

Conversation

felicepantaleo
Copy link
Contributor

@felicepantaleo felicepantaleo commented Jul 12, 2023

This PR should improve the overhead of looping over tiles by avoiding multiple copies

Copy link
Member

@jmcarcell jmcarcell left a comment

Choose a reason for hiding this comment

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

Looks good. Maybe @ebrondol wants to comment on this.
Did you measure if there is any improvement? I would guess that not much since the copies were in the outer parts of the for loops, unless there is a huge number of points (?)

include/LayerTiles.h Show resolved Hide resolved
src/CLUEAlgo.cc Outdated Show resolved Hide resolved
@jmcarcell jmcarcell closed this Jul 12, 2023
@jmcarcell jmcarcell reopened this Jul 12, 2023
@ebrondol
Copy link
Collaborator

Looks good. Maybe @ebrondol wants to comment on this. Did you measure if there is any improvement? I would guess that not much since the copies were in the outer parts of the for loops, unless there is a huge number of points (?)

Hi @jmcarcell , I am testing the PR currently. The preliminary performance looks much better than before computing time wise, so I am confident it can be marged soon.

@felicepantaleo
Copy link
Contributor Author

Looks good. Maybe @ebrondol wants to comment on this. Did you measure if there is any improvement? I would guess that not much since the copies were in the outer parts of the for loops, unless there is a huge number of points (?)

well, if every time you copy all the points in a layer, the overhead of creating tiles becomes bigger than the clustering itself and you enter the paradox in which coarser tiling gives better performance.

@ebrondol
Copy link
Collaborator

ebrondol commented Jul 17, 2023

image
Indeed the timing is doing much better now.
After that all discussions are solved, I will merge the PR.

Copy link
Collaborator

@ebrondol ebrondol left a comment

Choose a reason for hiding this comment

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

The changes align with the expectation of about a factor of 50-100 improvements in computing time.

@ebrondol
Copy link
Collaborator

The tests I run locally worked out fine.
I would rather wait until Issue #45 is closed and the CI is running again before merging it.

@felicepantaleo
Copy link
Contributor Author

Thank you, Erica. Sure, I'm not in a hurry to have it merged.

@ebrondol
Copy link
Collaborator

ebrondol commented Jul 20, 2023

Just for reference, I have produced the timing plots again with the latest commits from @felicepantaleo :
image
(disregard the label "before PR#43" because it is outside the x-axis region)

@ebrondol
Copy link
Collaborator

ebrondol commented Aug 7, 2023

I have tested this PR extensively with other detectors and I think it can be merged also before the CI is fixed (still under progress and being monitored in #44 ).

@ebrondol ebrondol enabled auto-merge (squash) August 9, 2023 14:32
@ebrondol ebrondol disabled auto-merge August 9, 2023 14:34
@ebrondol ebrondol enabled auto-merge (squash) August 15, 2023 11:58
@ebrondol ebrondol disabled auto-merge August 15, 2023 11:59
@ebrondol ebrondol enabled auto-merge (squash) August 15, 2023 12:08
@ebrondol ebrondol disabled auto-merge August 15, 2023 12:08
@ebrondol ebrondol merged commit 4dafad2 into key4hep:main Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants