Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
parallelize costmap bound updates #2393
parallelize costmap bound updates #2393
Changes from 1 commit
892ead2
c2bf850
e7323cb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, this scheduling makes it so that each thread takes 1 iteration at a time statically. Why specify this and not have it use
auto
or the other options? Genuinely not sure, this might be the right thing to do but askingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous point, if you have a small number of iteration and
auto
sets a schedule for one thread to take all iterations at once this wouldn't make any sense. I'm just cautious aboutauto
because I don't know what the compiler will do here in that case. Therefore one plugin or filter update allocated to one thread seems most appropriate because the number is usually less than 5There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you see a demonstrable change for your testing with and without this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll get back with some quantitative results on this one, haven't tested with
auto
actuallyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or even just lacking of schedule specification, which I assume is auto. I think it defaults to the number of cores)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we can leave scheduling for OpenMP.
I would go with the third one since the difference is not noticeable and it seems more flexible. I've pushed code with that version. Probably those variables in front of the loop could be made static member variables.
I'll update you on the speed-up in the near future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got back to the speed-up evaluation. Funny enough, without
DEBUG
log level parallel version is actually underperforming compared to the plain loop... Log level was influencing my measurements previously somehow.These are averaged updated from both local and global cost maps. With this config: https://github.com/simutisernestas/navigation2/blob/parallel_config/nav2_bringup/bringup/params/nav2_params.yaml. I wonder if that would be the case with heavier cost map layers or bigger map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.1 ms, why so fast? Oh, is this in the TB3 sandbox world? Yeah, it might be worth trying something larger. This shows an overview of getting nav2 running in the AWS warehouse world https://github.com/ros-planning/navigation2/tree/main/nav2_simple_commander.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strangely enough, map updates are even faster on AWS warehouse world demo. I've pulled the latest changes from the repo the code must have been upgraded since the last time I've benchmarked this. Both parallel and serial versions do the job in about the same amount of time. With parallel slightly better, but it's insignificant I would say. I'm testing on
Intel® Core™ i7-3770 CPU @ 3.40GHz × 8
with the same config as mentioned previously.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't surprise me, since you if each thread is doing "more" work, then the overhead of spinning up a new thread is more worth it. It's about 8% it seems, do you know why its lower than what you were seeing before when you reported a ~30% increase in speed? I'm also a little dubious since the updates are so fast. Your other experiment reported 12-20ms in update times (I assume more data) while this is less than 1ms. 1ms seems way too fast to be what you'd see in a practical deployed application so I wonder if in a more realistic setup where things are taking longer if we do see that benefit again.