amazon-braket / amazon-braket-containers

Apache License 2.0
13 stars 8 forks source link

Upgrade container pennylane lightning.gpu version to v0.24 #50

Closed duanyh12 closed 1 year ago

duanyh12 commented 2 years ago

Describe the feature you'd like An issue with v0.23 pennylane lightning.gpu on QAOA use cases has been detected (https://github.com/PennyLaneAI/pennylane/issues/2745). The bug will be addressed in the incoming lightning.gpu v0.24 release on June 21. As QAOA is an important use case for Braket, do Braket consider it necessary to update the containers correspondingly?

How would this feature be used? Please describe. With the proposed upgrade, users will be able to run QAOA simulations with lightning.gpu embedded simulator with out-of-the-box containers.

Describe alternatives you've considered Need to confirm if os.system("pip install git+https://github.com/PennyLaneAI/pennylane-lightning-gpu.git@main") in the job script can serve as a workaround.

Additional context Add any other context or screenshots about the feature request here.

duanyh12 commented 2 years ago

Confirming os.system("pip install git+https://github.com/PennyLaneAI/pennylane-lightning-gpu.git@main") will not work in the current PL_TORCH container. Might want to revisit it again after tomorrow's v0.24 launch.

duanyh12 commented 2 years ago

Recommendation updated on June 30:

PennyLane v0.24 has released. A quick workaround to resolve the issue is to add the following three lines at the beginning of a job script:

import subprocess
subprocess.run(["pip", "install", "pennylane==0.24.0", "-q"])
subprocess.run(["pip", "install", "pennylane-lightning-gpu~=0.24", "-q"])
mlxd commented 2 years ago

Hi @duanyh12 I recommend using

import subprocess
subprocess.run(["pip", "install", "pennylane==0.24.0", "-q"])
subprocess.run(["pip", "install", "pennylane-lightning[gpu]==0.24.0", "-q"])

to ensure the GPU install goes through the Lightning CPU installer. It should be the same package installation now, but we expect those repos to eventually merge, and the paths to resolve via the same route.

ajberdy commented 1 year ago

As of https://github.com/aws/amazon-braket-containers/pull/59, we have upgraded PennyLane and are now using pennylane-lightning[gpu]==0.25.1