[ONNXTransform] always delete orphaned node branches after running an onnx transform #1746
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.
adds a pass in the base
ONNXTransform
cleanup steps to runONNXGraph.delete_orphaned_node_branches
which is an important additional cleanup step. This removes unwanted nodes from remaining in the graph after a transform which could lead to issues at inference time. This function should be safe to run against all transforms and only adds minimal overhead (O(nodes^2)
) if any orphaned nodes are foundshould fix issues in KVCache injected MPT models which seem to consistently get shipped with orphaned nodes remaining
test_plan:
verified locally that this unblocked running a pipeline with
zoo:nlg/text_generation/mpt-7b/pytorch/huggingface/mpt_chat/base-none
future testing should pull down a model with no data files and test injection against it