Add PyTorch support to TPU Raiden H2D/D2H presubmit performance gating. - #925
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-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. |
Implement automated presubmit performance regression gating for the PyTorch path in TPU Raiden (`third_party/tpu_raiden/tpu_sync/benchmarks/`), establishing parity with JAX. Key changes: - Decouple `perf_core.py` under a unified, narrow public function `measure(...)` that supports both `framework="jax"` and `framework="torch"`. Callers do not need to know about framework-specific runtime setups, memory pinning, or worker multi-processing. - Add PyTorch SPMD multi-processing transfer execution (`_torch_worker_fn`) using `torch.multiprocessing.spawn`, rank synchronization via `dist.all_reduce` (MIN/MAX wall-clock timing across ranks), and pre-measurement byte-integrity verification. - Update `h2d_d2h_benchmark_gating.py` to default to `--framework=all` (with selective `--framework=jax|torch` support), gating both frameworks in a single unified run on physical TPU hardware. - Unify test shapes and baselines in `h2d_d2h_gating_baselines.json` under a single hardware `configs` list, holding both JAX and PyTorch to the same physical DMA throughput floors without artificial branching. - Update `h2d_d2h_gating` in `benchmark_registry.pbtxt` and `h2d_d2h_record` in `benchmark_registry_record.pbtxt` with symmetrical JAX (`jax_...`) and PyTorch (`torch_...`) metrics, plus legacy un-prefixed aliases to maintain continuous tracking on `go/tpu-sync-oss-mlcompass`. - Register `h2d_d2h_benchmark_gating_torch_gl` and `h2d_d2h_benchmark_gating_gl` test targets and add PyTorch dependencies to `BUILD`. - Update `H2D_D2H_GATING_TEST.md` documentation. Tested: - `blaze-for-agents build -c opt //third_party/tpu_raiden/tpu_sync/benchmarks:all` passed. - Formatted via `hg fix`. PiperOrigin-RevId: 981433715
copybara-service
Bot
force-pushed
the
test_981433715
branch
from
September 15, 2026 17:33
f121c6b to
91c7c63
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.
Add PyTorch support to TPU Raiden H2D/D2H presubmit performance gating.
Implement automated presubmit performance regression gating for the PyTorch path in TPU Raiden (
third_party/tpu_raiden/tpu_sync/benchmarks/), establishing parity with JAX.Key changes:
perf_core.pyunder a unified, narrow public functionmeasure(...)that supports bothframework="jax"andframework="torch". Callers do not need to know about framework-specific runtime setups, memory pinning, or worker multi-processing._torch_worker_fn) usingtorch.multiprocessing.spawn, rank synchronization viadist.all_reduce(MIN/MAX wall-clock timing across ranks), and pre-measurement byte-integrity verification.h2d_d2h_benchmark_gating.pyto default to--framework=all(with selective--framework=jax|torchsupport), gating both frameworks in a single unified run on physical TPU hardware.h2d_d2h_gating_baselines.jsonunder a single hardwareconfigslist, holding both JAX and PyTorch to the same physical DMA throughput floors without artificial branching.h2d_d2h_gatinginbenchmark_registry.pbtxtandh2d_d2h_recordinbenchmark_registry_record.pbtxtwith symmetrical JAX (jax_...) and PyTorch (torch_...) metrics, plus legacy un-prefixed aliases to maintain continuous tracking ongo/tpu-sync-oss-mlcompass.h2d_d2h_benchmark_gating_torch_glandh2d_d2h_benchmark_gating_gltest targets and add PyTorch dependencies toBUILD.H2D_D2H_GATING_TEST.mddocumentation.Tested:
blaze-for-agents build -c opt //third_party/tpu_raiden/tpu_sync/benchmarks:allpassed.hg fix.