Skip to content

Commit

Permalink
Merge branch 'xdslproject:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedves authored Jan 20, 2025
2 parents 51c18b9 + 5c96c6e commit 26f8915
Show file tree
Hide file tree
Showing 55 changed files with 1,987 additions and 456 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand All @@ -35,4 +35,4 @@ jobs:
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
uv sync --extra gui --extra dev --extra jax --extra riscv --locked
2 changes: 1 addition & 1 deletion .github/workflows/ci-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pyright-fails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jupyterlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
path: xdsl

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remake-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5

- run: |
rm uv.lock
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-lockfile-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install the package locally and update lockfile
run: |
# Install all default extras.
XDSL_VERSION_OVERRIDE="0+dynamic" make venv
make venv
- uses: EndBug/add-and-commit@v9
with:
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VENV_DIR ?= .venv
export UV_PROJECT_ENVIRONMENT=$(if $(VIRTUAL_ENV),$(VIRTUAL_ENV),$(VENV_DIR))

# allow overriding which extras are installed
VENV_EXTRAS ?= --extra gui --extra dev --extra jax --extra riscv
VENV_EXTRAS ?= --extra gui --extra dev --extra jax --extra riscv --extra docs

# default lit options
LIT_OPTIONS ?= -v --order=smart
Expand All @@ -28,7 +28,7 @@ uv-installed:
# set up the venv with all dependencies for development
.PHONY: ${VENV_DIR}/
${VENV_DIR}/: uv-installed
XDSL_VERSION_OVERRIDE="0+dynamic" uv sync ${VENV_EXTRAS}
uv sync ${VENV_EXTRAS}
@if [ ! -z "$(XDSL_MLIR_OPT_PATH)" ]; then \
ln -sf $(XDSL_MLIR_OPT_PATH) ${VENV_DIR}/bin/mlir-opt; \
fi
Expand Down Expand Up @@ -163,3 +163,13 @@ coverage-report: uv-installed
.PHONY: coverage-clean
coverage-clean: uv-installed
uv run coverage erase

# docs

.PHONY: docs-serve
docs-serve: uv-installed
uv run mkdocs serve

.PHONY: docs-build
docs-build: uv-installed
uv run mkdocs build
5 changes: 5 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Api Reference

| Module | Name |
|----------------------|--------------------------|
| [`ir`](ir/index.md) | IR Data Structures |
38 changes: 38 additions & 0 deletions docs/api/ir/attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Attribute

## ::: xdsl.ir.Attribute

options:
members:
- name
- verify
show_root_heading: true

## ::: xdsl.ir.Data

options:
members:
- data
- print_parameter
- parse_parameter
show_root_heading: true

## ::: xdsl.ir.ParametrizedAttribute

options:
members:
- parameters
- print_parameters
- parse_parameters
- get_irdl_definition
show_root_heading: true

## ::: xdsl.ir.TypedAttribute

options:
members:
- parameters
- print_parameters
- parse_parameters
- get_irdl_definition
show_root_heading: true
Empty file added docs/api/ir/block.md
Empty file.
8 changes: 8 additions & 0 deletions docs/api/ir/dialect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# ::: xdsl.ir.Dialect

options:
members:
- attributes
- operations
show_root_heading: true
34 changes: 34 additions & 0 deletions docs/api/ir/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# IR Data Structures

## [Attribute](attribute.md)

Attributes represent compile-time information in xDSL.
All attributes are immutable, equatable, and hashable.

## [SSAValue](ssa_value.md)

Run-time information is represented as SSAValue.
SSA stands for [static single-assignment](https://en.wikipedia.org/wiki/Static_single-assignment_form), meaning that each value is only ever assigned once, and never reassigned.
This property is useful when performing transformations such as dead-code elimination, constant folding, and other compiler transformations.

## [IRNode](ir_node.md)

Code is represented as a recursive data structure, where [operations](operation.md) contain a doubly-linked list of [regions](region.md), which contain a doubly linked list of [blocks](block.md), which contain operations.

## [Operation](operation.md)

Operations are rich objects that carry some meaning in their IR.
They can be used to represent integer addition (`arith.addi`), a module of code (`builtin.module`), a function declaration or definition (`func.func`), and many more.

## [Block](block.md)

Blocks are a list of operations.
They have a (possibly empty) list of operands, that can be used to model function arguments for use in the function body, or loop arguments.

## [Region](region.md)

Regions are a list of blocks.

## [Dialect](dialect.md)

A dialect is a grouping of [attributes](attribute.md) and [operations](operation.md).
6 changes: 6 additions & 0 deletions docs/api/ir/ir_node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# IRNode

## ::: xdsl.ir.IRNode

options:
show_root_heading: true
28 changes: 28 additions & 0 deletions docs/api/ir/operation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Operation

## ::: xdsl.ir.Operation

options:
members:
- name
- operands
- results
- successors
- properties
- attributes
- regions
- parent
- next_op
- prev_op
- traits
show_root_heading: true

## ::: xdsl.ir.OpOperands

options:
show_root_heading: true

## ::: xdsl.ir.OpTraits

options:
show_root_heading: true
Empty file added docs/api/ir/region.md
Empty file.
12 changes: 12 additions & 0 deletions docs/api/ir/ssa_value.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# SSAValue

## ::: xdsl.ir.SSAValue

options:
show_root_heading: true

## ::: xdsl.ir.Use

options:
show_root_heading: true
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# xDSL

[xDSL](https://xdsl.dev/) is a compiler framework designed to be approachable, productive, and fun to use.

[API Reference](api/index.md)
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
site_name: xDSL

theme:
name: "material"

plugins:
- search
- mkdocstrings


# nav:
# - xDSL: index.md
# - API Reference:
# - API Reference: api/index.md
# - Core IR Data Structures: api/ir/index.md
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ dev = [
"nbval<0.12",
"filecheck==1.0.1",
"lit<19.0.0",
"marimo==0.10.12",
"marimo==0.10.14",
"pre-commit==4.0.1",
"ruff==0.9.1",
"ruff==0.9.2",
"asv<0.7",
"nbconvert>=7.7.2,<8.0.0",
"textual-dev==1.7.0",
"pytest-asyncio==0.25.2",
"pyright==1.1.391",
"pyright==1.1.392.post0",
]
docs = [
"mkdocs>=1.6.1",
"mkdocs-material>=9.5.49",
"mkdocstrings[python]>=0.27.0",
]
gui = ["textual==1.0.0", "pyclip==0.7"]
jax = ["jax==0.4.38", "numpy==2.2.1"]
jax = ["jax==0.5.0", "numpy==2.2.2"]
riscv = ["riscemu==2.2.7"]

[project.urls]
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import os
from collections.abc import Mapping
from typing import cast

from setuptools import Command, find_packages, setup

import versioneer

if "XDSL_VERSION_OVERRIDE" in os.environ:
version = os.environ["XDSL_VERSION_OVERRIDE"]
else:
version = versioneer.get_version()
version = versioneer.get_version()


setup(
Expand Down
Loading

0 comments on commit 26f8915

Please sign in to comment.