Skip to content
Draft
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
2 changes: 1 addition & 1 deletion programming_examples/algorithms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ my_kernel = ExternalFunction(

# Pass in full size tensors, algorithm will tile it to tile_size
# tile_size must be passed as a keyword argument
iron.jit(is_placed=False)(transform)(
iron.jit()(transform)(
my_kernel, input, output, factor, tile_size=TILE_SIZE
)
```
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/algorithms/for_each.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main():
initial_tensor = tensor.numpy().copy()

# JIT compile the algorithm
iron.jit(is_placed=False)(for_each)(lambda a: a + 1, tensor, tile_size=16)
iron.jit()(for_each)(lambda a: a + 1, tensor, tile_size=16)

# Check the correctness of the result
e = np.equal(initial_tensor + 1, tensor.numpy())
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/algorithms/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
output = iron.zeros_like(input)

# JIT compile the algorithm
iron.jit(is_placed=False)(transform)(lambda a: a + 1, input, output, tile_size=16)
iron.jit()(transform)(lambda a: a + 1, input, output, tile_size=16)

# Check the correctness of the result
e = np.equal(input.numpy() + 1, output.numpy())
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/algorithms/transform_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
output = iron.zeros_like(input0)

# JIT compile the algorithm
iron.jit(is_placed=False)(transform_binary)(
iron.jit()(transform_binary)(
lambda a, b: a + b, input0, input1, output, tile_size=16
)

Expand Down
4 changes: 1 addition & 3 deletions programming_examples/algorithms/transform_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def main():
output = iron.zeros_like(input)

# JIT compile the algorithm
iron.jit(is_placed=False)(transform_parallel)(
lambda a: a + 1, input, output, tile_size=16
)
iron.jit()(transform_parallel)(lambda a: a + 1, input, output, tile_size=16)

# Check the correctness of the result
e = np.equal(input.numpy() + 1, output.numpy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
output = iron.zeros_like(input0)

# JIT compile the algorithm
iron.jit(is_placed=False)(transform_parallel_binary)(
iron.jit()(transform_parallel_binary)(
lambda a, b: a + b, input0, input1, output, tile_size=16
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from aie.iron import ExternalFunction


@iron.jit(is_placed=False)
@iron.jit()
def my_reduce_min(input_tensor, output_tensor):

num_elements = input_tensor.numel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ def vector_scalar_mul(input, factor, output):
# Pass scale kernel to the transform algorithm
# tile_size is passed as keyword argument
# iron.jit compiles and runs the program
iron.jit(is_placed=False)(transform)(
scale_kernel, input, output, factor, tile_size=tile_size
)
iron.jit()(transform)(scale_kernel, input, output, factor, tile_size=tile_size)


def main():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from aie.iron.controlflow import range_


@iron.jit(is_placed=False)
@iron.jit()
def vector_vector_add(input0, input1, output):
if input0.shape != input1.shape:
raise ValueError(
Expand Down
3 changes: 1 addition & 2 deletions programming_examples/getting_started/00_memcpy/memcpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
# JIT decorator for IRON
# Decorator to compile an IRON kernel into a binary to run on the NPU.
# Parameters:
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
@iron.jit(is_placed=False)
@iron.jit()
def my_memcpy(input0, output):
# --------------------------------------------------------------------------
# Configuration
Expand Down
3 changes: 1 addition & 2 deletions programming_examples/getting_started/01_SAXPY/saxpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
# JIT decorator for IRON
# Decorator to compile an IRON kernel into a binary to run on the NPU.
# Parameters:
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
@iron.jit(is_placed=False)
@iron.jit()
def saxpy(input0, input1, output):
N = input0.shape[0] # Tensor size
element_type = output.dtype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
# JIT decorator for IRON
# Decorator to compile an IRON kernel into a binary to run on the NPU.
# Parameters:
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
@iron.jit(is_placed=False)
@iron.jit()
def vector_reduce_max(input0, output):
element_type = output.dtype

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
# JIT decorator for IRON
# Decorator to compile an IRON kernel into a binary to run on the NPU.
# Parameters:
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
@iron.jit(is_placed=False)
@iron.jit()
def matrix_multiplication_single_core(input0, input1, output):
# Problem size
# - matrix0 shapes: (M, K)
Expand Down
3 changes: 1 addition & 2 deletions programming_guide/mini_tutorial/aie2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
# JIT decorator for IRON
# Decorator to compile an IRON kernel into a binary to run on the NPU.
# Parameters:
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
@iron.jit(is_placed=False)
@iron.jit()
def aie2p(input0, output):
# Dataflow with ObjectFifos
# ObjectFifos represent a dataflow connection between endpoints in the AIE array.
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_1/answer_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_1(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_1/answer_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_1(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_1/answer_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_1(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_1/answer_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_1(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_1/exercise_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_1(output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_2/answer_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_2(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_2/answer_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_2(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_2/exercise_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_2(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_3/answer_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_3(input0, input1, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_3/exercise_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_3(input0, output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_4/answer_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_4(output):
data_size = output.numel()
element_type = output.dtype
Expand Down
2 changes: 1 addition & 1 deletion programming_guide/mini_tutorial/exercise_4/exercise_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_4(output):
data_size = output.numel()
element_type = output.dtype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_5a(input0, output):
# Define tile size
tile_height = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_5a(input0, output):
# Define tile size
tile_height = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_5a(input0, output):
data_size = input0.numel()
element_type = input0.dtype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import aie.iron as iron


@iron.jit(is_placed=False)
@iron.jit()
def exercise_5a(input0, output):
# Define tile size
tile_height = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
data_width = 16


@iron.jit(is_placed=False)
@iron.jit()
def exercise_5b(input0, output):
# Define tile size
tile_height = 3
Expand Down
Loading
Loading