[ET-VK] Keep unused placeholders in the delegate's input list - #22480
Open
msluszniak wants to merge 1 commit into
Open
[ET-VK] Keep unused placeholders in the delegate's input list#22480msluszniak wants to merge 1 commit into
msluszniak wants to merge 1 commit into
Conversation
VulkanBackend::execute walks its `args` positionally against ComputeGraph::inputs() and rejects the call when the counts disagree. VkGraphBuilder.process_placeholder_node drops any placeholder with no users before it reaches input_ids, but the delegate call still passes that argument, so the two go out of step and every execute() of the affected model fails with "Vulkan graph declares N inputs and M outputs, but the delegate call supplied K arguments". Unused placeholders are not hypothetical. The passes that run inside preprocess can fold away a placeholder's only consumers after partitioning has already fixed the argument list. A qwen3 0.6B export that keeps attention on the host hits this: the final partition receives 28 per-layer symints whose consumers are gone by serialization time, and it 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.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22480
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22478.
VulkanBackend::executematches itsargspositionally againstComputeGraph::inputs(), butprocess_placeholder_nodedrops any placeholder with no users before it reachesinput_ids. The delegate call still passes that argument, so the counts disagree and the model fails at everyexecute()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_inputfails onmainand passes with the change; the companion test covering used placeholders passes either way.test_serialization.py,test_vulkan_compile_options.pyandtest_vulkan_passes.py(17 tests) still pass.