Skip to content

Commit

Permalink
Use mlir-python-extras as a dependency (#1828)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
hunhoffe and github-actions[bot] authored Oct 16, 2024
1 parent 6e0aaa9 commit 6fe87bb
Show file tree
Hide file tree
Showing 112 changed files with 347 additions and 6,745 deletions.
1 change: 1 addition & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
- name: Install Python packages
run: |
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Install packages
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildAndTestAieTools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildAndTestAieToolsHsaBuildOnly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildAndTestMulti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
- name: Install Python packages
run: |
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Setup Cpp
uses: aminya/setup-cpp@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildAndTestPythons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: Install Python packages
run: |
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Install packages
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/buildAndTestRyzenAI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
pip install -r python/requirements_ml.txt
pip install jupyter
sed -i.bak 's/OUTPUT_TIMEOUT = 10/OUTPUT_TIMEOUT = 100/g' \
Expand Down Expand Up @@ -136,6 +137,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
pip install -r python/requirements_ml.txt
pip install jupyter
sed -i.bak 's/OUTPUT_TIMEOUT = 10/OUTPUT_TIMEOUT = 100/g' \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/buildRyzenWheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
Expand Down Expand Up @@ -158,6 +159,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
source aie-venv/bin/activate
export MLIR_INSTALL_ABS_PATH=$PWD/mlir
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lintAndFormat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
pip install cmake==3.27.9 numpy psutil pybind11 rich pkginfo lit PyYAML requests
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Get MLIR
id: mlir-wheels
Expand Down Expand Up @@ -204,6 +205,7 @@ jobs:
run: |
pip install cmake numpy psutil pybind11 rich lit
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Install packages
run: sudo apt-get install -y ninja-build clang lld llvm libelf-dev
Expand Down Expand Up @@ -236,6 +238,7 @@ jobs:
if: steps.changed-files.outputs.changed-files != ''
run: |
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
- name: Build and generate coverage (Release)
if: steps.changed-files.outputs.changed-files != ''
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/mlirAIEDistro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ jobs:
export PIP_NO_BUILD_ISOLATION=false
pip install -r requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
pip install importlib-metadata
CIBW_ARCHS=${{ matrix.ARCH }} MATRIX_OS=${{ matrix.OS }} ./scripts/download_mlir.sh
Expand Down Expand Up @@ -360,6 +361,7 @@ jobs:
with:
sparse-checkout: |
python/requirements.txt
python/requirements_extras.txt
- uses: actions/download-artifact@v3
with:
Expand All @@ -374,6 +376,7 @@ jobs:
shell: bash
run: |
pip install -r python/requirements.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
unzip -o -q dist/mlir_aie\*.whl
if [ x"${{ matrix.ENABLE_RTTI }}" == x"ON" ]; then
Expand All @@ -383,6 +386,8 @@ jobs:
fi
python -c 'import aie.ir'
python -c 'import aie.extras'
python -c 'import aie.helpers'
upload_wheels:

Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/dma_transpose/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

N = 4096
M = 64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from aie.extras.context import mlir_mod_ctx
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

dtype_map = {
"bf16": bfloat16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from aie.extras.context import mlir_mod_ctx
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_matmul():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from aie.dialects.aiex import *
import aie.utils.trace as trace_utils
from aie.utils.trace import PortEvent
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

dtype_map = {
"bf16": bfloat16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from aie.dialects.aiex import *
import aie.utils.trace as trace_utils
from aie.utils.trace import PortEvent
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

dtype_map = {
"bf16": bfloat16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

dtype_map = {
"bf16": bfloat16,
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/matrix_scalar_add/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

# Size of the entire image
IMAGE_HEIGHT = 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

dev = AIEDevice.npu1_1col
col = 0
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/passthrough_dmas/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

N = 4096
dev = AIEDevice.npu1_1col
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

N = 1024
line_size = 1024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

N = 1024
line_size = 1024
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/passthrough_kernel/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

import aie.utils.trace as trace_utils

Expand Down
4 changes: 2 additions & 2 deletions programming_examples/basic/passthrough_pykernel/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.func import func
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.func import func
from aie.helpers.dialects.ext.scf import _for as range_


def passthroughKernel(vector_size):
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/row_wise_bias_add/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def row_wise_bias_add(M, N, m, n):
Expand Down
4 changes: 2 additions & 2 deletions programming_examples/basic/vector_exp/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from aie.extras.context import mlir_mod_ctx # mlir ctx wrapper

from aie.dialects.aiex import * # extended mlir-aie dialect definitions
from aie.extras.dialects.ext.scf import (
from aie.helpers.dialects.ext.scf import (
_for as range_,
) # scf (structured control flow) dialect
from aie.extras.util import np_ndarray_type_get_shape
from aie.helpers.util import np_ndarray_type_get_shape


# AI Engine structural design function
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_reduce_add/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_reduce_add():
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_reduce_max/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_reduce_max():
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_reduce_min/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_reduce_min():
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_scalar_add/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

PROBLEM_SIZE = 1024
MEM_TILE_WIDTH = 64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

PROBLEM_SIZE = 1024
MEM_TILE_WIDTH = 64
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_scalar_mul/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_

import aie.utils.trace as trace_utils

Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_vector_add/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_vector_add():
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_vector_modulo/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_vector_add():
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/basic/vector_vector_mul/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_


def my_vector_mul():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_
from aie.extras.context import mlir_mod_ctx

N = 50
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/dynamic_object_fifo/ping_pong/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_
from aie.extras.context import mlir_mod_ctx

N = 1024
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/dynamic_object_fifo/reduction/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_
from aie.extras.context import mlir_mod_ctx

N = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_
from aie.extras.context import mlir_mod_ctx

N = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.dialects.ext.scf import _for as range_
from aie.helpers.dialects.ext.scf import _for as range_
from aie.extras.context import mlir_mod_ctx

N = 100
Expand Down
Loading

0 comments on commit 6fe87bb

Please sign in to comment.