Skip to content

Reuse one TPU slice across cases in the Torch DMA and weight sync benchmarks: - #1385

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1008715198
Nov 3, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1008715198

Conversation

@copybara-service

Copy link
Copy Markdown

Reuse one TPU slice across cases in the Torch DMA and weight sync benchmarks:

  • examples/microbenchmarks/torch_dma_kv_cache_benchmark.py: Run every test case on one set of long-lived per-device worker processes (_BenchmarkWorkers) instead of a fresh mp.spawn per case, so the multi-process TPU slice is created and torn down once per run. A failed case stops its workers and the next case starts a fresh group.
  • examples/microbenchmarks/torch_weight_sync_benchmark_runner.py: The destination drives the whole --parallelism_list ladder from one set of processes, as the source already does, with fresh tensors and a fresh WeightSynchronizer per rung. --controller_address becomes --controller_host (each rung's controller port is derived the same way as on the source), and --src_log_dir becomes --results_dir, which both roles use for their per-rung result files.

@google-cla

google-cla Bot commented Oct 28, 2026

Copy link
Copy Markdown

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
copybara-service Bot force-pushed the test_1008715198 branch 2 times, most recently from 9ece227 to 78773f9 Compare November 3, 2026 18:51
…chmarks:

- `examples/microbenchmarks/torch_dma_kv_cache_benchmark.py`: Run every test case on one set of long-lived per-device worker processes (`_BenchmarkWorkers`) instead of a fresh `mp.spawn` per case, so the multi-process TPU slice is created and torn down once per run. A failed case stops its workers and the next case starts a fresh group.
- `examples/microbenchmarks/torch_weight_sync_benchmark_runner.py`: The destination drives the whole `--parallelism_list` ladder from one set of processes, as the source already does, with fresh tensors and a fresh `WeightSynchronizer` per rung. `--controller_address` becomes `--controller_host` (each rung's controller port is derived the same way as on the source), and `--src_log_dir` becomes `--results_dir`, which both roles use for their per-rung result files.

PiperOrigin-RevId: 1013149750
@copybara-service
copybara-service Bot merged commit 5f59e6a into main Nov 3, 2026
1 of 2 checks passed
@copybara-service
copybara-service Bot deleted the test_1008715198 branch November 3, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants