Skip to content

Commit 4b79587

Browse files
Bugfix Dockerfile + new build system (#863)
### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [ ] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [ ] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <[email protected]>
1 parent 6b7e1d6 commit 4b79587

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

.github/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@
111111

112112
### Bug fixes
113113

114+
* Update dependencies and `build` command options following changes in the build system.
115+
[(#863)](https://github.com/PennyLaneAI/pennylane-lightning/pull/863)
116+
114117
* Replace structured bindings by variables in `GateImplementationsLM.hpp`.
115118
[(#856)](https://github.com/PennyLaneAI/pennylane-lightning/pull/856)
116119

docker/Dockerfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ RUN python3 -m venv $VIRTUAL_ENV
7373
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
7474
RUN rm -rf tmp && git clone --depth 1 --branch ${LIGHTNING_VERSION} https://github.com/PennyLaneAI/pennylane-lightning.git tmp\
7575
&& mv tmp/* /opt/pennylane-lightning && rm -rf tmp
76-
RUN pip install --no-cache-dir cmake ninja pybind11 wheel
76+
RUN pip install --no-cache-dir build cmake ninja pybind11 toml wheel
7777

7878
# Download Lightning release and build lightning-qubit backend
7979
FROM base-build-python AS build-wheel-lightning-qubit
8080
WORKDIR /opt/pennylane-lightning
8181
RUN pip uninstall -y pennylane-lightning
82-
RUN python scripts/configure_pyproject_toml.py
83-
RUN python -m build
82+
RUN python scripts/configure_pyproject_toml.py || true
83+
RUN python -m build --wheel
8484

8585
# Install lightning-qubit backend
8686
FROM base-runtime AS wheel-lightning-qubit
@@ -93,8 +93,8 @@ FROM base-build-python AS build-wheel-lightning-kokkos-openmp
9393
WORKDIR /opt/pennylane-lightning
9494
ENV PL_BACKEND=lightning_kokkos
9595
RUN pip uninstall -y pennylane-lightning
96-
RUN python scripts/configure_pyproject_toml.py
97-
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON" python -m build
96+
RUN python scripts/configure_pyproject_toml.py || true
97+
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON" python -m build --wheel
9898

9999
# Install lightning-kokkos OpenMP backend
100100
FROM base-runtime AS wheel-lightning-kokkos-openmp
@@ -118,8 +118,8 @@ WORKDIR /opt/pennylane-lightning
118118
ENV PL_BACKEND=lightning_kokkos
119119
RUN pip uninstall -y pennylane-lightning
120120
RUN echo >> cmake/support_kokkos.cmake && echo "find_package(CUDAToolkit REQUIRED)" >> cmake/support_kokkos.cmake
121-
RUN python scripts/configure_pyproject_toml.py
122-
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON -DKokkos_ENABLE_CUDA:BOOL=ON -DKokkos_ARCH_${CUDA_ARCH}=ON" python -m build
121+
RUN python scripts/configure_pyproject_toml.py || true
122+
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON -DKokkos_ENABLE_CUDA:BOOL=ON -DKokkos_ARCH_${CUDA_ARCH}=ON" python -m build --wheel
123123

124124
# Install python3 and setup runtime virtual env in CUDA-12-runtime image (includes CUDA runtime and math libraries)
125125
# Install lightning-kokkos CUDA backend
@@ -148,8 +148,8 @@ WORKDIR /opt/pennylane-lightning
148148
ENV PL_BACKEND=lightning_gpu
149149
RUN pip install --no-cache-dir wheel custatevec-cu12
150150
RUN pip uninstall -y pennylane-lightning
151-
RUN python scripts/configure_pyproject_toml.py
152-
RUN CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") python -m build
151+
RUN python scripts/configure_pyproject_toml.py || true
152+
RUN CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") python -m build --wheel
153153

154154

155155
# Install python3 and setup runtime virtual env in CUDA-12-runtime image (includes CUDA runtime and math libraries)
@@ -193,8 +193,8 @@ ENV CMAKE_PREFIX_PATH=/opt/rocm:$CMAKE_PREFIX_PATH
193193
ENV CXX=hipcc
194194
ENV PL_BACKEND=lightning_kokkos
195195
RUN pip uninstall -y pennylane-lightning
196-
RUN python scripts/configure_pyproject_toml.py
197-
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON -DKokkos_ENABLE_HIP:BOOL=ON -DKokkos_ARCH_${AMD_ARCH}=ON" python -m build
196+
RUN python scripts/configure_pyproject_toml.py || true
197+
RUN CMAKE_ARGS="-DKokkos_ENABLE_SERIAL:BOOL=ON -DKokkos_ENABLE_OPENMP:BOOL=ON -DKokkos_ENABLE_HIP:BOOL=ON -DKokkos_ARCH_${AMD_ARCH}=ON" python -m build --wheel
198198

199199
# Install lightning-kokkos HIP backend
200200
FROM rocm/dev-ubuntu-22.04:5.7 AS wheel-lightning-kokkos-rocm

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.38.0-dev41"
19+
__version__ = "0.38.0-dev42"

0 commit comments

Comments
 (0)