Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialects: (onnx) remove ONNX-related code #3738

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/ci-mlir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ jobs:
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
uv run pytest --nbval docs/mlir_interoperation.ipynb --maxfail 1 -vv

- name: Test ONNX-dependent marimo notebooks
run: |
cd xdsl
# Add mlir-opt to the path
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
uv run make tests-marimo-onnx

- name: Combine coverage data
run: |
cd xdsl
Expand Down
22 changes: 1 addition & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,30 +98,10 @@ tests-marimo: uv-installed
done
@echo "All marimo tests passed successfully."

.PHONY: tests-marimo-onnx
tests-marimo-onnx: uv-installed
@if uv run python -c "import onnx" > /dev/null 2>&1; then \
echo "onnx is installed, running tests."; \
if ! command -v mlir-opt > /dev/null 2>&1; then \
echo "MLIR is not installed, skipping tests."; \
exit 0; \
fi; \
for file in docs/marimo/onnx/*.py; do \
echo "Running $$file"; \
error_message=$$(uv run python3 "$$file" 2>&1) || { \
echo "Error running $$file"; \
echo "$$error_message"; \
exit 1; \
}; \
done; \
echo "All marimo onnx tests passed successfully."; \
else \
echo "onnx is not installed, skipping tests."; \
fi

# run all tests
.PHONY: tests-functional
tests-functional: pytest tests-toy filecheck pytest-nb tests-marimo tests-marimo-onnx
tests-functional: pytest tests-toy filecheck pytest-nb tests-marimo
@echo All functional tests done.

# run all tests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In order to keep the set of dependencies ot a minimum, these extra dependencies
specified explicitly. To install these, use:

``` bash
pip install xdsl[gui,jax,riscv,onnx]
pip install xdsl[gui,jax,riscv]
```

To install the testing/development dependencies, use:
Expand Down
4 changes: 2 additions & 2 deletions docs/marimo/__marimo__/linalg_snitch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
"riscv_op_counter = OpCounter()\n",
"riscv_interpreter = Interpreter(riscv_module, listeners=(riscv_op_counter,))\n",
"\n",
"register_implementations(riscv_interpreter, riscv_ctx, include_onnx=False)\n",
"register_implementations(riscv_interpreter, riscv_ctx)\n",
"\n",
"riscv_interpreter.call_op(\"matmul\", (a_shaped.data_ptr.raw, b_shaped.data_ptr.raw, riscv_c_shaped.data_ptr.raw))\n",
"\n",
Expand Down Expand Up @@ -633,7 +633,7 @@
"\n",
"snitch_c_shaped = ShapedArray(TypedPtr.new_float64([0.0] * c_len), c_shape)\n",
"\n",
"register_implementations(snitch_interpreter, snitch_stream_ctx, include_onnx=False)\n",
"register_implementations(snitch_interpreter, snitch_stream_ctx)\n",
"\n",
"snitch_interpreter.call_op(\n",
" \"matmul\",\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/marimo/linalg_snitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _(TypedPtr, a_shape, b_shape, c_shape, mo, riscv_ctx, riscv_module):
riscv_op_counter = OpCounter()
riscv_interpreter = Interpreter(riscv_module, listeners=(riscv_op_counter,))

register_implementations(riscv_interpreter, riscv_ctx, include_onnx=False)
register_implementations(riscv_interpreter, riscv_ctx)

riscv_interpreter.call_op("matmul", (a_shaped.data_ptr.raw, b_shaped.data_ptr.raw, riscv_c_shaped.data_ptr.raw))

Expand Down Expand Up @@ -566,7 +566,7 @@ def _(

snitch_c_shaped = ShapedArray(TypedPtr.new_float64([0.0] * c_len), c_shape)

register_implementations(snitch_interpreter, snitch_stream_ctx, include_onnx=False)
register_implementations(snitch_interpreter, snitch_stream_ctx)

snitch_interpreter.call_op(
"matmul",
Expand Down
4 changes: 0 additions & 4 deletions docs/marimo/onnx/README.md

This file was deleted.

Loading
Loading