Repository navigation
[Python] Update Direct inferencePostCommitIT requirements and Gradle tasks for Python 3.13 - #41648
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## users/damccorm/py313-inference-4-enrichment #41648 +/- ##
=================================================================================
- Coverage 58.04% 58.04% -0.01%
Complexity 2844 2844
=================================================================================
Files 1210 1210
Lines 173284 173284
Branches 2329 2329
=================================================================================
- Hits 100587 100581 -6
- Misses 69987 69993 +6
Partials 2710 2710
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
stop reviewer notifications |
…tasks for Python 3.13 - tensorflow_tests_requirements.txt: use Python-version markers for tf-keras and tensorflow>=2.16,<2.22 on Python >= 3.12 while preserving keras<3 and tensorflow<2.16 on Python < 3.12. - torch_tests_requirements.txt & huggingface_tests_requirements.txt: cap torch<2.12.0 to prevent triton>=3.7 LLVM option registration collision when imported alongside TensorFlow, and add tensorflow/tf-keras bounds for HF ITs. - sdks/python/test-suites/direct/common.gradle: remove obsolete scikit-learn<1.2.0 downgrade, export TF_USE_LEGACY_KERAS=1 for tensorflowInferenceTest, install enrichment_tests_requirements.txt (redis) in testcontainersTest, and give each direct inference/enrichment task a distinct JUnit suite name so per-task XML reports are not overwritten.
f5785ad to
e148a5d
Compare
|
Stopping reviewer notifications for this pull request: requested by reviewer. If you'd like to restart, comment |
jrmccluskey
left a comment
There was a problem hiding this comment.
LGTM, just two observations in related code
| "test_opts": testOpts, | ||
| "suite": "postCommitIT-direct-py${pythonVersionSuffix}", | ||
| "suite": "tensorflowInferenceTest-direct-py${pythonVersionSuffix}", | ||
| "collect": "uses_tf and it_postcommit" , |
There was a problem hiding this comment.
Not introduced here, but it looks like we have a uses_tensorflow label as well as a uses_tf label? Looks like a distinction between TFX and TensorFlow, probably worth a refactor later
| doFirst { | ||
| exec { | ||
| executable 'sh' | ||
| args '-c', ". ${envdir}/bin/activate && pip install -r $requirementsFile" |
There was a problem hiding this comment.
This is another place we could consider using uv to catch dependency mismatches more consistently, but probably to do some more experimenting before full-committing there
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly updates the Direct Runner inferencePostCommitIT dependency constraints and Gradle task configurations to support Python 3.13 while preserving compatibility for Python < 3.12 benchmarks. The changes align dependency bounds with setup.py and tox.ini, resolve Keras 3 / Triton compatibility issues, and prevent JUnit XML report overwrites across sub-tasks.
🔍 General Feedback
- Dependency version markers and upper bounds (
torch<2.12.0,tensorflow<2.22, andtf-keras>=2.16.0on Python >= 3.12) are consistent with the rest of the Python SDK test configuration. - Assigning distinct
suitenames per Gradle task insdks/python/test-suites/direct/common.gradleis a good fix to preventpytest_*.xmltest report collisions when runninginferencePostCommitIT.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Part of #41652 (stack: https://github.com/apache/beam/stack/41650).
Stack 5/6 — Updates Direct
inferencePostCommitITdependency constraints and Gradle task configs for Python 3.13:tensorflow_tests_requirements.txt: Use Python-version markers (tf-keras>=2.16.0+tensorflow>=2.16.0,<2.22on Python >= 3.12, preservingkeras<3.0.0+tensorflow>=2.12.0,<2.16on Python < 3.12 for the Python 3.11 Dataflow cost benchmarks).torch_tests_requirements.txt&huggingface_tests_requirements.txt: Captorch>=2.3.0,<2.12.0(matchingsetup.pyandtox.ini) sotorch>=2.12does not pulltriton>=3.7, which aborts with an LLVM option registration collision when imported alongside TensorFlow in the shared virtualenv; addtensorflow>=2.12.0,<2.22andtf-keras>=2.16.0; python_version >= '3.12'tohuggingface_tests_requirements.txt.sdks/python/test-suites/direct/common.gradle:pip install 'scikit-learn<1.2.0'doFirststep insklearnInferenceTest(fails to build on Python 3.13;apache-beam[test]already providesscikit-learn<1.8.0).TF_USE_LEGACY_KERAS=1intensorflowInferenceTestso legacy TF2 SavedModels load under TensorFlow 2.16+.enrichment_tests_requirements.txt(redis>=5.0.0,<6) intestcontainersTest(matchingdataflow:mockAPITests, needed sincerediswas moved to an optional extra in split redis into extra #36772).suitename so per-task XML reports no longer overwritepytest_postCommitIT-direct-py*.xml.Verification
inferencePostCommitITtasks passing in PostCommit Python (3.13) run 45406881889.