-
Notifications
You must be signed in to change notification settings - Fork 655
Relax numpy version constraints #6137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
CI MESSAGE: [40348302]: BUILD STARTED |
Greptile SummaryThis PR relaxes numpy version constraints to support both numpy 1.x and 2.x across the DALI codebase. Key changes:
Packages still constrained to numpy<2:
The test fixes address numpy 2.x stricter type checking and behavioral changes around integer overflow, type coercion in array creation, and deprecated constants. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Setup as setup_packages.py
participant Tests as Test Suite
participant Numpy as NumPy (1.x/2.x)
Dev->>Setup: Update package constraints
Setup->>Setup: Remove standalone numpy>=2 entry
Setup->>Setup: Remove numpy<2 from jupyter, tensorflow, flax, clu
Setup->>Setup: Update numba 0.61.2 → 0.63.1
Setup->>Setup: Keep numpy<2 for paddlepaddle, jax, numba-cuda
Dev->>Tests: Fix numpy 2.x compatibility issues
Tests->>Tests: Update test_cast.py (float64 cast, np.inf)
Tests->>Tests: Update test_inflate.py (int64 intermediate)
Tests->>Tests: Update test_python_function.py (numpy.float64)
Tests->>Tests: Update test_reduce.py (overflow handling)
Tests->>Tests: Update test_backend_impl.py (float intermediate)
Tests->>Tests: Update test_random_resized_crop.py (explicit casts)
Dev->>Tests: Add backward compatibility tests
Tests->>Tests: Add test_different_numpy_versions()
Tests->>Numpy: Install numpy<2
Tests->>Tests: Run core pipeline tests
Numpy-->>Tests: Verify compatibility
Tests->>Numpy: Also test with numpy>=2
Numpy-->>Tests: Verify compatibility
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
qa/setup_packages.py, line 680-682 (link)style: numba 0.59.1 for Python 3.9 still has
numpy<2constraint - consider updating if this version supports numpy 2Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
1 file reviewed, 1 comment
|
CI MESSAGE: [40356541]: BUILD STARTED |
|
CI MESSAGE: [40348302]: BUILD FAILED |
|
CI MESSAGE: [40394275]: BUILD STARTED |
|
CI MESSAGE: [40394275]: BUILD FAILED |
|
CI MESSAGE: [40415495]: BUILD STARTED |
|
CI MESSAGE: [40415495]: BUILD FAILED |
|
CI MESSAGE: [40432108]: BUILD STARTED |
|
CI MESSAGE: [40432108]: BUILD FAILED |
- Removes standalone numpy>=2 package entry - Removes numpy<2 dependency constraints from jupyter, tensorflow, jax, jaxlib, flax, and numba packages - Updates numba from 0.61.2 to 0.63.1 Signed-off-by: Janusz Lisiecki <[email protected]>
|
CI MESSAGE: [40432727]: BUILD STARTED |
|
CI MESSAGE: [40432727]: BUILD FAILED |
|
CI MESSAGE: [40432727]: BUILD PASSED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
dali/test/python/operator_1/test_cast.py, line 34 (link)syntax: typo: "sing" should be "sign"
7 files reviewed, 1 comment
Signed-off-by: Janusz Lisiecki <[email protected]>
|
CI MESSAGE: [40489685]: BUILD STARTED |
|
CI MESSAGE: [40489685]: BUILD FAILED |
Signed-off-by: Janusz Lisiecki <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (3)
-
qa/setup_packages.py, line 640 (link)logic: PR description claims to remove
numpy<2dependency constraints fromjax, but the constraint remains here -
qa/setup_packages.py, line 619 (link)style:
paddlepaddle-gpustill hasnumpy<2constraint - verify if this should also be removed per the PR objectives -
qa/setup_packages.py, line 701-728 (link)style:
numba-cudastill hasnumpy<2constraints on all versions (Python 3.9 and 3.10+, CUDA 120 and 130). Verify if these should also be removed.
7 files reviewed, 3 comments
Signed-off-by: Janusz Lisiecki <[email protected]>
|
CI MESSAGE: [40497112]: BUILD STARTED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (2)
-
qa/setup_packages.py, line 640 (link)logic: JAX 0.4.16 is incompatible with numpy 2.x - it was released before numpy 2.0 (Feb 2024 vs June 2024) and uses deprecated APIs removed in numpy 2.0 like
numpy.Infinityandnumpy.float_. This will break all JAX plugin tests.Per JAX maintainers (GitHub Issue #18779), numpy 2.0 support requires JAX 0.4.25+. Either:
- Upgrade JAX/jaxlib to 0.4.25+ and update flax/clu constraints accordingly
- Keep
"numpy<2"in dependencies for JAX 0.4.16
Test files that will fail:
dali/test/python/jax_plugin/test_jax_operator.py -
qa/setup_packages.py, line 685-688 (link)style: The comment "Free-threaded Python build is incompatible with numpy<2" is now misleading after removing the
numpy<2constraint. If numpy 2.x is now allowed, butpython_free_threaded=Falseblocks free-threaded builds, the constraint relationship is unclear.Update comment to clarify what's actually being blocked (e.g., "numba 0.63.1 free-threading support is experimental" or similar)
7 files reviewed, 2 comments
|
CI MESSAGE: [40497490]: BUILD STARTED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (5)
-
qa/setup_packages.py, line 640 (link)logic: JAX 0.4.16 was released in mid-2024, around the same time as numpy 2.0. This old version likely lacks proper numpy 2.x support and may have compatibility issues. The PR description removes
numpy<2constraints, but this specific JAX version may not be fully compatible.Check if JAX 0.4.16 actually supports numpy 2.x, or consider either:
- Keeping
"numpy<2"in dependencies here - Updating to a newer JAX version with verified numpy 2.x support
- Keeping
-
qa/setup_packages.py, line 619 (link)logic: Paddlepaddle-gpu still has
"numpy<2"constraint while the PR aims to relax numpy version constraints. This creates an inconsistency where some packages support numpy 2.x while paddlepaddle forces numpy<2. -
qa/setup_packages.py, line 701-708 (link)logic: All
numba-cudaversions still have"numpy<2"constraints. This contradicts the PR's goal to relax numpy version constraints and creates dependency conflicts when other packages now allow numpy 2.x. -
qa/setup_packages.py, line 680 (link)logic: Numba 0.59.1 for Python 3.9 still has
"numpy<2"constraint. This creates inconsistency where Python 3.10+ gets numba 0.63.1 with numpy 2.x support, but Python 3.9 is restricted to numpy<2. -
dali/test/python/operator_1/test_cast.py, line 117 (link)style:
np.Infinitywas deprecated and removed in numpy 2.x, replaced withnp.inf
9 files reviewed, 5 comments
|
CI MESSAGE: [40497919]: BUILD STARTED |
|
CI MESSAGE: [40489685]: BUILD PASSED |
|
CI MESSAGE: [40497919]: BUILD FAILED |
Signed-off-by: Janusz Lisiecki <[email protected]>
|
CI MESSAGE: [40501672]: BUILD STARTED |
|
CI MESSAGE: [40507599]: BUILD STARTED |
|
CI MESSAGE: [40501672]: BUILD FAILED |
|
CI MESSAGE: [40501672]: BUILD PASSED |
|
CI MESSAGE: [40507599]: BUILD PASSED |
|
CI MESSAGE: [40497490]: BUILD FAILED |
tensorflow, jaxlib, flax, and numba packages
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
tensorflow, jaxlib, flax, and numba packages
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A