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

PSO Speed up #221

Closed
Closed

Conversation

NicerNewerCar
Copy link
Contributor

@NicerNewerCar NicerNewerCar commented Oct 25, 2023

  • Closes How possible is it to run the particle optimization in parallel? #218
  • Initial results are great, cutting the optimization time to 5/6 seconds [Debug] 2/3 seconds [Release] on my machine
  • Currently, I am validating the accuracy of this. I've noticed sometimes it likes to optimize to a nonideal position (ie. not in the correct position on the radiograph). Not sure if this is an issue with my changes or something pre-existing.
    • @amymmorton @jcfr If you both could play around with this PR, that may help expedite the validation process.

@NicerNewerCar NicerNewerCar changed the title WIP: PERF: Parallelize PSO PSO Speed up Oct 25, 2023
@NicerNewerCar NicerNewerCar force-pushed the parallel-pso branch 3 times, most recently from 00181de to d9fa295 Compare October 25, 2023 19:16
Copy link
Contributor

@jcfr jcfr left a comment

Choose a reason for hiding this comment

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

Moving in that direction makes sense 👌

Could you contribute the API changes (introduction of Particle and vector of Particle) into its own pull request ?

That way the pull request introducing the threading support will be reduce to its strict minimum and the review will be easier.

libautoscoper/src/PSO.hpp Outdated Show resolved Hide resolved
@NicerNewerCar
Copy link
Contributor Author

See #223

Rebase this branch once that is integrated.

* For any given particle p, this update removes any recomputation of the
  NCC fitness value.
* Replaces arrays with vectors
* This drops the per frame opt time from ~9 to ~18 seconds to around ~3
  seconds
@NicerNewerCar
Copy link
Contributor Author

Rebased this with #223, Seems some of the errors I corrected over there led to this not being as fast. 223 Runs in 3-5 seconds while adding the multithreading added enough overhead that it actually slowed this down to 8-9 seconds.

@NicerNewerCar NicerNewerCar requested a review from jcfr October 26, 2023 19:16
@NicerNewerCar NicerNewerCar deleted the parallel-pso branch December 18, 2023 14:08
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.

How possible is it to run the particle optimization in parallel?
2 participants