You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This design implements a `bfloat16` based elementwise addition between two vectors, performed in parallel on two cores in a single column. Element-wise addition usually ends up being I/O bound due to the low compute intensity. In a practical ML implementation, it is an example of the type of kernel that is likely best fused onto another more compute-dense kernel (e.g., a convolution or GEMM). Please refer to [bottleneck](../bottleneck/) design on fusing element-wise addition with convolution for the skip addition.
13
+
This design implements a `bfloat16` based element-wise addtiplication between two vectors, performed in parallel on two cores in a single column. Element-wise addtiplication usually ends up being I/O bound due to the low compute intensity. In a practical ML implementation, it is an example of the type of kernel that is likely best fused onto another more compute-dense kernel (e.g., a convolution or GEMM).
14
14
15
15
16
16
## Source Files Overview
17
17
18
18
1.`eltwise_add.py`: A Python script that defines the AIE array structural design using MLIR-AIE operations. This generates MLIR that is then compiled using `aiecc.py` to produce design binaries (ie. XCLBIN and inst.bin for the NPU in Ryzen™ AI).
19
19
20
-
1.`eltwise_add_placed.py`: An alternative version of the design in `eltwise_add.py`, that is expressed in a lower-level version of IRON.
21
-
22
-
1.`add.cc`: A C++ implementation of a vectorized vector addition operation for AIE cores. The code uses the AIE API, which is a C++ header-only library providing types and operations that get translated into efficient low-level intrinsics, and whose documentation can be found [here](https://www.xilinx.com/htmldocs/xilinx2023_2/aiengine_api/aie_api/doc/index.html). The source can be found [here](../../../aie_kernels/aie2/add.cc).
20
+
1.`add.cc`: A C++ implementation of a vectorized vector addtiplication operation for AIE cores. The code uses the AIE API, which is a C++ header-only library providing types and operations that get translated into efficient low-level intrinsics, and whose documentation can be found [here](https://www.xilinx.com/htmldocs/xilinx2023_2/aiengine_api/aie_api/doc/index.html). The source can be found [here](../../../aie_kernels/aie2/add.cc).
23
21
24
22
1.`test.cpp`: This C++ code is a testbench for the design example. The code is responsible for loading the compiled XCLBIN file, configuring the AIE module, providing input data, and executing the AIE design on the NPU. After executing, the script verifies the memcpy results and optionally outputs trace data.
25
23
@@ -33,18 +31,7 @@ To compile the design and C++ testbench:
33
31
make
34
32
```
35
33
36
-
To compile for the placed design:
37
-
38
-
```shell
39
-
env use_placed=1 make
40
-
```
41
-
42
34
To run the design:
43
35
```shell
44
36
make run
45
37
```
46
-
47
-
To generate a [trace file](../../../programming_guide/section-4/section-4b/README.md):
0 commit comments