[ET-VK][BE] Remove usage of vTensorPtr
and get_tensor
#13136
Closed
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.
Stack from ghstack (oldest at bottom):
DynamicDispatchNode
#13139DynamicDispatchNode
#13138get_tensor()
API protected #13137vTensorPtr
andget_tensor
#13136Note that although the volume of changes in this diff are very high, the changes themselves are extremely mechanical. This diff was written almost entirely with a LLM, but I have looked through each file and validated the changes.
Changes
This diff updates callsites using
graph->get_tensor(value_ref)
in favor of just using theValueRef
directly.A simple example (and the vast majority of changes in this diff) is a change such as:
To instead be
or
Motivation
Overall, the goal is to make the
get_tensor()
API protected so that it can only be used in specific situations.In addition to the primary motivation of improving the consistency of API usage throughout the codebase, there is a practical benefit as well.
get_tensor
has a limitation that no values can be added to the graph while thevTensorPtr
is in scope. Also, forcing tensor modifications via functions likevirtual_resize()
to go through theComputeGraph
will allow the graph to track changes for the purposes of determining when a command buffer re-encode or resize propagation is necessary, which will result in performance benefits.Differential Revision: D79564594