From 2fb1dc4efbfa2f945fceb96651b1d32b2eabf7e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:01:36 +0000 Subject: [PATCH 1/6] pip prod(deps): bump marimo from 0.9.34 to 0.10.0 Bumps [marimo](https://github.com/marimo-team/marimo) from 0.9.34 to 0.10.0. - [Release notes](https://github.com/marimo-team/marimo/releases) - [Commits](https://github.com/marimo-team/marimo/compare/0.9.34...0.10.0) --- updated-dependencies: - dependency-name: marimo dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 28ae53830e..7e3ec43871 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dev = [ "nbval<0.12", "filecheck==1.0.1", "lit<19.0.0", - "marimo==0.9.34", + "marimo==0.10.0", "pre-commit==4.0.1", "ruff==0.8.3", "asv<0.7", From 1a3148b876e0d6f056f56b48277b9f6055971b44 Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Fri, 13 Dec 2024 16:05:39 +0000 Subject: [PATCH 2/6] Fail if the lockfile is out of date with pyproject.toml --- .github/workflows/ci-mlir.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-mlir.yml b/.github/workflows/ci-mlir.yml index 574a0eb410..30bec9ba4b 100644 --- a/.github/workflows/ci-mlir.yml +++ b/.github/workflows/ci-mlir.yml @@ -49,7 +49,9 @@ jobs: run: | # Change directory so that xdsl-opt can be found during installation. cd xdsl - VENV_EXTRAS="--all-extras" make venv + # Install all extras. + # Fail if the lockfile is out of date with pyproject.toml. + asv sync --all-extras --locked - name: Cache binaries id: cache-binary From 2b647e444f08c2b59fb6dcc49ecf2dda013994a6 Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Fri, 13 Dec 2024 16:06:31 +0000 Subject: [PATCH 3/6] wrong command --- .github/workflows/ci-mlir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-mlir.yml b/.github/workflows/ci-mlir.yml index 30bec9ba4b..d61248ece8 100644 --- a/.github/workflows/ci-mlir.yml +++ b/.github/workflows/ci-mlir.yml @@ -51,7 +51,7 @@ jobs: cd xdsl # Install all extras. # Fail if the lockfile is out of date with pyproject.toml. - asv sync --all-extras --locked + uv sync --all-extras --locked - name: Cache binaries id: cache-binary From 234f61f1e5bfcbfd5e9ad8e1d144930342e0efcc Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Fri, 13 Dec 2024 19:11:47 +0000 Subject: [PATCH 4/6] try my hack --- .github/workflows/ci-lockfile.yml | 38 +++++++++++++++++++++++++++++++ .github/workflows/ci-mlir.yml | 4 +--- Makefile | 2 +- setup.py | 9 +++++++- uv.lock | 2 +- xdsl/__init__.py | 9 ++++++-- 6 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/ci-lockfile.yml diff --git a/.github/workflows/ci-lockfile.yml b/.github/workflows/ci-lockfile.yml new file mode 100644 index 0000000000..8527304b69 --- /dev/null +++ b/.github/workflows/ci-lockfile.yml @@ -0,0 +1,38 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: CI - Lockfile + +on: + # Trigger the workflow on push or pull request, + # but only for the master branch + push: + branches: + - main + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.12'] + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install the package locally and check for lockfile mismatch + run: | + # Install all default extras. + # Fail if the lockfile dependencies are out of date with pyproject.toml. + XDSL_VERSION_OVERRIDE="0+dynamic" uv sync --extra gui --extra dev --extra jax --extra riscv --locked --verbose diff --git a/.github/workflows/ci-mlir.yml b/.github/workflows/ci-mlir.yml index d61248ece8..574a0eb410 100644 --- a/.github/workflows/ci-mlir.yml +++ b/.github/workflows/ci-mlir.yml @@ -49,9 +49,7 @@ jobs: run: | # Change directory so that xdsl-opt can be found during installation. cd xdsl - # Install all extras. - # Fail if the lockfile is out of date with pyproject.toml. - uv sync --all-extras --locked + VENV_EXTRAS="--all-extras" make venv - name: Cache binaries id: cache-binary diff --git a/Makefile b/Makefile index feaa554d97..f422f3eeb5 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ uv-installed: # set up the venv with all dependencies for development .PHONY: ${VENV_DIR}/ ${VENV_DIR}/: uv-installed - uv sync ${VENV_EXTRAS} + XDSL_VERSION_OVERRIDE="0+dynamic" uv sync ${VENV_EXTRAS} # make sure `make venv` also works correctly .PHONY: venv diff --git a/setup.py b/setup.py index cb875c28ff..41cc20d3e1 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import os from collections.abc import Mapping from typing import cast @@ -5,8 +6,14 @@ import versioneer +if "XDSL_VERSION_OVERRIDE" in os.environ: + version = os.environ["XDSL_VERSION_OVERRIDE"] +else: + version = versioneer.get_version() + + setup( - version=versioneer.get_version(), + version=version, cmdclass=cast(Mapping[str, type[Command]], versioneer.get_cmdclass()), packages=find_packages(), ) diff --git a/uv.lock b/uv.lock index ed8fc344f1..cf443f6706 100644 --- a/uv.lock +++ b/uv.lock @@ -2390,7 +2390,7 @@ wheels = [ [[package]] name = "xdsl" -version = "0.25.0+89.gb85bb1a8" +version = "0+dynamic" source = { editable = "." } dependencies = [ { name = "immutabledict" }, diff --git a/xdsl/__init__.py b/xdsl/__init__.py index 2044304eee..df46b56a94 100644 --- a/xdsl/__init__.py +++ b/xdsl/__init__.py @@ -9,9 +9,14 @@ def __init__(self): def __str__(self): if self._version is None: - from . import _version + import os - self._version = _version.get_versions()["version"] + if "XDSL_VERSION_OVERRIDE" in os.environ: + self._version = os.environ["XDSL_VERSION_OVERRIDE"] + else: + from . import _version + + self._version = _version.get_versions()["version"] return self._version From 6d4e92b967d554266c24becb987af0162a53e51d Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Thu, 2 Jan 2025 17:56:06 +0000 Subject: [PATCH 5/6] update marimo --- uv.lock | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/uv.lock b/uv.lock index 8878c37078..8a36480b37 100644 --- a/uv.lock +++ b/uv.lock @@ -250,6 +250,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fc/55/96142937f66150805c25c4d0f31ee4132fd33497753400734f9dfdcbdc66/bleach-6.2.0-py3-none-any.whl", hash = "sha256:117d9c6097a7c3d22fd578fcd8d35ff1e125df6736f554da4e432fdd63f31e5e", size = 163406 }, ] +[package.optional-dependencies] +css = [ + { name = "tinycss2" }, +] + [[package]] name = "build" version = "1.2.2.post1" @@ -895,7 +900,7 @@ wheels = [ [[package]] name = "marimo" -version = "0.9.34" +version = "0.10.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, @@ -916,9 +921,9 @@ dependencies = [ { name = "uvicorn" }, { name = "websockets" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e4/3e/a0c40078c426a435a40f12286202ce21c7940780b923381435b7bfecd837/marimo-0.9.34.tar.gz", hash = "sha256:50968e0906335be54e17873f4ad5893fdf73c970df112e147768ee8fd956084c", size = 11780947 } +sdist = { url = "https://files.pythonhosted.org/packages/5b/0b/d0c66cdb3b69b69b624d945d5bf6ab3877415e5be1e69a8d91a96da452ba/marimo-0.10.0.tar.gz", hash = "sha256:08b952cd6d6940094abba6882be8bd64119107b7b59332c4dfe81f00d9b0b9fc", size = 11787987 } wheels = [ - { url = "https://files.pythonhosted.org/packages/f0/58/97a950c7f36c4e46c26b268fa6f8010f262f382d779256c4b61f94c4ce2a/marimo-0.9.34-py3-none-any.whl", hash = "sha256:f36b8bcb787f354d4708dd5cf38ee8febc96a3cd63498c234b7e4ce7c97807e9", size = 12075947 }, + { url = "https://files.pythonhosted.org/packages/ac/a1/7055267fb0ec3690eae79bf11f21ff135a2abddb894ef57819e274617a4b/marimo-0.10.0-py3-none-any.whl", hash = "sha256:702e9084c080ec368e472506b86b9feb5bda9c6aec9054a560a4f955ee50dc38", size = 12082845 }, ] [[package]] @@ -1206,11 +1211,11 @@ wheels = [ [[package]] name = "narwhals" -version = "1.19.1" +version = "1.20.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/eb/fe/8133d3a21978e333a70f42561167551482b42044fc12cbbb7908aa64e5f5/narwhals-1.19.1.tar.gz", hash = "sha256:e597e7ed9da42ffb2c80b21e174817b27592a8570edea8c46c90a726e3b796af", size = 222808 } +sdist = { url = "https://files.pythonhosted.org/packages/f7/f0/3179615405104a90dc31a56fea27c9135f646cf4476e2904fcde125f5287/narwhals-1.20.1.tar.gz", hash = "sha256:ffc6a44c1bc651531198c5f7fc38d349dff898ecfe51c1ef96aaaf429ec4dc19", size = 224429 } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/0c/c01eb700963a978b741a93c0ed233d613643ece0ad54f5e2765a307f26f2/narwhals-1.19.1-py3-none-any.whl", hash = "sha256:72476dcc95f1d3f2c0c1f047cdd4879346b2871fe13d1223025466d8a3dcaea4", size = 260574 }, + { url = "https://files.pythonhosted.org/packages/3d/a2/c91fedeb24e622b30d240e89e5ecf40cb3c2a8e50f61b5b28f0eb1fbb458/narwhals-1.20.1-py3-none-any.whl", hash = "sha256:77fc10fed31534a4ecf0c5e1e091c91c454cb2fa73937f36be3fcb0c2dfdabc6", size = 262391 }, ] [[package]] @@ -1230,11 +1235,11 @@ wheels = [ [[package]] name = "nbconvert" -version = "7.16.4" +version = "7.16.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "beautifulsoup4" }, - { name = "bleach" }, + { name = "bleach", extra = ["css"] }, { name = "defusedxml" }, { name = "jinja2" }, { name = "jupyter-core" }, @@ -1246,12 +1251,11 @@ dependencies = [ { name = "packaging" }, { name = "pandocfilters" }, { name = "pygments" }, - { name = "tinycss2" }, { name = "traitlets" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/af/e8/ba521a033b21132008e520c28ceb818f9f092da5f0261e94e509401b29f9/nbconvert-7.16.4.tar.gz", hash = "sha256:86ca91ba266b0a448dc96fa6c5b9d98affabde2867b363258703536807f9f7f4", size = 854422 } +sdist = { url = "https://files.pythonhosted.org/packages/46/2c/d026c0367f2be2463d4c2f5b538e28add2bc67bc13730abb7f364ae4eb8b/nbconvert-7.16.5.tar.gz", hash = "sha256:c83467bb5777fdfaac5ebbb8e864f300b277f68692ecc04d6dab72f2d8442344", size = 856367 } wheels = [ - { url = "https://files.pythonhosted.org/packages/b8/bb/bb5b6a515d1584aa2fd89965b11db6632e4bdc69495a52374bcc36e56cfa/nbconvert-7.16.4-py3-none-any.whl", hash = "sha256:05873c620fe520b6322bf8a5ad562692343fe3452abda5765c7a34b7d1aa3eb3", size = 257388 }, + { url = "https://files.pythonhosted.org/packages/8f/9e/2dcc9fe00cf55d95a8deae69384e9cea61816126e345754f6c75494d32ec/nbconvert-7.16.5-py3-none-any.whl", hash = "sha256:e12eac052d6fd03040af4166c563d76e7aeead2e9aadf5356db552a1784bd547", size = 258061 }, ] [[package]] @@ -2152,14 +2156,14 @@ wheels = [ [[package]] name = "starlette" -version = "0.45.0" +version = "0.45.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e9/dc/9b3204e7bdc7c2b7589b604259b32b6b1dcc28faa2f51969d4968510845d/starlette-0.45.0.tar.gz", hash = "sha256:ca7ee855c243a058a2f24bc832b8072bade47fbc2672ce4b98de66c7f6c924f0", size = 2574214 } +sdist = { url = "https://files.pythonhosted.org/packages/c1/be/b398217eb35b356d2d9bb84ec67071ea2842e02950fcf38b33df9d5b24ba/starlette-0.45.1.tar.gz", hash = "sha256:a8ae1fa3b1ab7ca83a4abd77871921a13fb5aeaf4874436fb96c29dfcd4ecfa3", size = 2573953 } wheels = [ - { url = "https://files.pythonhosted.org/packages/71/33/648fb0d0990650377a2fbcbc4e5cf760012cdc5ba35c471abbe6f3dc15e8/starlette-0.45.0-py3-none-any.whl", hash = "sha256:c911ba0e86eed5b336931623f45e56a8c6d76c618f2749d9f5ed9ee55a5bf1bb", size = 71795 }, + { url = "https://files.pythonhosted.org/packages/6b/2c/a50484b035ee0e13ebb7a42391e391befbfc1b6a9ad5503e83badd182ada/starlette-0.45.1-py3-none-any.whl", hash = "sha256:5656c0524f586e9148d9a3c1dd5257fb42a99892fb0dc6877dd76ef4d184aac3", size = 71488 }, ] [[package]] @@ -2516,7 +2520,7 @@ requires-dist = [ { name = "ipykernel", marker = "extra == 'dev'" }, { name = "jax", marker = "extra == 'jax'", specifier = "==0.4.38" }, { name = "lit", marker = "extra == 'dev'", specifier = "<19.0.0" }, - { name = "marimo", marker = "extra == 'dev'", specifier = "==0.9.34" }, + { name = "marimo", marker = "extra == 'dev'", specifier = "==0.10.0" }, { name = "nbconvert", marker = "extra == 'dev'", specifier = ">=7.7.2,<8.0.0" }, { name = "nbval", marker = "extra == 'dev'", specifier = "<0.12" }, { name = "numpy", marker = "extra == 'jax'", specifier = "==2.2.1" }, From 13a38aa80866d8e2d64de56d04a74dd68710b08d Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Thu, 2 Jan 2025 18:00:45 +0000 Subject: [PATCH 6/6] update notebooks --- docs/marimo/linalg_snitch.py | 60 +++++++++++++++++------------------ docs/marimo/onnx/onnx_demo.py | 40 +++++++++++------------ 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/marimo/linalg_snitch.py b/docs/marimo/linalg_snitch.py index febb1c2afd..3a0c05d6fd 100644 --- a/docs/marimo/linalg_snitch.py +++ b/docs/marimo/linalg_snitch.py @@ -1,17 +1,17 @@ import marimo -__generated_with = "0.8.20" +__generated_with = "0.10.0" app = marimo.App(width="medium") @app.cell -def __(): +def _(): import marimo as mo return (mo,) @app.cell -def __(mo): +def _(mo): mo.md( """ \ @@ -26,7 +26,7 @@ def __(mo): @app.cell -def __(): +def _(): # Import all the necessary functionality from xDSL for this notebook # If you see an error about xdsl not being defined run this cell manually @@ -118,7 +118,7 @@ def __(): @app.cell -def __( +def _( AffineMap, AffineMapAttr, Block, @@ -201,7 +201,7 @@ def __( @app.cell -def __(mo): +def _(mo): min_val = 1 max_val = 10 m = mo.ui.slider(min_val, max_val, value=2, label="M") @@ -211,7 +211,7 @@ def __(mo): @app.cell -def __(k, m, mo, n): +def _(k, m, mo, n): mo.md( f""" We can parametrize the shapes of the matrices operated on: @@ -227,7 +227,7 @@ def __(k, m, mo, n): @app.cell -def __(k, m, mo, n): +def _(k, m, mo, n): a_shape = (m.value, k.value) b_shape = (k.value, n.value) c_shape = (m.value, n.value) @@ -244,13 +244,13 @@ def __(k, m, mo, n): @app.cell -def __(mo): +def _(mo): mo.md("""### Compiling to RISC-V""") return @app.cell -def __(MLContext, get_all_dialects): +def _(MLContext, get_all_dialects): ctx = MLContext() for dialect_name, dialect_factory in get_all_dialects().items(): @@ -259,13 +259,13 @@ def __(MLContext, get_all_dialects): @app.cell -def __(mo): +def _(mo): mo.md("""We can take this representation, and lower to RISC-V-specific dialects:""") return @app.cell -def __( +def _( PipelinePass, convert_arith_to_riscv, convert_func_to_riscv_func, @@ -296,7 +296,7 @@ def __( @app.cell -def __(mo): +def _(mo): mo.md( """ #### Register allocation @@ -308,7 +308,7 @@ def __(mo): @app.cell -def __( +def _( CanonicalizePass, PipelinePass, RISCVRegisterAllocation, @@ -331,7 +331,7 @@ def __( @app.cell -def __( +def _( CanonicalizePass, ConvertRiscvScfToRiscvCfPass, PipelinePass, @@ -354,13 +354,13 @@ def __( @app.cell -def __(mo): +def _(mo): mo.md("""This representation of the program in xDSL corresponds ~1:1 to RISC-V assembly, and we can use a helper function to print that out.""") return @app.cell -def __(asm_html, mo, riscv_asm_module, riscv_code): +def _(asm_html, mo, riscv_asm_module, riscv_code): riscv_asm = riscv_code(riscv_asm_module) mo.md(f"""\ @@ -373,7 +373,7 @@ def __(asm_html, mo, riscv_asm_module, riscv_code): @app.cell -def __(mo): +def _(mo): mo.md( """ ### Compiling to Snitch @@ -385,7 +385,7 @@ def __(mo): @app.cell -def __( +def _( PipelinePass, arith_add_fastmath, convert_linalg_to_memref_stream, @@ -420,13 +420,13 @@ def __( @app.cell -def __(mo): +def _(mo): mo.md("""We can then lower this to assembly that includes assembly instructions from the Snitch-extended ISA:""") return @app.cell -def __(pipeline_accordion, snitch_stream_module): +def _(pipeline_accordion, snitch_stream_module): from xdsl.transforms.test_lower_linalg_to_snitch import LOWER_SNITCH_STREAM_TO_ASM_PASSES snitch_asm_module, snitch_asm_accordion = pipeline_accordion( @@ -442,7 +442,7 @@ def __(pipeline_accordion, snitch_stream_module): @app.cell -def __(k, m, mo, n): +def _(k, m, mo, n): mo.md( f""" We can see how changing our input sizes affects the assembly produced: @@ -458,7 +458,7 @@ def __(k, m, mo, n): @app.cell -def __(asm_html, mo, riscv_code, snitch_asm_module): +def _(asm_html, mo, riscv_code, snitch_asm_module): snitch_asm = riscv_code(snitch_asm_module) mo.md(f"""\ @@ -471,7 +471,7 @@ def __(asm_html, mo, riscv_code, snitch_asm_module): @app.cell -def __(mo): +def _(mo): mo.md( """ ### Interpreting the assembly using xDSL @@ -483,7 +483,7 @@ def __(mo): @app.cell -def __(TypedPtr, a_shape, b_shape, c_shape, ctx, mo, riscv_module): +def _(TypedPtr, a_shape, b_shape, c_shape, ctx, mo, riscv_module): from math import prod from xdsl.interpreter import Interpreter, OpCounter @@ -532,7 +532,7 @@ def __(TypedPtr, a_shape, b_shape, c_shape, ctx, mo, riscv_module): @app.cell -def __( +def _( Interpreter, OpCounter, ShapedArray, @@ -579,7 +579,7 @@ def __( @app.cell -def __(k, m, mo, n, riscv_op_counter, snitch_op_counter): +def _(k, m, mo, n, riscv_op_counter, snitch_op_counter): rv_dict = dict(riscv_op_counter.ops) sn_dict = dict(snitch_op_counter.ops) @@ -666,7 +666,7 @@ def format_row(key: str, *values: str): @app.cell -def __(ModuleOp, mo): +def _(ModuleOp, mo): import html as htmllib def module_html(module: ModuleOp) -> str: @@ -684,13 +684,13 @@ def asm_html(asm: str) -> str: @app.cell -def __(): +def _(): from collections import Counter return (Counter,) @app.cell -def __(Counter, ModuleOp, ModulePass, PipelinePass, ctx, mo, module_html): +def _(Counter, ModuleOp, ModulePass, PipelinePass, ctx, mo, module_html): def spec_str(p: ModulePass) -> str: if isinstance(p, PipelinePass): return ",".join(str(c.pipeline_pass_spec()) for c in p.passes) diff --git a/docs/marimo/onnx/onnx_demo.py b/docs/marimo/onnx/onnx_demo.py index 66196d1411..8c84310cb9 100644 --- a/docs/marimo/onnx/onnx_demo.py +++ b/docs/marimo/onnx/onnx_demo.py @@ -1,11 +1,11 @@ import marimo -__generated_with = "0.9.17" +__generated_with = "0.10.0" app = marimo.App() @app.cell(hide_code=True) -def __(mo): +def _(mo): mo.md( """ # ONNX to Snitch @@ -17,7 +17,7 @@ def __(mo): @app.cell(hide_code=True) -def __(mo): +def _(mo): rank = mo.ui.slider(1, 4, value=2, label="Rank") mo.md( @@ -31,7 +31,7 @@ def __(mo): @app.cell(hide_code=True) -def __(mo, rank): +def _(mo, rank): shape = tuple(range(2, 2 + rank.value)) mo.md( @@ -49,7 +49,7 @@ def __(mo, rank): @app.cell(hide_code=True) -def __(mo, shape): +def _(mo, shape): mo.md( f""" ### The ONNX model @@ -61,7 +61,7 @@ def __(mo, shape): @app.cell(hide_code=True) -def __(): +def _(): import onnx from onnx import AttributeProto, GraphProto, TensorProto, ValueInfoProto, helper return ( @@ -75,7 +75,7 @@ def __(): @app.cell -def __(TensorProto, helper, onnx, shape): +def _(TensorProto, helper, onnx, shape): # Create one input (ValueInfoProto) X1 = helper.make_tensor_value_info("X1", TensorProto.DOUBLE, shape) X2 = helper.make_tensor_value_info("X2", TensorProto.DOUBLE, shape) @@ -111,7 +111,7 @@ def __(TensorProto, helper, onnx, shape): @app.cell(hide_code=True) -def __(mo): +def _(mo): mo.md( """ ONNX uses a serialized binary format for neural networks, but can also print a string format, which can be useful for debugging. @@ -122,7 +122,7 @@ def __(mo): @app.cell(hide_code=True) -def __(mo, model_def): +def _(mo, model_def): mo.accordion( { "ONNX Graph": mo.plain_text(f"{model_def}"), @@ -132,7 +132,7 @@ def __(mo, model_def): @app.cell -def __(html, init_module, mo): +def _(html, init_module, mo): mo.md(f""" ### Converting to `linalg` @@ -145,13 +145,13 @@ def __(html, init_module, mo): @app.cell -def __(build_module, model_def): +def _(build_module, model_def): init_module = build_module(model_def.graph) return (init_module,) @app.cell(hide_code=True) -def __(MLContext, get_all_dialects): +def _(MLContext, get_all_dialects): ctx = MLContext() for dialect_name, dialect_factory in get_all_dialects().items(): @@ -160,13 +160,13 @@ def __(MLContext, get_all_dialects): @app.cell -def __(mo): +def _(mo): mo.md("""xDSL seamlessly interoperates with MLIR, we the `mlir-opt` tool to compile the input to a form that we want to process:""") return @app.cell -def __( +def _( ConvertOnnxToLinalgPass, EmptyTensorToAllocTensorPass, MLIROptPass, @@ -220,7 +220,7 @@ def __( @app.cell -def __(mo): +def _(mo): mo.md( """ From here we can use a number of backends to generate executable code, like LLVM, or RISC-V assembly directly. @@ -231,7 +231,7 @@ def __(mo): @app.cell -def __(): +def _(): from xdsl.context import MLContext from xdsl.frontend.onnx.ir_builder import build_module from xdsl.ir import Attribute, SSAValue @@ -254,13 +254,13 @@ def __(): @app.cell(hide_code=True) -def __(): +def _(): import marimo as mo return (mo,) @app.cell(hide_code=True) -def __(ModuleOp, mo): +def _(ModuleOp, mo): import html as htmllib def html(module: ModuleOp) -> mo.Html: @@ -272,13 +272,13 @@ def html(module: ModuleOp) -> mo.Html: @app.cell(hide_code=True) -def __(): +def _(): from collections import Counter return (Counter,) @app.cell(hide_code=True) -def __(Counter, ModuleOp, ModulePass, PipelinePass, ctx, html, mo): +def _(Counter, ModuleOp, ModulePass, PipelinePass, ctx, html, mo): def spec_str(p: ModulePass) -> str: if isinstance(p, PipelinePass): return ",".join(str(c.pipeline_pass_spec()) for c in p.passes)