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

Fix block weights for fixed vertex partitioning #150

Merged
merged 3 commits into from
Apr 8, 2023

Conversation

SebastianSchlag
Copy link
Member

@SebastianSchlag SebastianSchlag commented Mar 31, 2023

This PR addresses #148.

Quoting @kittobi1992:

A short explanation: Before initial partitioning, we remove all fixed vertices from the hypergraph and then partition the remaining free vertices. Afterwards, we assign the blocks of the initial partition to the fixed vertex blocks such that the connecitivity metric is minimized. However, when removing the fixed vertices we do not adjust the maximum allowed block weights for initial partitioning. This results in an initial partition where all free vertices are assigned to one block when using your data. Therefore, it is not possible to find a balanced partition with the fixed vertices in the second step.

@@ -233,6 +234,12 @@ static inline void partition(Hypergraph& input_hypergraph,
HypergraphPtr(hg_without_fixed_vertices.first.release(),
delete_hypergraph);
fixed_vertex_free_to_input = hg_without_fixed_vertices.second;

for ( PartitionID block = 0; block < original_context.partition.k; ++block ) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@kittobi1992 I might be missing something, but shouldn't this be something like

if (original_context.use_individual_part_weights) {
  for ( PartitionID block = 0; block < original_context.partition.k; ++block ) {
     rb_context.partition.max_part_weights[block] -= input_hypergraph.fixedVertexPartWeight(block);
  }
} 
rb_context.setupPartWeights(input_hypergraph_without_fixed_vertices->totalWeight());

so that we use the "normal" block-weight setup code whenever we don't use individual part weights?

Copy link
Member

Choose a reason for hiding this comment

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

No, the fixed vertex block weights can be different for each block, which leads to individual block weights for initial Partitioning. If we do not use individual block weights, the part weight setup function will assign the same max part weight for each block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I see. That makes sense. Thanks for your explanation.

for ( PartitionID block = 0; block < original_context.partition.k; ++block ) {
rb_context.partition.max_part_weights[block] -= input_hypergraph.fixedVertexPartWeight(block);
}
rb_context.partition.use_individual_part_weights = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

This should also not be needed since we copy-construct the rb_context from the original_context, right?

Copy link
Member

Choose a reason for hiding this comment

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

Should be answered with my previous comment. Even if we do not use individual block weights, removing fixed vertices leads to individual block weights for initial Partitioning.

@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #150 (180d52b) into master (5622a01) will increase coverage by 0.00%.
The diff coverage is 68.42%.

❗ Current head 180d52b differs from pull request most recent head bcbba9c. Consider uploading reports for the commit bcbba9c to get more accurate results

@@           Coverage Diff           @@
##           master     #150   +/-   ##
=======================================
  Coverage   84.41%   84.42%           
=======================================
  Files         204      204           
  Lines       17792    17797    +5     
  Branches     9805     9807    +2     
=======================================
+ Hits        15020    15025    +5     
  Misses       2772     2772           
Impacted Files Coverage Δ
kahypar/partition/recursive_bisection.h 70.81% <68.42%> (+0.57%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SebastianSchlag SebastianSchlag changed the title Fixed vertex balance fix Fix block weights for fixed vertex partitioning Apr 8, 2023
@SebastianSchlag SebastianSchlag merged commit efa12a9 into master Apr 8, 2023
6 of 8 checks passed
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.

None yet

2 participants