Skip to content

Commit

Permalink
Update GH Actions to support nanobind
Browse files Browse the repository at this point in the history
  • Loading branch information
GleasonK committed Dec 12, 2024
1 parent 902cba7 commit 082a659
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/buildAndTestCMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ jobs:
- name: Build and Test StableHLO (with Python bindings)
shell: bash
run: |
pip install tensorflow-cpu
pip install tensorflow-cpu nanobind==2.4
pip install -r "$LLVM_PROJECT_DIR/mlir/python/requirements.txt"
./build_tools/github_actions/ci_build_cmake.sh "$LLVM_BUILD_DIR" "$STABLEHLO_BUILD_DIR"
env:
CMAKE_BUILD_TYPE: Release
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publishWheelRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ jobs:
- name: Build and Test StableHLO with Python
shell: bash
run: |
pip install tensorflow-cpu
pip install tensorflow-cpu nanobind==2.4
pip install -r "$LLVM_PROJECT_DIR/mlir/python/requirements.txt"
./build_tools/github_actions/ci_build_cmake.sh "$LLVM_BUILD_DIR" "$STABLEHLO_BUILD_DIR"
env:
CMAKE_BUILD_TYPE: Release
Expand Down
4 changes: 4 additions & 0 deletions stablehlo/integrations/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ declare_mlir_python_sources(CheckPythonExtensions)
declare_mlir_python_extension(CheckPythonExtensions.Main
MODULE_NAME _check
ADD_TO_PARENT CheckPythonExtensions
PYTHON_BINDINGS_LIBRARY nanobind
SOURCES
CheckModule.cpp
EMBED_CAPI_LINK_LIBS
Expand All @@ -106,6 +107,7 @@ declare_mlir_python_sources(ChloPythonExtensions)
declare_mlir_python_extension(ChloPythonExtensions.Main
MODULE_NAME _chlo
ADD_TO_PARENT ChloPythonExtensions
PYTHON_BINDINGS_LIBRARY nanobind
SOURCES
ChloModule.cpp
EMBED_CAPI_LINK_LIBS
Expand All @@ -118,6 +120,7 @@ declare_mlir_python_sources(StablehloPythonExtensions)
declare_mlir_python_extension(StablehloPythonExtensions.Main
MODULE_NAME _stablehlo
ADD_TO_PARENT StablehloPythonExtensions
PYTHON_BINDINGS_LIBRARY nanobind
SOURCES
StablehloApi.cpp
StablehloModule.cpp
Expand All @@ -132,6 +135,7 @@ declare_mlir_python_sources(VhloPythonExtensions)
declare_mlir_python_extension(VhloPythonExtensions.Main
MODULE_NAME _vhlo
ADD_TO_PARENT VhloPythonExtensions
PYTHON_BINDINGS_LIBRARY nanobind
SOURCES
VhloModule.cpp
EMBED_CAPI_LINK_LIBS
Expand Down
2 changes: 1 addition & 1 deletion stablehlo/integrations/python/StablehloApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void AddPortableApi(nb::module_ &m) {
nb::arg("artifact_str"));
m.def(
"deserialize_portable_artifact_str",
[](const nb::bytes& artifact) -> nb::bytes {
[](const nb::bytes &artifact) -> nb::bytes {
StringWriterHelper accumulator;
if (mlirLogicalResultIsFailure(stablehloDeserializePortableArtifact(
toMlirStringRef(artifact), accumulator.getMlirStringCallback(),
Expand Down

0 comments on commit 082a659

Please sign in to comment.