Default explicit donation for step barriers #8982
Merged
+61 −56
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.
We currently rely on the user to enable
GetAliasWithBufferDonorConfig, so that the explicitly marked tensors for donation can be included in the buffer donor indices. However, it is unnecessary to have this constraint during step barrier, where the graph is expected to break, requiring the donation to happen (force_ltc_data) for all live tensors. Instead, we choose to default explicit donation for the step barrier (mark step), and only make it optional, depending on the buffer donor config, for other graph synchronizations (e.g._xla_sync_live_tensorsor_xla_warm_up_cache), where it requires an opt-in by the user to donate at that point (knowingly that the tensors won't be accessible anymore).Originally, the explicit donation config was mostly to decide whether to run LTC or explicit donations. Now that these can be used simultaneously, there is no added benefit in requiring the option, at least for the step barrier.