Skip to content

Commit

Permalink
Update wheels: Addressing changes in PR #279 (#356)
Browse files Browse the repository at this point in the history
With Changes in PR #279, 
- [X] Disable the warning-as-error build option for 3rd-party backend
devices on wheels recipes.
- [X] Add the new `catalyst` module to the wheels
- [x] Fix segfaults with debug_print tests on macOS

---------

Co-authored-by: David Ittah <dime10@users.noreply.github.com>
  • Loading branch information
maliasadi and dime10 authored Nov 8, 2023
1 parent 95bb0df commit 2737a84
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-wheel-linux-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ jobs:
-DLIGHTNING_GIT_TAG="latest_release" \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON
cmake --build runtime-build --target rt_capi
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-wheel-macos-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ jobs:
-DLIGHTNING_GIT_TAG="latest_release" \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON
cmake --build runtime-build --target rt_capi
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-wheel-macos-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
MACOSX_DEPLOYMENT_TARGET: 11.7
MACOSX_DEPLOYMENT_TARGET: 12

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -248,6 +248,7 @@ jobs:
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON
cmake --build runtime-build --target rt_capi
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ wheel:
# Copy mlir bindings & compiler driver to frontend/mlir_quantum
mkdir -p $(MK_DIR)/frontend/mlir_quantum/dialects
cp -R $(COPY_FLAGS) $(DIALECTS_BUILD_DIR)/python_packages/quantum/mlir_quantum/runtime $(MK_DIR)/frontend/mlir_quantum/runtime
for file in gradient quantum _ods_common ; do \
for file in gradient quantum _ods_common catalyst ; do \
cp $(COPY_FLAGS) $(DIALECTS_BUILD_DIR)/python_packages/quantum/mlir_quantum/dialects/*$${file}* $(MK_DIR)/frontend/mlir_quantum/dialects ; \
done
cp $(COPY_FLAGS) $(DIALECTS_BUILD_DIR)/python_packages/quantum/mlir_quantum/compiler_driver.so $(MK_DIR)/frontend/mlir_quantum/
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Debug compiled programs and print dynamic values at runtime with ``debug.print``
[(#279)](https://github.com/PennyLaneAI/catalyst/pull/279)
[(#356)](https://github.com/PennyLaneAI/catalyst/pull/356)

You can now print arbitrary values from your running program, whether they are arrays, constants,
strings, or abitrary Python objects. Note that while non-array Python objects
Expand Down
1 change: 1 addition & 0 deletions runtime/lib/capi/RuntimeCAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void __quantum__rt__print_string(char *string)
{
if (!string) {
std::cout << "None" << std::endl;
return;
}
std::cout << string << std::endl;
}
Expand Down
8 changes: 5 additions & 3 deletions runtime/tests/Test_LightningCoreQIS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ using namespace Catalyst::Runtime;

TEST_CASE("Test __quantum__rt__print_string", "[qir_lightning_core]")
{
std::string str{"print_string_test"};
__quantum__rt__print_string(const_cast<char *>(str.c_str()));
__quantum__rt__print_string(nullptr);
char str[] = "print_string_test";
__quantum__rt__print_string(str);

char *str_null = nullptr;
__quantum__rt__print_string(str_null);
}

TEST_CASE("Test __quantum__rt__print_tensor i1, i8, i16, i32, f32, and c64", "[qir_lightning_core]")
Expand Down

0 comments on commit 2737a84

Please sign in to comment.