You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance Regression or Improvement: test_cloudml_benchmark_criteo_10GB-runtime_sec:runtime_sec
#39667
I investigated CloudML Dataflow runs for this test and checked Grafana:
Grafana shows that it was mostly around 35 to 42 min in July to August. From early September it jumps to around 50 min and stays there around 25 to 30% slower and The no_shuffle series moves the same way at the same time
Deps didn’t move (Beam 2.77.0.dev0, TFT 1.21, TF 2.21) but on 2 September the container went from beam-master-20260817 to …0831 (#39958)
as @Amar3tto earlier comment that it stabilized was before this September step. After the container update it looks like a real lasting regression again
With help from AI:
The performance regression is caused by a pip dependency conflict during Dataflow worker startup. Because the pipeline option specifies --requirements_file=apache_beam/testing/benchmarks/cloudml/requirements.txt, every Dataflow worker runs pip install -r requirements.txt at boot time. On 20260831, pip discovers an irreconcilable conflict between TensorFlow Transform's dependency tree and Apache Beam's new Google Cloud Bigtable requirement, causing pip to uninstall apache-beam 2.77.0.dev0 and downgrade it to apache-beam==2.75.0
tensorflow-metadata 1.21.0 Caps Protobuf - tfx_bsl==1.21.0 and tensorflow-transform==1.21.0 both depend on tensorflow-metadata==1.21.0. Its distribution metadata specifies: protobuf<=6.32 and >=4.21.6; python_version < "3.11"
Beam Bumped google-cloud-bigtable in Master: In google-cloud-bigtable==2.42.0 protobuf<8.0.0, >=6.33.5
When pip installs requirements.txt on the worker:
tensorflow-metadata 1.21.0 is explicitly pinned in requirements.txt, so pip cannot change it (protobuf <= 6.32 is mandatory).
The pre-installed apache-beam 2.77.0.dev0 requires bigtable >= 2.42.0, which demands protobuf >= 6.33.5.
Because [6.0.0, 6.32] and [6.33.5, 8.0.0) do not overlap, pip concludes that the pre-installed apache-beam 2.77.0.dev0 is incompatible.
tfx_bsl 1.21.0 only specifies apache-beam[gcp]<3, >=2.53. Therefore, pip is allowed to replace Apache Beam with any older release from PyPI matching <3, >=2.53.
Pip checks PyPI:
5.1 . 2.76.0: Also requires bigtable >= 2.42.0 (rejected).
5.2 . 2.75.0: Allowed bigtable >= 2.19.0 (selected, because it allows bigtable==2.39.0 which supports protobuf <= 6.32).
The separate container didn't help because --requirements_file was still passed, forcing the worker to run pip install -r requirements.txt and temporarily pull apache-beam 2.75.0. While Gradle's injected --extra_package did successfully uninstall 2.75.0 and restore master/head build (2.78.0.dev0), it did so by compiling Beam’s source tarball (.tar.gz) directly on the worker VM—costing over 4 minutes of CPU compilation. Furthermore, the temporary 2.75.0 resolution left behind downgraded companion dependencies in the final environment, notably pyarrow 23.0.1 (down from 25.0.1).
Impact: Worker startup time degraded from ~1.5 minutes to nearly 6 minutes (3.4x slower) due to on-worker compilation, while TFT still executed against an older, downgraded PyArrow runtime.
On Python 3.10, tensorflow-metadata enforces an environment-specific ceiling: protobuf<=6.32;python_version<"3.11". Because Beam master (20260831) bumped Bigtable to >=2.42.0 (which requires protobuf>=6.33.5), these mutually exclusive ranges force pip into an aggressive backtracking loop on every worker node. Even on standard default containers without any custom image, pip resolves the conflict by downgrading Beam to 2.75.0 and pyarrow to 23.0.1, followed by compiling Beam master from source on the worker VM. On Python 3.11, this regression vanishes completely because tensorflow-metadata drops the upper bound (protobuf>=4.25.2;python_version>="3.11"), allowing the container’s pre-installed protobuf 6.33.6 to satisfy both libraries and resolve dependencies cleanly in seconds without touching Beam or PyArrow.
How 3.10 Eventually Still Works on Head/Master (Just Slower)
The pipeline on Python 3.10 does not actually fail and still runs on master/head code. This is because Gradle's tftTests task automatically stages local Beam checkout as an --extra_package (apache-beam.tar.gz). After pip finishes downgrading to 2.75.0 during the requirements phase, the worker boot daemon immediately runs pip install --force-reinstall --no-deps apache-beam.tar.gz. This successfully replaces 2.75.0 with local master build (2.78.0.dev0). However, it runs much slower because:
Every worker node spends over 4 minutes of 100% CPU compiling Beam’s Cython/C++ extensions from source during boot.
The transient 2.75.0 resolution permanently leaves behind older companion packages in the final environment, notably pyarrow 23.0.1 instead of 25.0.1.
Proposed Solution: Bump gradle.properties to 3.11
We should update sdks/python/test-suites/gradle.properties:
-# TFX_BSL is not yet supported on Python 3.10.-dataflow_cloudml_benchmark_tests_py_versions=3.10+# Run cloudml TFT benchmark tests on Python 3.11 to avoid Python 3.10 protobuf<=6.32 cap+dataflow_cloudml_benchmark_tests_py_versions=3.11
How Gradle Passes It to the Test:
Task Delegation: When you run ./gradlew :sdks:python:test-suites:dataflow:tftTests, dataflow/build.gradle iterates over dataflow_cloudml_benchmark_tests_py_versions and adds :sdks:python:test-suites:dataflow:py311:tftTests to its dependsOn list.
Environment Configuration: The py311 subproject sets pythonVersion = '3.11', which configures Gradle to:
Build the manylinux Python 3.11 Beam wheel (bdistPy311linux).
Provision a local Python 3.11 virtual environment for the test runner.
Automatically tell DataflowRunner to use the official Python 3.11 worker harness image (beam_python3.11_sdk:beam-master-20260831), bypassing the protobuf clash and avoiding the 4-minute on-worker compilation entirely.
Activity
github-actions commentedon Aug 7, 2026
Performance change found in the
test:
test_cloudml_benchmark_criteo_10GB-runtime_secfor the metric:runtime_sec.For more information on how to triage the alerts, please look at
Triage performance alert issuessection of the README.Test description:TFT Criteo test on 10 GB data.Test link - https://github.com/apache/beam/blob/42d0a6e3564d8b9c5d912428a6de18fb22a13ac1/sdks/python/apache_beam/testing/benchmarks/cloudml/cloudml_benchmark_test.py#LL104C7-L104C41
Amar3tto commentedon Sep 1, 2026
aIbrahiim commentedon Sep 14, 2026
I investigated CloudML Dataflow runs for this test and checked Grafana:
Grafana shows that it was mostly around 35 to 42 min in July to August. From early September it jumps to around 50 min and stays there around 25 to 30% slower and The no_shuffle series moves the same way at the same time
Deps didn’t move (Beam 2.77.0.dev0, TFT 1.21, TF 2.21) but on 2 September the container went from beam-master-20260817 to …0831 (#39958)
as @Amar3tto earlier comment that it stabilized was before this September step. After the container update it looks like a real lasting regression again
tvalentyn commentedon Sep 22, 2026
https://metrics.beam.apache.org/d/C9nj1oxVk/tft-criteo-benchmarks?orgId=1&from=now-60d&to=now
tvalentyn commentedon Sep 22, 2026
Let's try to rootcause this.
tvalentyn commentedon Sep 22, 2026
cc: @ahmedabu98
tvalentyn commentedon Sep 22, 2026
Next steps: try to revert locally: https://github.com/apache/beam/pull/39958/changes , and run the test 5 times, and see if performance improves.
THen, analyze dependecy diff between two container images.
tvalentyn commentedon Sep 22, 2026
looked closer, looks like the regression originally triggered a month earlier (around 08/01)
tvalentyn commentedon Sep 22, 2026
cc: @stankiewicz
kennknowles commentedon Sep 28, 2026
Any progress on this one?
stankiewicz commentedon Sep 28, 2026
run 3-4 tests fro each beam-master version
stankiewicz commentedon Sep 28, 2026
I'm on some path to finding it, there is dependency conflict between tft reqs and what is on container after bigtable bump
stankiewicz commentedon Sep 28, 2026
With help from AI:
The performance regression is caused by a pip dependency conflict during Dataflow worker startup. Because the pipeline option specifies --requirements_file=apache_beam/testing/benchmarks/cloudml/requirements.txt, every Dataflow worker runs pip install -r requirements.txt at boot time. On 20260831, pip discovers an irreconcilable conflict between TensorFlow Transform's dependency tree and Apache Beam's new Google Cloud Bigtable requirement, causing pip to uninstall apache-beam 2.77.0.dev0 and downgrade it to apache-beam==2.75.0
tensorflow-metadata 1.21.0 Caps Protobuf - tfx_bsl==1.21.0 and tensorflow-transform==1.21.0 both depend on tensorflow-metadata==1.21.0. Its distribution metadata specifies: protobuf<=6.32 and >=4.21.6; python_version < "3.11"
Beam Bumped google-cloud-bigtable in Master: In google-cloud-bigtable==2.42.0 protobuf<8.0.0, >=6.33.5
When pip installs requirements.txt on the worker:
tensorflow-metadata 1.21.0 is explicitly pinned in requirements.txt, so pip cannot change it (protobuf <= 6.32 is mandatory).
The pre-installed apache-beam 2.77.0.dev0 requires bigtable >= 2.42.0, which demands protobuf >= 6.33.5.
Because [6.0.0, 6.32] and [6.33.5, 8.0.0) do not overlap, pip concludes that the pre-installed apache-beam 2.77.0.dev0 is incompatible.
tfx_bsl 1.21.0 only specifies apache-beam[gcp]<3, >=2.53. Therefore, pip is allowed to replace Apache Beam with any older release from PyPI matching <3, >=2.53.
Pip checks PyPI:
5.1 . 2.76.0: Also requires bigtable >= 2.42.0 (rejected).
5.2 . 2.75.0: Allowed bigtable >= 2.19.0 (selected, because it allows bigtable==2.39.0 which supports protobuf <= 6.32).
stankiewicz commentedon Sep 28, 2026
will test container:
tvalentyn commentedon Sep 28, 2026
thanks, in case of the dependency resolution problem it shouldn't be a release blocker.
stankiewicz commentedon Sep 29, 2026
The separate container didn't help because --requirements_file was still passed, forcing the worker to run pip install -r requirements.txt and temporarily pull apache-beam 2.75.0. While Gradle's injected --extra_package did successfully uninstall 2.75.0 and restore master/head build (2.78.0.dev0), it did so by compiling Beam’s source tarball (.tar.gz) directly on the worker VM—costing over 4 minutes of CPU compilation. Furthermore, the temporary 2.75.0 resolution left behind downgraded companion dependencies in the final environment, notably pyarrow 23.0.1 (down from 25.0.1).
Impact: Worker startup time degraded from ~1.5 minutes to nearly 6 minutes (3.4x slower) due to on-worker compilation, while TFT still executed against an older, downgraded PyArrow runtime.
stankiewicz commentedon Sep 29, 2026
Why the Regression Happens on 3.10 vs. 3.11
On Python 3.10,
tensorflow-metadataenforces an environment-specific ceiling:protobuf<=6.32;python_version<"3.11". Because Beam master (20260831) bumped Bigtable to>=2.42.0(which requiresprotobuf>=6.33.5), these mutually exclusive ranges force pip into an aggressive backtracking loop on every worker node. Even on standard default containers without any custom image, pip resolves the conflict by downgrading Beam to2.75.0andpyarrowto23.0.1, followed by compiling Beam master from source on the worker VM. On Python 3.11, this regression vanishes completely becausetensorflow-metadatadrops the upper bound (protobuf>=4.25.2;python_version>="3.11"), allowing the container’s pre-installedprotobuf 6.33.6to satisfy both libraries and resolve dependencies cleanly in seconds without touching Beam or PyArrow.How 3.10 Eventually Still Works on Head/Master (Just Slower)
The pipeline on Python 3.10 does not actually fail and still runs on master/head code. This is because Gradle's
tftTeststask automatically stages local Beam checkout as an--extra_package(apache-beam.tar.gz). After pip finishes downgrading to2.75.0during the requirements phase, the worker boot daemon immediately runspip install --force-reinstall --no-deps apache-beam.tar.gz. This successfully replaces2.75.0with local master build (2.78.0.dev0). However, it runs much slower because:2.75.0resolution permanently leaves behind older companion packages in the final environment, notablypyarrow 23.0.1instead of25.0.1.Proposed Solution: Bump
gradle.propertiesto 3.11We should update sdks/python/test-suites/gradle.properties:
How Gradle Passes It to the Test:
./gradlew :sdks:python:test-suites:dataflow:tftTests,dataflow/build.gradleiterates overdataflow_cloudml_benchmark_tests_py_versionsand adds:sdks:python:test-suites:dataflow:py311:tftTeststo itsdependsOnlist.py311subproject setspythonVersion = '3.11', which configures Gradle to:bdistPy311linux).beam_python3.11_sdk:beam-master-20260831), bypassing the protobuf clash and avoiding the 4-minute on-worker compilation entirely.damccorm commentedon Sep 29, 2026
Removing the release blocker, thanks for the investigation!