Skip to content

Commit a504a62

Browse files
authored
Revert "Revert #2957 -- Remove is_placed flag from JIT decorator" (#3004)
1 parent 20a36e6 commit a504a62

44 files changed

Lines changed: 167 additions & 126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

programming_examples/algorithms/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ my_kernel = ExternalFunction(
5959

6060
# Pass in full size tensors, algorithm will tile it to tile_size
6161
# tile_size must be passed as a keyword argument
62-
iron.jit(is_placed=False)(transform)(
62+
iron.jit(transform)(
6363
my_kernel, input, output, factor, tile_size=TILE_SIZE
6464
)
6565
```

programming_examples/algorithms/for_each.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def main():
3535
initial_tensor = tensor.numpy().copy()
3636

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

4040
# Check the correctness of the result
4141
e = np.equal(initial_tensor + 1, tensor.numpy())

programming_examples/algorithms/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def main():
3636
output = iron.zeros_like(input)
3737

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

4141
# Check the correctness of the result
4242
e = np.equal(input.numpy() + 1, output.numpy())

programming_examples/algorithms/transform_binary.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def main():
3636
output = iron.zeros_like(input0)
3737

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

4341
# Check the correctness of the result
4442
e = np.equal(input0.numpy() + input1.numpy(), output.numpy())

programming_examples/algorithms/transform_parallel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def main():
3636
output = iron.zeros_like(input)
3737

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

4341
# Check the correctness of the result
4442
e = np.equal(input.numpy() + 1, output.numpy())

programming_examples/algorithms/transform_parallel_binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def main():
3636
output = iron.zeros_like(input0)
3737

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

programming_examples/basic/vector_reduce_min/vector_reduce_min_jit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from aie.iron import ExternalFunction
1818

1919

20-
@iron.jit(is_placed=False)
20+
@iron.jit
2121
def my_reduce_min(input_tensor, output_tensor):
2222

2323
num_elements = input_tensor.numel()

programming_examples/basic/vector_scalar_mul/vector_scalar_mul_jit.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def vector_scalar_mul(input, factor, output):
6161
# Pass scale kernel to the transform algorithm
6262
# tile_size is passed as keyword argument
6363
# iron.jit compiles and runs the program
64-
iron.jit(is_placed=False)(transform)(
65-
scale_kernel, input, output, factor, tile_size=tile_size
66-
)
64+
iron.jit(transform)(scale_kernel, input, output, factor, tile_size=tile_size)
6765

6866

6967
def main():

programming_examples/basic/vector_vector_add/vector_vector_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from aie.iron.controlflow import range_
1818

1919

20-
@iron.jit(is_placed=False)
20+
@iron.jit
2121
def vector_vector_add(input0, input1, output):
2222
if input0.shape != input1.shape:
2323
raise ValueError(

programming_examples/getting_started/00_memcpy/memcpy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
# JIT decorator for IRON
2828
# Decorator to compile an IRON kernel into a binary to run on the NPU.
2929
# Parameters:
30-
# - is_placed (bool): Whether the kernel is using explicit or deferred placement API. Defaults to True.
3130
# - use_cache (bool): Use cached MLIR module if available. Defaults to True.
32-
@iron.jit(is_placed=False)
31+
@iron.jit
3332
def my_memcpy(input0, output):
3433
# --------------------------------------------------------------------------
3534
# Configuration

0 commit comments

Comments
 (0)