Skip to content

fix(backend): re-raise RuntimeError when no pass matched in pass_mgr_direct#96

Open
xjtu-L wants to merge 1 commit into
PaddlePaddle:developfrom
xjtu-L:fix/pass-mgr-direct-multi-output
Open

fix(backend): re-raise RuntimeError when no pass matched in pass_mgr_direct#96
xjtu-L wants to merge 1 commit into
PaddlePaddle:developfrom
xjtu-L:fix/pass-mgr-direct-multi-output

Conversation

@xjtu-L
Copy link
Copy Markdown
Contributor

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

Problem

In _CompileOnceWrapper.forward, when _torch_compile_backend raises RuntimeError due to no pass matching, Dynamo internally catches the exception and falls back to eager execution. self._compiled(*args, **kwargs) then returns the eager result normally — _optimized_gm remains None but no exception is thrown, causing the test framework to incorrectly report no-match cases as success.

Fix

Detect _optimized_gm is None in forward (the sign of Dynamo fallback), and re-raise RuntimeError so the test framework correctly marks the case as failed, consistent with pass_mgr behavior.

Impact

Only affects status reporting of no-match cases (successfailed). Does not affect pass matching or execution logic.

…direct

When the backend raises RuntimeError (no pass matched), dynamo
internally catches it and falls back to eager execution. The
_CompileOnceWrapper then returns the eager result normally, causing
the test framework to incorrectly report "success" instead of
"failed". This patch detects the fallback (optimized_gm is None)
and re-raises RuntimeError, making the behavior consistent with
pass_mgr.
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