-
Notifications
You must be signed in to change notification settings - Fork 300
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
Address some MNMG issues in cython.cu #2224
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,18 +54,21 @@ cdef renumber_helper(shuffled_vertices_t* ptr_maj_min_w, vertex_t, weights): | |
# which is not supported by '__cuda_array_interface__' | ||
if shuffled_major_series is None: | ||
shuffled_major_series = cudf.Series(dtype=vertex_t) | ||
else: | ||
shuffled_df['major_vertices']= shuffled_major_series | ||
if shuffled_minor_series is None: | ||
shuffled_minor_series = cudf.Series(dtype=vertex_t) | ||
shuffled_df['major_vertices']= shuffled_major_series | ||
shuffled_df['minor_vertices']= shuffled_minor_series | ||
else: | ||
shuffled_df['minor_vertices']= shuffled_minor_series | ||
|
||
if weights is not None: | ||
weight_t = weights.dtype | ||
shuffled_weights_series = move_device_buffer_to_series( | ||
move(pair_s_weights.first), weight_t, "shuffled_weights") | ||
if shuffled_weights_series is None: | ||
shuffled_df['value']= cudf.Series(dtype=weight_t) | ||
shuffled_df['value']= shuffled_weights_series | ||
else: | ||
shuffled_df['value']= shuffled_weights_series | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we should do the same for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Wasn't causing an error, but the code is, in fact, incorrect. Updated in the last push. |
||
|
||
return shuffled_df | ||
|
||
|
@@ -176,7 +179,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<int*>c_major_vertices, | ||
<int*>c_minor_vertices, | ||
<float*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
shuffled_df = renumber_helper(ptr_shuffled_32_32_32.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
minor_vertices = shuffled_df['minor_vertices'] | ||
|
@@ -245,7 +249,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<int*>c_major_vertices, | ||
<int*>c_minor_vertices, | ||
<double*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
|
||
shuffled_df = renumber_helper(ptr_shuffled_32_32_64.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
|
@@ -317,7 +322,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<int*>c_major_vertices, | ||
<int*>c_minor_vertices, | ||
<float*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
|
||
shuffled_df = renumber_helper(ptr_shuffled_32_64_32.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
|
@@ -387,7 +393,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<int*>c_major_vertices, | ||
<int*>c_minor_vertices, | ||
<double*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
|
||
shuffled_df = renumber_helper(ptr_shuffled_32_64_64.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
|
@@ -459,7 +466,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<long*>c_major_vertices, | ||
<long*>c_minor_vertices, | ||
<float*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
|
||
shuffled_df = renumber_helper(ptr_shuffled_64_64_32.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
|
@@ -530,7 +538,8 @@ def renumber(input_df, # maybe use cpdef ? | |
<long*>c_major_vertices, | ||
<long*>c_minor_vertices, | ||
<double*>c_edge_weights, | ||
num_local_edges).release()) | ||
num_local_edges, | ||
weights is not None).release()) | ||
|
||
shuffled_df = renumber_helper(ptr_shuffled_64_64_64.get(), vertex_t, weights) | ||
major_vertices = shuffled_df['major_vertices'] | ||
|
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.
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.
Just FYI, we're using std::optional elsewhere to address this instead of adding an additional flag. Not sure it is worth the effort in applying the same strategy here as this code will become obsolete once we switch to the C-API based approach.
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.
And yeah... this is cython, so we may not be able to use std optional here.