Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Unchecked vibe coding -- do not review#2675

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
hunhoffe wants to merge26 commits intomain
base:main
Choose a base branch
Loading
fromerika-vibe-coding
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
26 commits
Select commitHold shift + click to select a range
aa659c2
Unchecked vibe coding
hunhoffeOct 30, 2025
b993427
formatting and instructional notebook
hunhoffeOct 31, 2025
294dc8f
notebookt lit test
hunhoffeOct 31, 2025
dd36cc2
More progress, still not done yet
hunhoffeOct 31, 2025
3abf024
update tutorial notebook
hunhoffeOct 31, 2025
c75dcd9
updates
hunhoffeOct 31, 2025
b912d29
clean up test files a little
hunhoffeOct 31, 2025
b01e6ae
Merge branch 'main' into erika-vibe-coding
hunhoffeNov 3, 2025
32acce9
clean up notebook examples
hunhoffeNov 3, 2025
ad98410
stub out files
hunhoffeNov 3, 2025
e669755
clean up after refactor; lit tests working
hunhoffeNov 3, 2025
e2d86bc
fix some paths
hunhoffeNov 3, 2025
0664f7b
small things
hunhoffeNov 3, 2025
8e31804
Merge branch 'main' into erika-vibe-coding
hunhoffeNov 24, 2025
c80c394
Update python/iron/__init__.py
hunhoffeNov 24, 2025
7f73146
Update programming_examples/basic/jit_exploration/jit_tutorial.ipynb
hunhoffeNov 24, 2025
b398f74
Update programming_examples/basic/jit_exploration/jit_tutorial.ipynb
hunhoffeNov 24, 2025
706ee74
Merge branch 'main' into erika-vibe-coding
hunhoffeNov 24, 2025
9831054
cleanup changes
hunhoffeNov 24, 2025
af9ab87
python formatting
hunhoffeNov 24, 2025
d4a4844
Remove unncessary change
hunhoffeNov 24, 2025
0ecf5ae
remove old notebook
hunhoffeNov 24, 2025
eced9ab
Fixup unnecessary changes
hunhoffeNov 24, 2025
af3d6dd
remove old file
hunhoffeNov 24, 2025
a431da4
restore file
hunhoffeNov 24, 2025
bb07429
remove whitespace change
hunhoffeNov 24, 2025
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
PrevPrevious commit
NextNext commit
clean up test files a little
  • Loading branch information
@hunhoffe
hunhoffe committedOct 31, 2025
commitb912d29d639e52caffac03e1b992155cc592b84d
2 changes: 1 addition & 1 deletiontest/python/artifact_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@
import numpy as np
import os

from .test_utils import _vector_vector_add_impl
from .utils import _vector_vector_add_impl


@pytest.mark.parametrize("num_elements", [16, 64])
Expand Down
2 changes: 1 addition & 1 deletiontest/python/compile_ctx_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ def test_mlir_file_generator():


def test_function_generator():
from .test_utils import _vector_vector_add_impl
from .utils import _vector_vector_add_impl
import numpy as np

compilable = iron.compileconfig(mlir_generator=_vector_vector_add_impl)
Expand Down
2 changes: 1 addition & 1 deletiontest/python/jit_compilation.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@
import aie.iron as iron
import os

from .test_utils import _vector_vector_add_impl
from .utils import _vector_vector_add_impl


@iron.jit()
Expand Down
2 changes: 1 addition & 1 deletiontest/python/object_file_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@
import aie.iron as iron
import numpy as np

from .test_utils import _vector_vector_add_impl
from .utils import _vector_vector_add_impl


@pytest.mark.parametrize("num_elements", [16, 64])
Expand Down
2 changes: 1 addition & 1 deletiontest/python/precompiled_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@
import numpy as np
import os

from .test_utils import _vector_vector_add_impl
from .utils import _vector_vector_add_impl


@pytest.mark.parametrize("num_elements", [16, 64])
Expand Down
78 changes: 0 additions & 78 deletionstest/python/test_utils.py
View file
Open in desktop

This file was deleted.

65 changes: 65 additions & 0 deletionstest/python/util.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
import inspect
from aie.ir import Context, Location, Module, InsertionPoint
import numpy as np
import aie.iron as iron

from aie.iron import ObjectFifo, Program, Runtime, Worker
from aie.iron.placers import SequentialPlacer
from aie.iron.controlflow import range_


# Create and print ModuleOp.
Expand All@@ -19,3 +25,62 @@ def construct_and_print_module(f):
if module is not None:
assert module.operation.verify()
print(module)


def _vector_vector_add_impl(input0, input1, output):
if input0.shape != input1.shape:
raise ValueError(
f"Input shapes are not the equal ({input0.shape} != {input1.shape})."
)
if input0.shape != output.shape:
raise ValueError(
f"Input and output shapes are not the equal ({input0.shape} != {output.shape})."
)
if len(np.shape(input0)) != 1:
raise ValueError("Function only supports vectors.")
num_elements = np.size(input0)
n = 16
if num_elements % n != 0:
raise ValueError(
f"Number of elements ({num_elements}) must be a multiple of {n}."
)
N_div_n = num_elements // n

if input0.dtype != input1.dtype:
raise ValueError(
f"Input data types are not the same ({input0.dtype} != {input1.dtype})."
)
if input0.dtype != output.dtype:
raise ValueError(
f"Input and output data types are not the same ({input0.dtype} != {output.dtype})."
)
dtype = input0.dtype

tensor_ty = np.ndarray[(num_elements,), np.dtype[dtype]]
tile_ty = np.ndarray[(n,), np.dtype[dtype]]

of_in1 = ObjectFifo(tile_ty, name="in1")
of_in2 = ObjectFifo(tile_ty, name="in2")
of_out = ObjectFifo(tile_ty, name="out")

def core_body(of_in1, of_in2, of_out):
for _ in range_(N_div_n):
elem_in1 = of_in1.acquire(1)
elem_in2 = of_in2.acquire(1)
elem_out = of_out.acquire(1)
for i in range_(n):
elem_out[i] = elem_in1[i] + elem_in2[i]
of_in1.release(1)
of_in2.release(1)
of_out.release(1)

worker = Worker(core_body, fn_args=[of_in1.cons(), of_in2.cons(), of_out.prod()])

rt = Runtime()
with rt.sequence(tensor_ty, tensor_ty, tensor_ty) as (A, B, C):
rt.start(worker)
rt.fill(of_in1.prod(), A)
rt.fill(of_in2.prod(), B)
rt.drain(of_out.cons(), C, wait=True)

return Program(iron.get_current_device(), rt).resolve_program(SequentialPlacer())
Loading

[8]ページ先頭

©2009-2025 Movatter.jp