Repository navigation
[ci][deps] Downgrade protobuf from 6.33.6 to 5.27.5 to resolve serve's latency regression - #65216
jeffreywang88 wants to merge 6 commits into
Conversation
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]> # Conflicts: # python/deplocks/base_extra_testdeps/ray-ml-base_extra_testdeps_py3.10.lock
…e locks
Narrow the protobuf 4.25.8 compatibility set (protobuf, OpenTelemetry 1.27,
grpcio-tools/status 1.62.3, TensorFlow 2.19, NumPy 2.1.3, torchft-nightly)
from `python_version < '3.13'` to `python_version < '3.12'`.
Python 3.12 cannot take the pin: the py3.12 rayllm depsets resolve
vllm==0.26.0, which requires protobuf>=5.29.6, so
`ci/compile_llm_requirements.sh` fails to resolve
`rayllm_test_py312_{cpu,cu130}` with protobuf pinned to 4.25.8. All Serve
release tests that exercise the regression (including
pytest_serve_throughput_optimized_microbenchmarks) run on Python 3.10, so
the fix is unaffected by the narrower scope.
requirements_compiled.txt is regenerated under Python 3.11, matching the
interpreter CI uses; the previous revision of this branch was compiled
under 3.12, which silently dropped uvloop/pymars and emitted an unmarked
array-record==0.8.3 that made ml-build-ci_depset_py3.10 unresolvable.
Validation:
- ./ci/ci.sh compile_pip_dependencies (Python 3.11)
- ./ci/compile_llm_requirements.sh
- bazel run //ci/raydepsets:raydepsets -- build --all-configs
all exit 0.
Signed-off-by: Jeffrey Wang <[email protected]>
|
I'm not able to figure out what contributes to the remaining ~3 ms gap. From local repro, it seems like the gap is mostly due to run-to-run variance.
|
|
Tune |
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |
1e2f98e to
705db06
Compare
Signed-off-by: Jeffrey Wang <[email protected]>
705db06 to
1167d2a
Compare
|
|
Note The number of changes in this pull request is too large for Gemini Code Assist to generate a review. |
|
Closing this PR in favor of #66119. |
…ift (#66119) ## Why Alternative to #65216. Same protobuf pin, same hand-edited requirements, but the regenerated locks no longer carry dependency churn that has nothing to do with protobuf. #65216 moves **15 packages unrelated to protobuf**: | package | master | #65216 | locks | |---|---|---|---| | `click` | 8.3.2 | 8.4.2 | 80 | | `packaging` | 26.1 | **25.0** ⬇ | 78 | | `py-spy` | 0.4.1 | 0.4.2 | 51 | | `wandb` | 0.26.0 | **0.24.2** ⬇ | 18 | | `databricks-sdk` (py3.12+) | 0.103.0 | 0.123.0 | 6 | | `opentelemetry-{api,sdk,semantic-conventions,exporter-prometheus}` | 1.38–1.41 / 0.59b0–0.62b1 | 1.44.0 / 0.65b0 | 7 each | | `aiofiles`, `more-itertools`, `restrictedpython`, `serpent`, `etils`, `cmake` | — | — | 2–9 each | None of these are required by protobuf 5.27.5. They are fossils of the branch's **first** commit (`17a586bc08`), which pinned `protobuf==4.25.8; python_version < '3.13'` — protobuf 4.x across nearly every supported Python. That re-resolved a large slice of the graph at once: ``` package base (= today's master) after the 4.25.8 commit click 8.3.2 8.4.2 packaging 26.1 25.0 wandb 0.26.0 0.24.2 opentelemetry-api 1.39.0 1.27.0 aiofiles, more-itertools, restrictedpython, serpent present -> dropped ``` The pin was later relaxed to `5.27.5; python_version < '3.12'`, but pip-compile only re-resolves a package when its pin becomes *invalid* — and 8.4.2 / 25.0 / 0.24.2 all still satisfy the relaxed graph. So they stayed exactly where protobuf 4.x had put them. Verified: recompiling with the same requirements inputs and the same 5.27.5 pins returns master's values (`packaging` 26.1, `wandb` 0.26.0, `click` 8.3.2, `py-spy` 0.4.1), and `click==8.4.2` also resolves cleanly against master — nothing caps any of them. ## What changed here Reset every generated artifact — `requirements_compiled.txt`, `python/deplocks/`, `release/ray_release/byod/` — to master, then regenerated on top of the protobuf pins alone: ``` ci/ci.sh compile_pip_dependencies # py3.11, pip<25 for pip-tools 7.4.1 bazel run //ci/raydepsets:raydepsets -- build --all-configs ``` Both `pip-compile` and `uv` reuse the versions already in their output file unless a constraint forces otherwise, so starting from master's locks confines the diff to what protobuf 5.27.5 actually requires. | | #65216 | this PR | |---|---|---| | packages changed | 40 | **21** | | files changed | 92 | **73** | | `requirements_compiled.txt` | 128 lines | **26 lines** | ## What remains Only the protobuf chain: - **Hand-pinned** (py<3.12): `tensorflow` 2.19.1, `tensorflow-macos` 2.19.1, `tensorboard` 2.19.0, `tf-keras` 2.19.0, `numpy` 2.1.3, `databricks-sdk` 0.72.0, `grpcio-tools`/`grpcio-status` 1.71.2, `tensorflow-datasets` dropped on Windows - **Forced transitively** — each declares `protobuf>=6.33.5`: `google-cloud-compute` 1.48.0, `google-cloud-filestore` 1.17.0, `google-cloud-secret-manager` 2.29.0, `grpc-google-iam-v1` 0.14.4 - **Collateral of the TF downgrade**: `tensorflow-io-gcs-filesystem` appears (a hard dep of TF 2.19.1 on py<3.12; TF 2.20 moved it behind an extra), `pillow` leaves (it entered via tensorboard 2.20), and the tfds chain (`array-record`, `promise`, `toml`, `tensorflow-metadata`) leaves the Windows py3.10 locks ## Notes for review 1. **The py3.12+ protobuf pin does not reach the constraints file.** `requirements_compiled.txt` is a py3.11 resolution, so `protobuf==6.33.6; python_version >= '3.12'` is dropped and the only line left is `protobuf==5.27.5 ; python_version < "3.12"`. Master had `>= "3.11"`, which did apply. The py3.12/3.13 locks still hold 6.33.6, but nothing pins it any more. Same in #65216 — inherent to the marker choice. 2. **The numpy cap leaks into shipped images.** `ray_base_deps` is a `subset` of `ray_base_extra_testdeps` (`rayimg.depsets.yaml:226`), so py3.10/3.11 base images get numpy 2.1.3 to satisfy a TensorFlow constraint they do not contain. Worth scoping to the TF-bearing ML depsets instead. (TF 2.19.1's `numpy<2.2.0` is a test-matrix cap, not an ABI break — TF 2.19.1 + numpy 2.2.6 passes dtype bridge, ml_dtypes bfloat16, dlpack, `tf.experimental.numpy`, Keras fit/save and `tf.data` — but the resolver still hard-fails on the pair, and pip-compile has no `--override`, so keeping 2.2.6 would mean changing how `requirements_compiled.txt` is generated.) 3. **Master's lock set is not self-consistent.** Across 109 lock files the same package on the same Python version sits at different versions in different files (`packaging` on py3.10 is 25.0, 26.0 *and* 26.1). That is why the `keras`/`scipy`/`networkx` reconciliation in #65216 is not reproduced here — those locks still disagree with the pins master already declares. Worth one convergence pass on its own PR rather than inside a protobuf fix. 4. **Worth a guard.** `requirements_compiled.txt` is a single propagation point to all 109 locks, and CI only checks that it is up to date — nothing flags a pin moving *backward* against master. A transient pin during development ratchets values in permanently, which is exactly what happened here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Jeffrey Wang <[email protected]> Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Jeffrey Wang <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
…ift (ray-project#66119) ## Why Alternative to ray-project#65216. Same protobuf pin, same hand-edited requirements, but the regenerated locks no longer carry dependency churn that has nothing to do with protobuf. ray-project#65216 moves **15 packages unrelated to protobuf**: | package | master | ray-project#65216 | locks | |---|---|---|---| | `click` | 8.3.2 | 8.4.2 | 80 | | `packaging` | 26.1 | **25.0** ⬇ | 78 | | `py-spy` | 0.4.1 | 0.4.2 | 51 | | `wandb` | 0.26.0 | **0.24.2** ⬇ | 18 | | `databricks-sdk` (py3.12+) | 0.103.0 | 0.123.0 | 6 | | `opentelemetry-{api,sdk,semantic-conventions,exporter-prometheus}` | 1.38–1.41 / 0.59b0–0.62b1 | 1.44.0 / 0.65b0 | 7 each | | `aiofiles`, `more-itertools`, `restrictedpython`, `serpent`, `etils`, `cmake` | — | — | 2–9 each | None of these are required by protobuf 5.27.5. They are fossils of the branch's **first** commit (`17a586bc08`), which pinned `protobuf==4.25.8; python_version < '3.13'` — protobuf 4.x across nearly every supported Python. That re-resolved a large slice of the graph at once: ``` package base (= today's master) after the 4.25.8 commit click 8.3.2 8.4.2 packaging 26.1 25.0 wandb 0.26.0 0.24.2 opentelemetry-api 1.39.0 1.27.0 aiofiles, more-itertools, restrictedpython, serpent present -> dropped ``` The pin was later relaxed to `5.27.5; python_version < '3.12'`, but pip-compile only re-resolves a package when its pin becomes *invalid* — and 8.4.2 / 25.0 / 0.24.2 all still satisfy the relaxed graph. So they stayed exactly where protobuf 4.x had put them. Verified: recompiling with the same requirements inputs and the same 5.27.5 pins returns master's values (`packaging` 26.1, `wandb` 0.26.0, `click` 8.3.2, `py-spy` 0.4.1), and `click==8.4.2` also resolves cleanly against master — nothing caps any of them. ## What changed here Reset every generated artifact — `requirements_compiled.txt`, `python/deplocks/`, `release/ray_release/byod/` — to master, then regenerated on top of the protobuf pins alone: ``` ci/ci.sh compile_pip_dependencies # py3.11, pip<25 for pip-tools 7.4.1 bazel run //ci/raydepsets:raydepsets -- build --all-configs ``` Both `pip-compile` and `uv` reuse the versions already in their output file unless a constraint forces otherwise, so starting from master's locks confines the diff to what protobuf 5.27.5 actually requires. | | ray-project#65216 | this PR | |---|---|---| | packages changed | 40 | **21** | | files changed | 92 | **73** | | `requirements_compiled.txt` | 128 lines | **26 lines** | ## What remains Only the protobuf chain: - **Hand-pinned** (py<3.12): `tensorflow` 2.19.1, `tensorflow-macos` 2.19.1, `tensorboard` 2.19.0, `tf-keras` 2.19.0, `numpy` 2.1.3, `databricks-sdk` 0.72.0, `grpcio-tools`/`grpcio-status` 1.71.2, `tensorflow-datasets` dropped on Windows - **Forced transitively** — each declares `protobuf>=6.33.5`: `google-cloud-compute` 1.48.0, `google-cloud-filestore` 1.17.0, `google-cloud-secret-manager` 2.29.0, `grpc-google-iam-v1` 0.14.4 - **Collateral of the TF downgrade**: `tensorflow-io-gcs-filesystem` appears (a hard dep of TF 2.19.1 on py<3.12; TF 2.20 moved it behind an extra), `pillow` leaves (it entered via tensorboard 2.20), and the tfds chain (`array-record`, `promise`, `toml`, `tensorflow-metadata`) leaves the Windows py3.10 locks ## Notes for review 1. **The py3.12+ protobuf pin does not reach the constraints file.** `requirements_compiled.txt` is a py3.11 resolution, so `protobuf==6.33.6; python_version >= '3.12'` is dropped and the only line left is `protobuf==5.27.5 ; python_version < "3.12"`. Master had `>= "3.11"`, which did apply. The py3.12/3.13 locks still hold 6.33.6, but nothing pins it any more. Same in ray-project#65216 — inherent to the marker choice. 2. **The numpy cap leaks into shipped images.** `ray_base_deps` is a `subset` of `ray_base_extra_testdeps` (`rayimg.depsets.yaml:226`), so py3.10/3.11 base images get numpy 2.1.3 to satisfy a TensorFlow constraint they do not contain. Worth scoping to the TF-bearing ML depsets instead. (TF 2.19.1's `numpy<2.2.0` is a test-matrix cap, not an ABI break — TF 2.19.1 + numpy 2.2.6 passes dtype bridge, ml_dtypes bfloat16, dlpack, `tf.experimental.numpy`, Keras fit/save and `tf.data` — but the resolver still hard-fails on the pair, and pip-compile has no `--override`, so keeping 2.2.6 would mean changing how `requirements_compiled.txt` is generated.) 3. **Master's lock set is not self-consistent.** Across 109 lock files the same package on the same Python version sits at different versions in different files (`packaging` on py3.10 is 25.0, 26.0 *and* 26.1). That is why the `keras`/`scipy`/`networkx` reconciliation in ray-project#65216 is not reproduced here — those locks still disagree with the pins master already declares. Worth one convergence pass on its own PR rather than inside a protobuf fix. 4. **Worth a guard.** `requirements_compiled.txt` is a single propagation point to all 109 locks, and CI only checks that it is up to date — nothing flags a pin moving *backward* against master. A transient pin during development ratchets values in permanently, which is exactly what happened here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Jeffrey Wang <[email protected]> Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Jeffrey Wang <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
Summary
Pin protobuf to
5.27.5for Python 3.10–3.11. This is the newest version before the observedgrpc.aio10 MB-message latency regression.Background
#64257 upgraded protobuf from 4.25.8 to 6.33.6. A local version bisect found that the latency regression begins with protobuf 5.28.0 (details).
protobuf==5.27.5restores the pre-regression behavior while avoiding the protobuf-4-only dependency stack.The pin is intentionally limited to Python 3.10–3.11:
vllm==0.26.0, which requires protobuf>=5.29.6. Those environments remain on protobuf 6.33.6.Dependency cascade
Validation
./ci/ci.sh compile_pip_dependenciesraydepsets build --all-configsThe all-configs dependency build completed successfully.
Related issue
An upstream protobuf issue is filed with the ray-free grpc.aio reproducer demonstrating the 5.27.0 → 5.28.0 latency regression: protocolbuffers/protobuf#29708.
Additional information