damccorm opened a new pull request, #41941:
URL: https://github.com/apache/beam/pull/41941

   Note: this PR was auto-generated by tooling. Before moving it out of draft, 
the author has done a full review of the PR, specifically evaluating it on the 
following criteria:
   
   - The PR is an appropriate fix for the issue (e.g. we're not changing a test 
to avoid a bug)
   - The PR is a simple fix to the issue (e.g. we're not adding infra when we 
could just modify a test)
   - The PR is not covering for other problems (e.g. if we're bumping timeouts, 
it is not because we're covering for a performance problem)
     
   Full details of the methodology of generation and review can be found here - 
https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
   
   If you have concerns with the PR or with the underlying methodology used to 
generate this, please comment below - they will be addressed by the author not 
the tooling :)
   
   ## Summary
   
   Add automatic US region fallback (`us-west1` → `us-east1` → `us-east4` → 
`us-west2`) for the Python Dataflow T4 GPU integration tests (`tensorRTtests` 
and `vllmTests`) in `sdks/python/test-suites/dataflow/common.gradle` when 
Dataflow fails to start workers due to GCE compute stockout or GPU quota 
exhaustion.
   
   ### Root Cause
   
   `PostCommit Python` (Python 3.12) runs four sequential `nvidia-tesla-t4` 
Dataflow jobs (`tensorRTtests` + 3 `vllmTests` jobs) hardcoded to `us-west1` 
(which has only 2 T4 zones: `us-west1-a` and `us-west1-b`). Over the past 24 
hours, GCE T4 compute stockouts (`ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS`, 
`state:STOCKOUT`) in `us-west1-a` and `us-west1-b` caused 4 consecutive 
`PostCommit Python` `master` failures:
   
   - https://github.com/apache/beam/actions/runs/46996004854 (3.12 timed out 
after repeated `us-west1-a`/`us-west1-b` stockout delays)
   - https://github.com/apache/beam/actions/runs/47044296710 (`vllmTests` job 
`2026-12-02_22_22_51-10084920105778941732` failed on `us-west1-b` stockout)
   - https://github.com/apache/beam/actions/runs/47164439053 (attempt 1: 
`tensorRTtests` `2026-12-03_09_43_37-15850376014022088156` & `vllmTests` 
`2026-12-03_10_34_43-12346771702530586943`; attempt 2: `vllmTests` 
`2026-12-03_16_05_22-16222742514809404530` all failed on `us-west1` T4 stockout)
   - https://github.com/apache/beam/actions/runs/47228430380 (`tensorRTtests` 
`2026-12-03_16_35_18-7686729341116692506` & `vllmTests` 
`2026-12-03_16_41_27-2235969125985003078` both failed on 
`us-west1-a`/`us-west1-b` stockout)
   
   Meanwhile, `us-central1` T4 quota is saturated by periodic PyTorch 
benchmarks (48/48), while `us-east1` (3 T4 zones), `us-east4` (3 T4 zones), and 
`us-west2` (2 T4 zones) each have 0/4 T4 GPU usage in `apache-beam-testing` and 
US multi-region access to `us.gcr.io` and GCS buckets.
   
   ### Fix
   
   - Keep `us-west1` (32 T4 GPU quota) as the primary region.
   - Tee stdout/stderr to both console and an in-memory buffer and **only** 
retry in the next candidate region (`us-east1` → `us-east4` → `us-west2`) if 
the command exits non-zero with a terminal Dataflow worker pool capacity/quota 
error (`Startup of the worker pool` without `The service will retry` alongside 
`RESOURCE_POOL_EXHAUSTED` / `STOCKOUT` / `QUOTA_EXCEEDED` / `Quota `, or `Quota 
'NVIDIA_T4_GPUS' exceeded` / `Quota 'GPUS_ALL_REGIONS' exceeded`). Real 
code/test failures fail fast on the first region without retrying.
   - In `vllmTests`, once a fallback region succeeds, rotate it to the front of 
the candidate list for the remaining sequential vLLM jobs in that task so 
subsequent jobs do not repeat 5-minute stockout timeouts on earlier regions.
   
   ## Production Impact
   
   No — CI/test Gradle configuration only 
(`sdks/python/test-suites/dataflow/common.gradle`). No Beam SDK or runner 
production code is modified.
   
   ## Test Suite Runtime Impact
   
   - **Normal case (`us-west1` has T4 capacity)**: **0s change** (`us-west1` 
runs first and succeeds on the first attempt; `pip install openai` in 
`vllmTests` runs once instead of three times, saving a few seconds).
   - **During a `us-west1` T4 stockout**: adds ~5 minutes for Dataflow's worker 
pool startup timeout on `us-west1` before retrying and succeeding in `us-east1` 
(once for `tensorRTtests` and once for `vllmTests`, since `vllmTests` reuses 
the working region for jobs 2 and 3; `us-east1` runs complete in ~21 minutes 
per vLLM job, matching `us-west1`), instead of failing the ~2h15m `PostCommit 
Python` workflow. (Will update with measured verification run timing once 
`beam_PostCommit_Python.yml` completes.)
   
   ### Verification
   - Triggered `.github/workflows/beam_PostCommit_Python.yml` workflow run on 
branch: [`47260762203`](https://github.com/apache/beam/actions/runs/47260762203)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to