Skip to content

Commit

Permalink
docs: add onnx demo notebook (#2796)
Browse files Browse the repository at this point in the history
Note that this is missing the interpreter part, since the bug is still
there with the ABI calling convention not being respected when calling
from the interpreter object directly.
  • Loading branch information
superlopuh authored Jun 30, 2024
1 parent 1a33911 commit d524986
Show file tree
Hide file tree
Showing 5 changed files with 442 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci-mlir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ jobs:
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
pytest --nbval docs/mlir_interoperation.ipynb --maxfail 1 -vv
- name: Test MLIR dependent marimo notebooks
run: |
cd xdsl
# Add mlir-opt to the path
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
make tests-marimo-mlir
- name: Combine coverage data
run: |
cd xdsl
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TESTS_COVERAGE_FILE = ${COVERAGE_FILE}.tests
.ONESHELL:

# these targets don't produce files:
.PHONY: ${VENV_DIR}/ venv clean filecheck pytest pytest-nb tests-toy tests rerun-notebooks precommit-install precommit black pyright tests-marimo
.PHONY: ${VENV_DIR}/ venv clean filecheck pytest pytest-nb tests-toy tests rerun-notebooks precommit-install precommit black pyright tests-marimo tests-marimo-mlir
.PHONY: coverage coverage-tests coverage-filecheck-tests coverage-report-html coverage-report-md

# set up the venv with all dependencies for development
Expand Down Expand Up @@ -58,8 +58,15 @@ tests-marimo:
done
@echo "All marimo tests passed successfully."

tests-marimo-mlir:
@for file in docs/marimo/mlir/*.py; do \
echo "Running $$file"; \
python3 "$$file" || exit 1; \
done
@echo "All marimo mlir tests passed successfully."

# run all tests
tests: pytest tests-toy filecheck pytest-nb tests-marimo pyright
tests: pytest tests-toy filecheck pytest-nb tests-marimo tests-marimo-mlir pyright
@echo All tests done.

# re-generate the output from all jupyter notebooks in the docs directory
Expand Down
4 changes: 4 additions & 0 deletions docs/marimo/mlir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Marimo notebooks that depend on mlir-opt

For these notebooks to run as intended, `mlir-opt` needs to be in the path.
Please see the [MLIR Interoperation](../../mlir_interoperation.md) document for more information.
Loading

0 comments on commit d524986

Please sign in to comment.