Optimize GFQL undirected hop fast path#972
Merged
Conversation
lmeyerov
commented
Mar 30, 2026
graphistry/compute/hop.py
Outdated
| return cast(Any, df)[[col]] | ||
|
|
||
| def _column_values(df: Any, col: str) -> Any: | ||
| return cast(Any, df)[col] |
bb6bd69 to
cf94b0f
Compare
lmeyerov
commented
Mar 31, 2026
graphistry/compute/cluster.py
Outdated
| elif 'cudf' in str(getmodule(df)) and engine == Engine.PANDAS: | ||
| return df.to_pandas() | ||
| elif engine == Engine.PANDAS: | ||
| return cudf_to_pandas_if_needed(df) |
3dfaaef to
314f90f
Compare
314f90f to
53f56ec
Compare
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.
Summary
This PR does one thing: optimize the common undirected single-hop GFQL traversal path in
hop().Scope:
graphistry/compute/hop.pyfordirection='undirected', single-hop, no-predicate/no-label traversalgraphistry/compute/dataframe_utils.pygraphistry/tests/compute/test_hop.pyCHANGELOG.mdnoteThe broader RAPIDS work was split back out of this PR:
Why
The accepted optimization is real, local, and reviewable on its own. The broader benchmark,
to_cugraph(), and RAPIDS compatibility work did not belong in the same PR.Validation
Local targeted regression suite:
Result:
167 passed, 6 skippedDGX GPU validation of the kept
hop()change:gplus, RAPIDS25.02:2.6495s -> 1.5985s(-39.67%)gplus, RAPIDS26.02:3.6406s -> 2.2109s(-39.27%)twitter, RAPIDS26.02:0.2666s -> 0.2370s(-11.10%)