Repository navigation
Commit f3dd4b4
authored
[ET-VK] Keep unused placeholders in the delegate's input list
Fixes pytorch#22478.
`VulkanBackend::execute` matches its `args` positionally against `ComputeGraph::inputs()`, but `process_placeholder_node` drops any placeholder with no users before it reaches `input_ids`. The delegate call still passes that argument, so the counts disagree and the model fails at every `execute()` with "Vulkan graph declares N inputs and M outputs, but the delegate call supplied K arguments".
A placeholder can lose its only consumers to the passes that run inside `preprocess`, after partitioning has already fixed the call's argument list. A qwen3 0.6B export with attention kept on the host hits this: the final partition is handed 28 per-layer symints that nothing in the subgraph consumes by serialization time, and declares 2 inputs and 1 output against a 31 argument call.
Params keep the existing skip, since they are serialized into the blob rather than passed at call time.
Test: `test_unused_placeholder_is_still_declared_as_an_input` fails on `main` and passes with the change; the companion test covering used placeholders passes either way. `test_serialization.py`, `test_vulkan_compile_options.py` and `test_vulkan_passes.py` (17 tests) still pass.1 parent 90c5a67 commit f3dd4b4
2 files changed
Lines changed: 78 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
423 | 435 | | |
424 | 436 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
430 | 441 | | |
431 | 442 | | |
432 | 443 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments