Skip to content

Commit

Permalink
Bugfix Dockerfile + new build system (#863)
Browse files Browse the repository at this point in the history
### 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 <github-ringo-but-quantum@xanadu.ai>
  • Loading branch information
vincentmr and ringo-but-quantum authored Aug 22, 2024
1 parent 6b7e1d6 commit 4b79587
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@

### Bug fixes

* Update dependencies and `build` command options following changes in the build system.
[(#863)](https://github.com/PennyLaneAI/pennylane-lightning/pull/863)

* Replace structured bindings by variables in `GateImplementationsLM.hpp`.
[(#856)](https://github.com/PennyLaneAI/pennylane-lightning/pull/856)

Expand Down
22 changes: 11 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN rm -rf tmp && git clone --depth 1 --branch ${LIGHTNING_VERSION} https://github.com/PennyLaneAI/pennylane-lightning.git tmp\
&& mv tmp/* /opt/pennylane-lightning && rm -rf tmp
RUN pip install --no-cache-dir cmake ninja pybind11 wheel
RUN pip install --no-cache-dir build cmake ninja pybind11 toml wheel

# Download Lightning release and build lightning-qubit backend
FROM base-build-python AS build-wheel-lightning-qubit
WORKDIR /opt/pennylane-lightning
RUN pip uninstall -y pennylane-lightning
RUN python scripts/configure_pyproject_toml.py
RUN python -m build
RUN python scripts/configure_pyproject_toml.py || true
RUN python -m build --wheel

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

# Install lightning-kokkos OpenMP backend
FROM base-runtime AS wheel-lightning-kokkos-openmp
Expand All @@ -118,8 +118,8 @@ WORKDIR /opt/pennylane-lightning
ENV PL_BACKEND=lightning_kokkos
RUN pip uninstall -y pennylane-lightning
RUN echo >> cmake/support_kokkos.cmake && echo "find_package(CUDAToolkit REQUIRED)" >> cmake/support_kokkos.cmake
RUN python scripts/configure_pyproject_toml.py
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
RUN python scripts/configure_pyproject_toml.py || true
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

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


# Install python3 and setup runtime virtual env in CUDA-12-runtime image (includes CUDA runtime and math libraries)
Expand Down Expand Up @@ -193,8 +193,8 @@ ENV CMAKE_PREFIX_PATH=/opt/rocm:$CMAKE_PREFIX_PATH
ENV CXX=hipcc
ENV PL_BACKEND=lightning_kokkos
RUN pip uninstall -y pennylane-lightning
RUN python scripts/configure_pyproject_toml.py
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
RUN python scripts/configure_pyproject_toml.py || true
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

# Install lightning-kokkos HIP backend
FROM rocm/dev-ubuntu-22.04:5.7 AS wheel-lightning-kokkos-rocm
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.38.0-dev41"
__version__ = "0.38.0-dev42"

0 comments on commit 4b79587

Please sign in to comment.