96 improvements in cost calculation#97
Merged
Merged
Conversation
francosansone
commented
Sep 3, 2025
| GainObjectImbalance max_gain = GainObjectImbalance{ | ||
| numeric_limits<size_t>::infinity(), | ||
| numeric_limits<size_t>::infinity(), | ||
| -numeric_limits<size_t>::infinity(), |
Collaborator
Author
There was a problem hiding this comment.
I've just made a very simple change since max_gain here and in update_diff was not properly initialized, they both were initialized with gain = 0. FYI @joaquinffernandez .
Kalashnikovni
approved these changes
Sep 8, 2025
| SBG::LIB::UnordAF set_fact; | ||
| SBG::LIB::MapAF map_fact(set_fact); | ||
| SBG::LIB::UnordPWMapAF pw_fact(map_fact); | ||
| SBG::LIB::UnordAF set_fact; |
Collaborator
There was a problem hiding this comment.
UnordAF creates unordered sets, that for uni-dimensional dense intervals is inefficient.
Collaborator
Author
There was a problem hiding this comment.
Related to this, should we use OrdDenseAF when dealing with uni-dimensional intervals?
|
|
||
| virtual ~CommunicationCost() = default; | ||
|
|
||
| virtual void update_partitions(PartitionMap& partitions, std::optional<std::reference_wrapper<const std::list<size_t>>> modified_partitions = std::nullopt); |
Collaborator
There was a problem hiding this comment.
I think that functions should actually override the virtual ones in ICommunicationCost, so they shouldn't be declared as virtual.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some improvements in:
New way to compute external communication by partition. This replaces$\mathbf{compute\_EC\_IC}$ for a more efficient alternative.
Then, to compute External and Internal cost, we only need to compute the difference between the entire communication and the external one.
Regarding software design:
ICommunicationCostwas defined, it is the interface to compute communication between nodes and/or set pieces. Then, two classes are implemented,CommunicationCostdoes the actual operations,CommunicationCostSyncit is a wrapper that prevents from data races.Furthermore, two flags were added:
Regarding performance:
For the air conditioners with a controller, 4 sections, size of 1000 and 4 partitions:
sb-graph-dev96-improvements-in-cost-calculationFor the spiking neurons with size of 1000, 10 connections, 100 inputs and 4 partitions:
sb-graph-dev96-improvements-in-cost-calculationExamples were executed in a single thread.