Skip to content

fix(backend): inherit PassMgrBackend and raise RuntimeError on no-match#86

Open
xjtu-L wants to merge 3 commits intoPaddlePaddle:developfrom
xjtu-L:fix/pass-mgr-direct-multi-output
Open

fix(backend): inherit PassMgrBackend and raise RuntimeError on no-match#86
xjtu-L wants to merge 3 commits intoPaddlePaddle:developfrom
xjtu-L:fix/pass-mgr-direct-multi-output

Conversation

@xjtu-L
Copy link
Copy Markdown
Contributor

@xjtu-L xjtu-L commented May 6, 2026

  • Replace manual config/pass_manager construction with super().init(config), overriding get_passes() for FixedPatternReplacementPass
  • Raise RuntimeError when no passes modify the graph, preventing fallback to eager execution

@xjtu-L xjtu-L force-pushed the fix/pass-mgr-direct-multi-output branch from 91f7721 to cc2dd97 Compare May 6, 2026 13:55
PassMgrDirectBackend now inherits GraphCompilerBackend directly,
with its own dispatch infrastructure, pass loading, source validation,
and FixedPatternReplacementPass. This eliminates the coupling with
PassMgrBackend so changes to one backend don't affect the other.
@xjtu-L xjtu-L force-pushed the fix/pass-mgr-direct-multi-output branch from cc2dd97 to 2b39460 Compare May 6, 2026 14:05
The pass match status was not being written to the result file,
causing the evaluator to always report an empty list for
"Has Any pass matched?". Added the same write logic that
PassMgrBackend already has.
@xjtu-L xjtu-L force-pushed the fix/pass-mgr-direct-multi-output branch from a793fae to 02bd602 Compare May 9, 2026 07:45
…args

Two bugs fixed in PassMgrDirectBackend:

1. _original_input_tensors never set when model is called with
   **input_dict and forward signature uses *args/**kwargs (so
   _param_names is empty). Added elif kwargs fallback using
   kwargs.values() order.

2. _finalize_gm() would pass None to _reorder_placeholders when
   _original_input_tensors was not set. Added None guard.
@xjtu-L xjtu-L force-pushed the fix/pass-mgr-direct-multi-output branch from f57b4cd to fd14ef7 Compare May 9, 2026 08:22
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