dwavesystems / dwave-system

An API for easily incorporating the D-Wave system as a sampler, either directly or through Leap's cloud-based hybrid samplers
https://docs.ocean.dwavesys.com/
Apache License 2.0
87 stars 61 forks source link

Add support for networkx 3.1 / remove networkx dependency #511

Closed ccalaza closed 6 months ago

ccalaza commented 6 months ago

Description

At Forschungszentrum Juelich we are currently working on preparing the software environment for quantum computing for the year 2024. This effort involves making sure that the software modules we include are compatible with the rest of the software which is already offered to the other users of our HPC systems in this year. Of course, dwave-ocean-sdk is among the main packages which we support, and we are currently targeting to install the most recent version 6.7.1.

Our 2024 SW stage includes networkx==3.1. We have identified that all of Ocean sub-packages are compatible with this version except for dwave-system, which requires version <3.

Expected behavior

We expect to be able to offer a reasonably recent version of Ocean (say >=6) to the users of our D-Wave machine while maintaining compatibility of the dwave-ocean-sdk module with the rest of our SW stack.

Would you be willing to consider either a ) removing dwave-system's dependency on networkx as suggested in https://github.com/dwavesystems/dwave-system/issues/504 , b) or supporting networkx==3.1 in your most recent/upcoming release of dwave-system?

Environment:

Many thanks in advance! X Carlos

randomir commented 6 months ago

Absolutely, that's a dependency (upper bound) that deserved upgrading some time already. Thanks for raising this, we'll aim to have it fixed for the next release.

ccalaza commented 6 months ago

Brilliant, thanks a lot!

On a slightly related topic: I've noticed that in most packages you declare the SW dependencies both in requirements.txt and setup.py. Which one should we be taking as ground truth for the package's dependencies?

arcondello commented 6 months ago

The requirements.txt defines the repeatable versions for building/developing the package. The setup.py/setup.cfg defines the version ranges that the package should work with. In general it should be safe to trust the setup.py/setup.cfg, but because it would be quite expensive to test all possible version combinations there may be issues.

Also, some repos are better at testing their dependency ranges (e.g. dwave-cloud-client tests all supported dimod/NumPy versions) than others (e.g. this package does not). In the long term all repos should sweep their dependencies, but we haven't rolled those changes out everywhere yet.

ccalaza commented 6 months ago

Thanks for the info!

You testing version ranges is definitely the most convenient for us, considering the quadratic assignment problem which we face every year of supporting several QC packages in the same environment :P

But with the above-mentioned support of networkx==3.1 we should be good for the rest of the year I think.

arcondello commented 6 months ago

There are three packages that we need to update to have the SDK support NetworkX 3.1 (credit to @randomir for the work to identify the packages). Creating a list here for tracking:

arcondello commented 6 months ago

We have released dwave-ocean-sdk 6.8.0 which supports NetworkX 3.x.

I have confirmed that

pip install dwave-ocean-sdk==6.8.0 networkx==3.1

works as expected.

ccalaza commented 6 months ago

Amazing, as usual thanks a lot for the extremely quick reaction!