Skip to content

[pull] master from tensorflow:master#1626

Merged
pull[bot] merged 15 commits into
makesoftwaresafe:masterfrom
tensorflow:master
May 8, 2026
Merged

[pull] master from tensorflow:master#1626
pull[bot] merged 15 commits into
makesoftwaresafe:masterfrom
tensorflow:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 8, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

youchunni and others added 15 commits May 7, 2026 18:27
PiperOrigin-RevId: 912272639
… single large tensor and slice them out for later usage.

PiperOrigin-RevId: 912273572
PiperOrigin-RevId: 912279501
…s to call into CrossHostTransferBuffers

Imported from GitHub PR openxla/xla#41324

📝 Summary of Changes
This PR builds on #41055, and is the next in a sequence of PRs that will refactor cross-host data transfer implementations to rely on a shared helper function `CrossHostTransferBuffers`. `CrossHostTransferBuffers` is planned to eventually be integrated into the PJRT APIs to enable receiving data into preallocated receive buffers (this feature is being planned in collaboration with @gspschmid, @emilyfertig, and @pschuh).

This PR refactors `CrossHostReceiveBuffers` to call into `CrossHostTransferBuffers`.

🎯 Justification
It is difficult to achieve good comm/compute overlap with cross-host data transfers as the current implementation always allocates receive-buffers 'just-in-time', and because the GPU memory allocator blocks on the compute stream. CrossHostTransferBuffers will enable users to receive into preallocated receive buffers, making it easier to avoid the allocator blocking issue. This PR refactors CrossHostReceiveBuffers to call into CrossHostTransferBuffers. Later PRs will expose CrossHostTransferBuffers through the PJRT C/C++ APIs.

🚀 Kind of Contribution
♻️ Cleanup (eventually ✨ New Feature)

🧪 Unit Tests:
This PR only refactors the implementation of CrossHost{Send/Receive}Buffers, so the pre-existing unit tests for those methods already test this PR.

🧪 Execution Tests:
Verified that [these 4 correctness tests](https://gist.github.com/rao-ashish/24ac0df0cb18243c649ac535964b31b8) continue to pass.
Copybara import of the project:

--
0260d4efb3924afe56aac024a5367796e3553b6c by Ashish Rao <asrao@nvidia.com>:

Refactor CrossHostReceiveBuffers to call into CrossHostTransferBuffers

--
254651affff4f6a838c01ac87c32cbb0caea99d2 by Ashish Rao <asrao@nvidia.com>:

In CrossHostReceiveBuffers, retain a reference to the raw buffers until the transfer is done (also revert indentation change)

Merging this change closes #41324

PiperOrigin-RevId: 912279538
PiperOrigin-RevId: 912290144
…when the memory pressure increase equals to zero (vs a node with positive increase). A zero-memory-increase node is obviously better than a positive-increase node when negative-increase nodes do not exist.

PiperOrigin-RevId: 912294734
… utilities.

`pjrt_c_api_status_utils.h` was split out of `pjrt_c_api_helpers.h` to avoid a circular dependency.

PiperOrigin-RevId: 912295423
Also fix deprecated uses of `dimensions_size`

PiperOrigin-RevId: 912305567
PiperOrigin-RevId: 912312358
PiperOrigin-RevId: 912330226
PiperOrigin-RevId: 912332539
PiperOrigin-RevId: 912333107
@pull pull Bot locked and limited conversation to collaborators May 8, 2026
@pull pull Bot added the ⤵️ pull label May 8, 2026
@pull pull Bot merged commit 7933851 into makesoftwaresafe:master May 8, 2026
0 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.