-
Notifications
You must be signed in to change notification settings - Fork 42
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
⬆️ Looser 2.0 numpy functionality #1913
base: develop
Are you sure you want to change the base?
Conversation
2ec0af9
to
c56d749
Compare
I've just rerun the Ran into this: OverrideNeeded
{Package('jax', '0.4.25', features=frozenset({'cpu'}), source_type='legacy', source_url='https://storage.googleapis.com/jax-releases/jax_releases.html', source_reference='jaxsource'): {'numpy': <Dependency numpy (>=1.23.2)>, 'scipy': <Dependency scipy (>=1.9)>}, Package('jaxlib', '0.4.25', source_type='legacy', source_url='https://storage.googleapis.com/jax-releases/jax_releases.html', source_reference='jaxsource'): {'scipy': <Dependency scipy (>=1.9)>}, Package('botocore', '1.35.2'): {'urllib3': <Dependency urllib3 (>=1.25.4,!=2.2.0,<3)>}, Package('pylint', '3.2.6'): {'dill': <Dependency dill (>=0.3.6)>}, Package('pandas', '2.2.1'): {'numpy': <Dependency numpy (>=1.23.2,<2)>}, Package('pydantic', '2.8.2'): {'typing-extensions': <Dependency typing-extensions (>=4.6.1)>}, Package('ml-dtypes', '0.4.0'): {'numpy': <Dependency numpy (>=1.23.3)>}, Package('flax', '0.8.5'): {'numpy': <Dependency numpy (>=1.23.2)>}, Package('flax', '0.8.4'): {'numpy': <Dependency numpy (>=1.23.2)>}, Package('jax', '0.4.25', source_type='legacy', source_url='https://storage.googleapis.com/jax-releases/jax_releases.html', source_reference='jaxsource'): {'numpy': <Dependency numpy (>=1.23.2)>, 'scipy': <Dependency scipy (>=1.9)>}, Package('oldest-supported-numpy', '2023.12.21'): {'numpy': <Dependency numpy (==1.23.2)>}, Package('oldest-supported-numpy', '2023.12.12'): {'numpy': <Dependency numpy (==1.23.2)>}, Package('oldest-supported-numpy', '2023.10.25'): {'numpy': <Dependency numpy (==1.23.2)>}, Package('oldest-supported-numpy', '2023.8.3'): {'numpy': <Dependency numpy (==1.23.2)>}} Hence, we might need to increase the jax dependency to support |
Note that np.trapezoid and np.trapz have the same API interface so can be used intechageably |
Even if we do increase the jax requirements, we also have to increase
This also means we need to increase our pandas and boto3->botocore version. |
We can try. What version do we need to support? we can bump it and see if the tests pass. |
Hi there, we released a new version of Autograd: https://github.com/HIPS/autograd/releases/tag/v1.7.0, which includes NumPy v2 support. It will be available via PyPI later in the day. |
Thanks @agriyakhetarpal this is great!!! @tylerflex Been trying to debug that. Jax has a really complex packaging structure, so it's not exactly clear to me what's the exact dependency limitation source within either I keep getting this error no matter what relevant dependencies I loosen:
Doesn't look like a scipy support issue, nor pandas, technically it's not jax, nor boto3 has no direct dependencies but could be related to this based on the packages in the error. Will keep debugging but is a weird issue. I'll continue on this next week I think. Unless, possibly @yaugenst-flex might be interested to give it a shot too earlier? For reference, in a clean pip environment, it does install. So it's a
|
ok thanks for looking into it. maybe Yannick has some idea.. or perhaps we need to add |
Hi all, so after a little bit of digging around I found that the culprit is the latest gdstk version (0.9.53), because that version drops support for numpy<2 entirely, see here. So, the only changes to the numpy = ">=1.2"
pandas = "*"
autograd = ">=1.6.2"
gdstk = { version = ">=0.9.49,<0.9.53", optional = true }
|
Ah wait no, regarding gdstk, there is actually a problem. |
gdstk 0.9.53 supports installation with numpy < 2. It requires numpy >= 2 only for building (at least that's my understanding of how the 2.0 API works: runtime is compatible with 1.x, but the build step must be done against 2). |
Thanks @lucas-flexcompute yeah you're right, I was wrong about that. Tbh I don't really understand what the problem is then. Fact is that we get a dependency resolution error when trying trying to use Oooh poetry is probably trying to build it? I'm not sure about how the distribution part works, I would have assumed that poetry just pulls pre-built wheels from pypi? But maybe that's not the case? @daquinteroflex |
@yaugenst-flex Maybe pip or poetry force looking into the build system dependencies instead of the runtime dependencies? Could that be it? |
Thanks @yaugenst-flex and @lucas-flexcompute thanks for this! I am looking to understand exactly how the poetry lockfile resolution works now, I just believed it was based on the package metadata rather than build-time resolution, and it does pull the pre-built wheels but we have control over specifically which build files it uses. I was consistently getting resolution errors despite multiple tweaks and now it's resolving with Yannick's suggestion (but I also this weekend rewiped my ubuntu so could also be that...) Am looking into this more as you suggest Lucas. Generating the lockfile would resolve the reproducible environment locking problem, but then within that we'll still actually have to test that multiple numpys actually work within variations of the numpy used. |
So basically, This is for:
± |dario/loosen_numpy_2_requirements U:1 ✗| → uv pip install -e .[dev]
Resolved 242 packages in 4.06s
Built tidy3d @ file:///home/daquintero/flexcompute/tidy3d_urgent
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: gdspy==1.6.13
Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/operation.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/path.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/polygon.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/__init__.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/library.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/hobby.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/viewer.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/curve.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/gdsiiformat.py -> build/lib.linux-x86_64-cpython-311/gdspy
copying gdspy/label.py -> build/lib.linux-x86_64-cpython-311/gdspy
creating build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/07.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/00.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/down.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/04.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/02.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/up.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/06.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/09.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/05.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/01.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/outline.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/03.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
copying gdspy/data/08.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/data
running build_ext
building 'gdspy.clipper' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/gdspy
clang++ -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/daquintero/.cache/uv/builds-v0/.tmpJ9wO4E/include -I/home/daquintero/.local/share/uv/python/cpython-3.11.9-linux-x86_64-gnu/include/python3.11 -c gdspy/clipper.cpp -o build/temp.linux-x86_64-cpython-311/gdspy/clipper.o
--- stderr:
/home/daquintero/.cache/uv/builds-v0/.tmpJ9wO4E/lib/python3.11/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
error: command 'clang++' failed: No such file or directory
--- I think maybe we need to start thinking depreciating |
@daquinteroflex this just looks like you're missing the compiler?
|
Whoops sorry my bad, still recovering from the ubuntu wipe and these minor issues have been popping up. It's weird as poetry compiled it but uv didn't, interesting how the environments get configured differnetly. |
Gdspy has been in bug fix mode only for quite a long time, and I've
recently archived the project, because I have no time to actually maintain
it, so I think that's a good option
…On Mon, Aug 26, 2024, 13:53 Dario Quintero (Flexcompute) < ***@***.***> wrote:
So basically, poetry has not been great giving information on the failed
resolution. I've been using uv recently so tried it debug this and it's
turned out to be pretty helpful:
± |dario/loosen_numpy_2_requirements U:1 ✗| → uv pip install -e .[dev]
Resolved 242 packages in 4.06s
Built tidy3d @ file:///home/daquintero/flexcompute/tidy3d_urgent
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: gdspy==1.6.13
Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1--- stdout:running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-cpython-311creating build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/operation.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/path.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/polygon.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/__init__.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/library.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/hobby.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/viewer.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/curve.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/gdsiiformat.py -> build/lib.linux-x86_64-cpython-311/gdspycopying gdspy/label.py -> build/lib.linux-x86_64-cpython-311/gdspycreating build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/07.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/00.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/down.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/04.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/02.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/up.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/06.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/09.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/05.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/01.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/outline.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/03.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datacopying gdspy/data/08.xbm -> build/lib.linux-x86_64-cpython-311/gdspy/datarunning build_extbuilding 'gdspy.clipper' extensioncreating build/temp.linux-x86_64-cpython-311creating build/temp.linux-x86_64-cpython-311/gdspyclang++ -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/daquintero/.cache/uv/builds-v0/.tmpJ9wO4E/include -I/home/daquintero/.local/share/uv/python/cpython-3.11.9-linux-x86_64-gnu/include/python3.11 -c gdspy/clipper.cpp -o build/temp.linux-x86_64-cpython-311/gdspy/clipper.o--- stderr:/home/daquintero/.cache/uv/builds-v0/.tmpJ9wO4E/lib/python3.11/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg)error: command 'clang++' failed: No such file or directory---
I think maybe we need to start thinking depreciating gdspy in this case?
@heitzmann <https://github.com/heitzmann>
—
Reply to this email directly, view it on GitHub
<#1913 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNJ2E3BSCXHE7QYMOHSS4DZTNMR7AVCNFSM6AAAAABM3SCQNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJQGY2DMMBVGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think it makes sense to keep gdspy around as long as we don't run into actual issues with it, since deprecating support would also involve removing the corresponding functions from tidy3d core. Regarding gdstk I suspect that poetry might be trying to either build or run using the wrong numpy version (since those two steps require different numpy versions). Poetry should support different build systems, but maybe there is some weird interaction with scikit-build. No idea. |
Yeah agree with Yannick, it's interesting, the This gives me the impression it could be a |
I don't know about |
18091ab
to
1c319e8
Compare
b9391a2
to
0927892
Compare
e231c52
to
2dc6c45
Compare
2dc6c45
to
44070da
Compare
So the backend PR is ready, seems to be working, and it's only awaiting the final go ahead. Realised I had cleaned and opened that PR up but not this one so opening it for review now |
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.
it looks good to me! but I'd suggest getting someone who's more familiar to take a closer look
44070da
to
88b6ae8
Compare
88b6ae8
to
0640c8f
Compare
Closes #1912
Update pandas dependency to greater than 2.2.2 INFO: Please pin your numpy < 2 if installing pandas via pip pandas-dev/pandas#55519Not required below as not related to the error.Increase boto3 version.