Skip to content

feat(tools): add backward graph generation and validation tools#711

Open
Dayuxiaoshui wants to merge 1 commit into
PaddlePaddle:developfrom
Dayuxiaoshui:develop
Open

feat(tools): add backward graph generation and validation tools#711
Dayuxiaoshui wants to merge 1 commit into
PaddlePaddle:developfrom
Dayuxiaoshui:develop

Conversation

@Dayuxiaoshui
Copy link
Copy Markdown
Contributor

This commit introduces backward graph generation pipeline integrated with GraphNet's test_compiler framework.

Changes:

  • graph_net/torch/extractor.py: add try/except for capture_sparse_compute to support PyTorch versions where the config does not exist.
  • graph_net/torch/sample_pass/backward_graph_extractor.py:
    • switch module from train() to eval() to avoid dropout/BN side effects
    • clone forward inputs with detach().clone() to avoid inplace modification
    • add _is_pure_shape_graph() to skip subgraphs with only shape ops
  • tools/backward_graph_test.py:
    • batch backward FX Graph generation via aot_autograd
    • integrated test_compiler validation with auto-generated weight_meta.py
    • default GRAPH_NET_FLUCTUATION_DETECT_THRESHOLD=0.5 and trials=10
  • tools/backward_kernel_dedup.py:
    • Triton kernel dedup analysis for backward graphs

PR Category

Description

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 15, 2026

Thanks for your contribution!

This commit introduces backward graph generation pipeline integrated with
GraphNet's test_compiler framework.

Changes:
- graph_net/torch/extractor.py: add try/except for capture_sparse_compute
  to support PyTorch versions where the config does not exist.
- graph_net/torch/sample_pass/backward_graph_extractor.py:
  - switch module from train() to eval() to avoid dropout/BN side effects
  - clone forward inputs with detach().clone() to avoid inplace modification
  - add _is_pure_shape_graph() to skip subgraphs with only shape ops
- tools/backward_graph_test.py:
  - batch backward FX Graph generation via aot_autograd
  - integrated test_compiler validation with auto-generated weight_meta.py
  - default GRAPH_NET_FLUCTUATION_DETECT_THRESHOLD=0.5 and trials=10
- tools/backward_kernel_dedup.py:
  - Triton kernel dedup analysis for backward graphs
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.

1 participant