Skip to content

[graph_trainer] Add CUDAGraph manager for centralized lifecycle management#2572

Draft
yiming0416 wants to merge 1 commit intomainfrom
yiming/cg_manager
Draft

[graph_trainer] Add CUDAGraph manager for centralized lifecycle management#2572
yiming0416 wants to merge 1 commit intomainfrom
yiming/cg_manager

Conversation

@yiming0416
Copy link
Contributor

@yiming0416 yiming0416 commented Mar 13, 2026

Summary

  • Introduce _CUDAGraphManager to centralize ownership of the shared CUDA graph pool, stream, and all CUDAGraphWrapper instances
  • Lazily initialize the graph pool/stream on first use (instead of at module import time)
  • Replace the fragile teardown in GraphTrainer.close() with an explicit cudagraph_teardown() that destroys all registered wrappers and releases the pool

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 13, 2026
@yiming0416 yiming0416 force-pushed the yiming/cg_manager branch 2 times, most recently from 0b95cd8 to 103784f Compare March 14, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant