fix: gate GPU FFN graph replay on Attention run mode - #270
Conversation
| ) -> AFDControlPayload: | ||
| return AFDControlPayload( | ||
| dp_metadata_list=dp_metadata_list, | ||
| attention_run_mode=( |
There was a problem hiding this comment.
Blocking: this adds only a placeholder mode to NPU-created payloads, while AFDNPUFFNModelRunner.execute_model() still calls the shared graph_run_mode() with the removed is_warmup and is_graph_capturing keyword arguments (around line 164). With this PR, every NPU step reaching that call raises TypeError: graph_run_mode() got an unexpected keyword argument is_warmup before selecting eager/capture/replay. Please either preserve backward compatibility in the helper or update the NPU consumer and call site to pass attention_run_mode; deferring the NPU behavior change must not leave the existing path unusable.
There was a problem hiding this comment.
Blocking: this adds only a placeholder mode to NPU-created payloads, while
AFDNPUFFNModelRunner.execute_model()still calls the sharedgraph_run_mode()with the removedis_warmupandis_graph_capturingkeyword arguments (around line 164). With this PR, every NPU step reaching that call raisesTypeError: graph_run_mode() got an unexpected keyword argument is_warmupbefore selecting eager/capture/replay. Please either preserve backward compatibility in the helper or update the NPU consumer and call site to passattention_run_mode; deferring the NPU behavior change must not leave the existing path unusable.
Fixed in the rewrite: NPU FFN now passes is_graph_replaying into graph_run_mode() together with is_warmup / is_graph_capturing, and NPU Attention publishes the flag instead of a placeholder.
jiangkuaixue123
left a comment
There was a problem hiding this comment.
The GPU-side direction is sound, and the five modified GPU/control-plane unit-test modules pass locally (35 tests). However, this PR currently breaks the existing NPU FFN execution path: the shared graph_run_mode() API now requires attention_run_mode, while AFDNPUFFNModelRunner.execute_model() still passes the removed lifecycle keywords. I reproduced the resulting TypeError and left the exact finding inline. Even if full NPU run-mode synchronization remains out of scope, this shared API change must keep NPU executable. Please update the NPU call path or retain a compatible helper contract, and add a CPU-safe regression test covering that invocation. Separately, the PR DCO check is currently ACTION_REQUIRED.
|
cc @lirx-pd |
|
Several parts of this PR appear redundant or unrelated to that requirement: Can a smaller solution, that adds an |
FFN used to replay whenever a cached graph key existed. Attention now publishes is_graph_replaying on the control payload so GPU and NPU FFN only replay when Attention is actually replaying. Signed-off-by: wuxiaojia <betelgeu.wxj@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
00bd191 to
43bf26b
Compare
Thanks for the review! Reworked to the smaller approach:
|
Thanks for the review! The rewrite updates the NPU Attention/FFN path to publish and consume Also added |
|
Thanks for the PR! Have you tested this change in an actual GPU or NPU environment? In our current usage, this situation generally should not occur. If this PR passes the relevant E2E tests in a real hardware environment, I’ll be happy to merge it. |
Ran GPU E2E on H20 for this change:
I don’t have Ascend access for NPU E2E right now. Happy to run more GPU cases if needed. |
Purpose
FFN used to replay whenever a matching graph key existed, even if Attention ran eager. Attention now sends
is_graph_replaying; FFN only replays when that flag is set and a local graph exists.Issue
Scope
is_graph_replaying.Test Result
Focused CPU unit tests passed. NPU runtime tests skipped without Ascend.