Implements raw PJRT device<->host DMA transfers for PyTorch tensors, mirroring - #884
Open
copybara-service[bot] wants to merge 1 commit into
Open
Implements raw PJRT device<->host DMA transfers for PyTorch tensors, mirroring#884copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_978013337
branch
from
September 10, 2026 00:17
b04aca2 to
20c57c7
Compare
…mirroring the JAX _raw_transfer API: - Adds Python API under `tpu_sync.api.torch.raw_transfer` (`transfer_d2h`, `transfer_h2d`, `transfer_d2h_async`, `transfer_h2d_async`, and batch variants). - Adds `RawHostBuffer` and `PreparedTorchRawTransfer` for zero-overhead, repeated pinned DMA transfers. - Implements readiness synchronization (`AwaitReady`) using PJRT buffer ready futures before issuing DMA. - Implements host memory validation with pinned-memory check and fallback warning (or error when `TPU_RAIDEN_RAW_REQUIRE_PINNED_HOST` is set). - Adds `unsafe_skip_buffer_lock` parameter to bypass buffer mutex locking for concurrent execution. - Consolidates bindings into `_tpu_raiden_torch` as a `raw_transfer` submodule for wheel distribution, while preserving the standalone `_torch_raw_transfer` extension. - Updates `build.sh`, `run_tests.sh`, and `ci/wheel/BUILD.bazel` to package and test the raw transfer surface. - Adds single-device bandwidth smoke test (`torch_raw_transfer_perf_test.py`) and correctness unit tests (`torch_raw_transfer_test.py`). PiperOrigin-RevId: 978013337
copybara-service
Bot
force-pushed
the
test_978013337
branch
from
September 10, 2026 00:21
20c57c7 to
3440336
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements raw PJRT device<->host DMA transfers for PyTorch tensors, mirroring
the JAX _raw_transfer API:
tpu_sync.api.torch.raw_transfer(transfer_d2h,transfer_h2d,transfer_d2h_async,transfer_h2d_async, and batch variants).RawHostBufferandPreparedTorchRawTransferfor zero-overhead,repeated pinned DMA transfers.
AwaitReady) using PJRT buffer ready futuresbefore issuing DMA.
(or error when
TPU_RAIDEN_RAW_REQUIRE_PINNED_HOSTis set).unsafe_skip_buffer_lockparameter to bypass buffer mutex locking forconcurrent execution.
_tpu_raiden_torchas araw_transfersubmodulefor wheel distribution, while preserving the standalone
_torch_raw_transferextension.
build.sh,run_tests.sh, andci/wheel/BUILD.bazelto package and testthe raw transfer surface.
torch_raw_transfer_perf_test.py) andcorrectness unit tests (
torch_raw_transfer_test.py).