Enhance Graph.update() and add whole-graph update tests#1843
Open
Andy-Jost wants to merge 4 commits intoNVIDIA:mainfrom
Open
Enhance Graph.update() and add whole-graph update tests#1843Andy-Jost wants to merge 4 commits intoNVIDIA:mainfrom
Andy-Jost wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
Rename test files to reflect what they actually test: - test_basic -> test_graph_builder (stream capture tests) - test_conditional -> test_graph_builder_conditional - test_advanced -> test_graph_update (moved child_graph and stream_lifetime tests into test_graph_builder) - test_capture_alloc -> test_graph_memory_resource - test_explicit* -> test_graphdef* Made-with: Cursor
- Extend Graph.update() to accept both GraphBuilder and GraphDef sources - Surface CUgraphExecUpdateResultInfo details on update failure instead of a generic CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE message - Release the GIL during cuGraphExecUpdate via nogil block - Add parametrized happy-path test covering both GraphBuilder and GraphDef - Add error-case tests: unfinished builder, topology mismatch, wrong type Made-with: Cursor
|
- Chain GraphDef kernel launches sequentially (n.launch instead of g.launch) to avoid concurrent writes to the same memory location - Update GraphDef.handle and GraphNode.handle annotations to reflect that as_py returns driver types (CUgraph, CUgraphNode), not int Made-with: Cursor
The monolithic _graphdef.pyx (2000+ lines) is split into three focused modules under _graph_def/: _graph_def.pyx (Condition, GraphAllocOptions, GraphDef), _graph_node.pyx (GraphNode base class and builder methods), and _subclasses.pyx (all concrete node subclasses). Long method bodies in GraphNode are factored into cdef inline GN_* helpers following existing codebase conventions. Handle property annotations updated to use driver.* types consistently. Made-with: Cursor
Contributor
Author
|
|
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.
Extend tests of the exsiting
Graph.updatefunction and refactor existing graph code in preparation for further work.Summary
Graph.update()to accept bothGraphBuilderandGraphDefas sources, giving users flexibility to update instantiated graphs from either the stream-capture or explicit-graph APICUgraphExecUpdateResultInfoon update failure (reason enum + docstring) instead of a genericCUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE_graphdef.pyx(2000+ lines) into a_graph_def/subpackage with three focused modules for maintainabilityChanges
cuda/core/_graph/_graph_builder.pyx: RefactoredGraph.update()to dispatch onGraphBuildervsGraphDef, callcuGraphExecUpdatewith aCUgraphExecUpdateResultInfostruct, and raise a descriptiveCUDAErroron failurecuda/core/_graph/_graph_def/: Split_graphdef.pyxinto_graph_def.pyx(Condition, GraphAllocOptions, GraphDef),_graph_node.pyx(GraphNode base class and builder methods withGN_*inline helpers), and_subclasses.pyx(all concrete node subclasses). Handle property annotations updated to usedriver.*types consistently.tests/graph/: Renamed test files to reflect their scope (test_graph_builder.py,test_graph_builder_conditional.py,test_graph_memory_resource.py,test_graph_update.py,test_graphdef*.py,test_device_launch.py); added module docstrings; moved tests to appropriate filestests/graph/test_graph_update.py: Added parametrizedtest_graph_update_kernel_args(GraphBuilder + GraphDef),test_graph_update_conditional,test_graph_update_unfinished_builder,test_graph_update_topology_mismatch,test_graph_update_wrong_typeTest Coverage
GraphBuilderandGraphDefValueErrorwhen sourceGraphBuilderhasn't finished capturingCUDAErrorwith descriptive reason fromCUgraphExecUpdateResultInfoTypeErrorfor invalid argument typesRelated Work