[XLA:MSA] Fix the AllocationRequest for window prefetch #21736
+115
−76
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.
[XLA:MSA] Fix the AllocationRequest for window prefetch
We currently have two performance issues in window prefetch.
The first is that we specified the created WindowPrefetchedAllocation to consume CopyResources by using non-zero shape. This could consume all resources and interfere with the prefetching decision of other tensors. In fact, we don't have prefetching implemented yet, so we could specify using zero CopyResource.
Another issue is that the generated allocation from window prefetch currently spans too long in time. Its earliest prefetch time is set to the operand's define time, and its end is the use time. We should keep the earliest prefetch time to be as close as the use time as possible. This is for keeping the interference to the prefetching of other tensors to be minimal.
We updated WindowPrefetch() to simply just allocate chunk for the exposed span vmem at this moment. Since we don't call Prefetch() from WindowPrefetch(), we can simplify the data structure of AllocationRequest and PrefetchContext a bit.