Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge asplos into main #1393

Merged
merged 213 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
0a5c94c
Vectorize vec scalar (#1115)
jackl-xilinx Mar 11, 2024
6e3c254
Keep pkt header (#1125)
jackl-xilinx Mar 13, 2024
d099562
Started writing the objfifo intro tutorial
abisca Mar 14, 2024
7c5f247
Vectorize vec scalar (#1135)
jackl-xilinx Mar 18, 2024
e09a096
Added new programming guide section placedholders
jackl-xilinx Mar 19, 2024
920b231
Added new programming guide section placedholders (#1138)
jackl-xilinx Mar 19, 2024
0059f07
[EXAMPLE] An element-wise add example (#1148)
jamesroxbypb Mar 23, 2024
bd03b7a
Merge branch 'asplos' of https://github.com/Xilinx/mlir-aie into asplos
abisca Mar 25, 2024
c5b0ac9
Moved objfifo design example 1 to programming_guide sections 3.
abisca Mar 25, 2024
9ed1289
Started objectFifo programming guide
abisca Mar 25, 2024
39a284d
Continue section 3 guide.
abisca Mar 26, 2024
3b140dc
ObjFifo guide: access patterns
abisca Mar 27, 2024
0232b42
Add example to objFifo guide
abisca Mar 27, 2024
6b61d28
Update objfifo guide
abisca Mar 28, 2024
169c273
[ASPLOS] Weight expand asplos (#1158)
jgmelber Apr 1, 2024
bd3994d
Separate section 3 of the guide into 3 subsections
abisca Apr 3, 2024
eef1dc8
Merge branch 'asplos' of https://github.com/Xilinx/mlir-aie into asplos
abisca Apr 3, 2024
489f208
Pjr vector exp (#1166)
jamesroxbypb Apr 4, 2024
2a7a1c4
Reorganize subsections in section 3 of the guide.
abisca Apr 4, 2024
86ed262
[SOFTMAX] Single column rapid test (#1168)
jamesroxbypb Apr 4, 2024
aef1490
[ASPLOS] merge main into asplos (#1170)
jgmelber Apr 4, 2024
1aec952
Updated sections 3a and 3b
abisca Apr 4, 2024
465e0c2
Merge branch 'asplos' of https://github.com/Xilinx/mlir-aie into asplos
abisca Apr 4, 2024
30d9392
Vector softmax (#1172)
jamesroxbypb Apr 4, 2024
80fa4d6
[MERGE] This has gone horribly wrong, so fixing up in place
Apr 4, 2024
c512714
Update exp.cc
jamesroxbypb Apr 4, 2024
70a660e
Merge branch 'asplos' into asplos
jackl-xilinx Apr 4, 2024
4da0b96
Added new programming guide section placedholders (#1174)
jackl-xilinx Apr 4, 2024
6d5dd05
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 4, 2024
5440238
Swapped section-2 and section-3
jackl-xilinx Apr 5, 2024
989c30b
Swapped section-2 and section-3 (#1177)
jackl-xilinx Apr 5, 2024
185b231
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 5, 2024
65c45e3
Updated section-1 and added design source examples to section-1 and s…
jackl-xilinx Apr 8, 2024
0e4fc7c
Update section-1 and section-3 examples (#1179)
jackl-xilinx Apr 8, 2024
96c9f00
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 8, 2024
0771f2a
Updated section-3
jackl-xilinx Apr 8, 2024
d1b4bc4
Update section-3 (#1181)
jackl-xilinx Apr 8, 2024
7ef35da
Reorganize tutorials and reference_designs to programming_examples
jackl-xilinx Apr 8, 2024
c9ee069
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 8, 2024
285eeb8
Update tutorials references
jackl-xilinx Apr 8, 2024
f7af8ac
Merge branch 'asplos' of https://github.com/jackl-xilinx/mlir-aie int…
jackl-xilinx Apr 8, 2024
d57be35
Update READMEs
jackl-xilinx Apr 8, 2024
1e50fda
Renamed core to basic
jackl-xilinx Apr 8, 2024
c2b6ee7
format fix
jackl-xilinx Apr 8, 2024
9c59dad
Reorganize tutorials and reference_designs to programming_examples (#…
jackl-xilinx Apr 8, 2024
8f57236
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 8, 2024
f5bce93
fix folder names (#1186)
denolf Apr 8, 2024
65e4000
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 8, 2024
dc2f038
Fix for mmult lit (#1187)
denolf Apr 8, 2024
673be6b
Revert "Fix for mmult lit" (#1188)
denolf Apr 8, 2024
9acb57e
[ASPLOS][WIP] python host code example (#1185)
fifield Apr 8, 2024
659d83c
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 8, 2024
e867d84
Extracted arg parse from test.py
jackl-xilinx Apr 8, 2024
5af9914
Extract arg parse from test.py (#1192)
jackl-xilinx Apr 8, 2024
d8edc08
Add finished write-up for sections 2a and 2b
abisca Apr 9, 2024
00580c8
Add objectfifo bindings to quick references
abisca Apr 9, 2024
81dd148
Update section2 subsection list
abisca Apr 9, 2024
0bdb4b4
Remove redundant script.
jackl-xilinx Apr 9, 2024
954d939
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 9, 2024
dbb6e5a
Merge branch 'asplos' of https://github.com/jackl-xilinx/mlir-aie int…
jackl-xilinx Apr 9, 2024
46d0bbf
Remove unsign.sh shell script (#1194)
jackl-xilinx Apr 9, 2024
3503e53
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 9, 2024
af95d51
[ASPLOS][WIP] initial version of asplos24 tutorial description (#1184)
denolf Apr 9, 2024
d1d818b
Fix for lit tests (#1189)
denolf Apr 9, 2024
c0c1aee
Rename tutorials folder (#1190) (#1197)
fifield Apr 9, 2024
a9a71b4
[ASPLOS] Rename directories (#1196)
jgmelber Apr 9, 2024
b9e34ab
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 9, 2024
54440e1
Add section 2c. Update tiles in sections 2a and 2b.
abisca Apr 10, 2024
6ac2d90
Merge branch 'Xilinx:asplos' into asplos
jackl-xilinx Apr 10, 2024
48a8dfb
Add generic aie array description paragraph (#1191)
denolf Apr 10, 2024
ae8eca5
Extracted more helper functions into test_utils
jackl-xilinx Apr 10, 2024
e3b7ac7
Update run.lit to test_utils
jackl-xilinx Apr 10, 2024
10d97b2
Fixed run.lit type-o
jackl-xilinx Apr 10, 2024
2329487
[E^X] E^X in the ASPLOS style (#1203)
jamesroxbypb Apr 10, 2024
f39e827
ReLU with tracing (#1204)
jamesroxbypb Apr 10, 2024
121858c
Ml eltwise add and mul (#1207)
jamesroxbypb Apr 10, 2024
3de9633
Moved test_lib to runtime_lib/test_lib for now
jackl-xilinx Apr 11, 2024
7278621
Fix merge conflict
jackl-xilinx Apr 11, 2024
8dac5bf
Merge branch 'jackl-xilinx-asplos' into asplos
jackl-xilinx Apr 11, 2024
4d27d72
Pjr reduce (#1222) Reduce programming examples
jamesroxbypb Apr 11, 2024
73440d7
[ASPLOS][WIP] Passthrough kernel in basic examples (#1216)
denolf Apr 11, 2024
1d33854
fix paths run.lit passthrough _kernel (#1225)
denolf Apr 11, 2024
eddefed
Fixed CMakeLists.txt reference to test_utils.h (#1223)
jackl-xilinx Apr 12, 2024
baf6a03
Minor CMakeLists.txt and Makefile fixes for programming_examples (#1227)
jackl-xilinx Apr 12, 2024
9cdaa40
Fix run lit kristof (#1235)
denolf Apr 12, 2024
dd7edbf
Make test_utils.h usable without c++23 (#1244)
fifield Apr 15, 2024
17575bd
[asplos] add missing random_int funcs, clang-format (#1246)
fifield Apr 15, 2024
03e631b
Adding build mlir-ae from llvm mlir wheel. (#1247)
jackl-xilinx Apr 15, 2024
5964449
Fix error with finding XRT (same fix as in main) (#1249)
jackl-xilinx Apr 15, 2024
208c6ba
remove test (#1250)
fifield Apr 15, 2024
e507f6e
Fix add reduce (#1240)
denolf Apr 15, 2024
2e35ea8
[ASPLOS] rename aie_generic to generic and clean up (#1251)
denolf Apr 16, 2024
dc21637
Add note in the quick references (#1231)
AndraBisca Apr 16, 2024
1dfbc7b
[ASPLOS] reduce_max: rename and clean up (#1253)
denolf Apr 16, 2024
5ca9660
Pjr move designs (#1233)
jamesroxbypb Apr 16, 2024
6da1075
Fix reduce min (#1263)
denolf Apr 16, 2024
7b31107
[LIT] Lit test (#1252)
jamesroxbypb Apr 16, 2024
ec004a0
Finish section 2c (#1221)
AndraBisca Apr 16, 2024
ab2475a
Moved test_utils.py to utils/test.py (#1267)
jackl-xilinx Apr 16, 2024
b536222
Asplos section2d (#1228)
AndraBisca Apr 16, 2024
5304be5
[ASPLOS] Relu and Softmax fixes and clean up (#1266)
denolf Apr 16, 2024
e4c2a24
[ASPLOS] Fix vision examples (#1269)
denolf Apr 16, 2024
4e5bcbd
[asplos] update run_on_ipu (#1271)
fifield Apr 16, 2024
3238748
[ASPLOS] Passthrough Kernel README and test.py (#1262)
jgmelber Apr 17, 2024
9ad4e79
[ASPLOS] bring back run_on_ipu (#1272)
denolf Apr 17, 2024
0041c62
[asplos] fix run.lit for testing both exe and py (#1275)
denolf Apr 17, 2024
0a20141
[ASPLOS] Reorganize directories for consistency (#1278)
jgmelber Apr 17, 2024
8f1ef2d
Deleted redundant passthrough (#1279)
jgmelber Apr 17, 2024
e0aa815
[asplos][wip] Update section-1 programming guide (#1277)
denolf Apr 17, 2024
01b6751
Pjr ex docs (#1282)
jamesroxbypb Apr 17, 2024
a1fa6d7
Pjr ml eltwise (#1283)
jamesroxbypb Apr 17, 2024
ed98a49
[DOC] Softmax document (#1285)
jamesroxbypb Apr 17, 2024
e73b67a
[DOC] A softmax doc (#1290)
jamesroxbypb Apr 17, 2024
ad51d30
Fixed trace for vector_scalar_mul and added trace placeholders for se…
jackl-xilinx Apr 18, 2024
9e1988b
[DOCS] Minor typo fixes and a new ReLU doc (#1287)
jamesroxbypb Apr 18, 2024
b5ff1d9
[ELTWISE] Add stdfloat header (#1292)
jamesroxbypb Apr 18, 2024
ba7f0e5
[asplos] Passthrough dmas doc (#1296)
AndraBisca Apr 18, 2024
23e0415
[ASPLOS] Update wheels (#1298)
jgmelber Apr 18, 2024
0550a07
ResNet with Offloaded Conv2_x Bottleneck Blocks (#1299)
singagan Apr 18, 2024
90daf97
Bottleneck with Fused ReLU+BatchNorm (#1303)
singagan Apr 18, 2024
bb0d22d
Convolution 2D with Int8 (#1304)
singagan Apr 18, 2024
49b370a
Convolution 2D with Fused ReLU (#1306)
singagan Apr 18, 2024
fef1223
[DOC] Section 5 (#1307)
jamesroxbypb Apr 18, 2024
dcfa0ee
[ASPLOS] Section 2 on Runtime DMAs (#1308)
jgmelber Apr 18, 2024
b93d0ac
[asplos] Vec scal mul update (#1300)
denolf Apr 18, 2024
c84a1e9
[CPU] CPU Torch to cut down size and install time (#1309)
jamesroxbypb Apr 19, 2024
4f60340
[ASPLOS][WIP] New and improved READMEs (#1284)
jgmelber Apr 19, 2024
4b9250a
[MAKEFILE] Get rid of INSTALL_ROOT, and just use file structure (#1302)
jamesroxbypb Apr 19, 2024
4a6f531
Added section-4a/4b text and added to ease-of-use for vector_scalar_m…
jackl-xilinx Apr 19, 2024
28a76cc
[asplos] Section2e (#1295)
AndraBisca Apr 19, 2024
bcc5d5e
[asplos] Section2 fixes and restructure of 2b (#1313)
AndraBisca Apr 19, 2024
5e72354
[asplos] reformat quick reference (#1321)
denolf Apr 19, 2024
ec0aea2
Clean up other tracing examples (#1276)
stephenneuendorffer Apr 19, 2024
79a9c9a
[ASPLOS] Getting started section 0 (#1311)
jgmelber Apr 19, 2024
4bb705e
[asplos] Section-2f (#1324)
AndraBisca Apr 19, 2024
aa4ca5d
[asplos] Reformat quick ref guide (#1326)
denolf Apr 19, 2024
998e043
[ASPLOS][WIP] Update section-3 readmes (#1329)
jackl-xilinx Apr 19, 2024
775dbb6
[ASPLOS] Section 5 Improvements (#1328)
jgmelber Apr 19, 2024
04f84fc
Complete reference guide (#1330)
AndraBisca Apr 19, 2024
0b3e68a
[ASPLOS] Wording fixes for section-4 (#1331)
jackl-xilinx Apr 19, 2024
d3d9ed3
[ASPLOS] Section 6: Explain bottleneck and resnet (#1332)
jgmelber Apr 19, 2024
9c57da3
[ASPLOS] Fixes and navigation (#1334)
jgmelber Apr 19, 2024
2453746
Section2 navigation links (#1333)
AndraBisca Apr 19, 2024
6d5e791
[asplos][WIP] Programming Guide Section 3 (#1288)
denolf Apr 19, 2024
651ed4f
Update quick_reference.md (#1336)
jgmelber Apr 19, 2024
d752461
quick_reference.md typo (#1337)
jgmelber Apr 19, 2024
f0c2bc3
[asplos] Size as parameter (#1335)
denolf Apr 19, 2024
cfa808b
[asplos] section 3 PG: add host section (#1340)
denolf Apr 20, 2024
b060bce
[asplos] Update README.md section 3 (#1341)
denolf Apr 20, 2024
f94082b
[asplos] PG intro minor fixes (#1342)
denolf Apr 20, 2024
dd806a1
[asplos] PG section-5 update (#1343)
denolf Apr 20, 2024
014eefe
Update README.md (#1346)
jamesroxbypb Apr 20, 2024
51bf2c8
[asplos] add link to top level PG for AIE-array figure (#1347)
denolf Apr 20, 2024
0084f70
[asplos] add arch doc links (#1348)
denolf Apr 20, 2024
0c00f10
[asplos] Simplify section 1 PG (#1344)
denolf Apr 20, 2024
c7c4e71
[asplos][vector_scalar_mul] fix run.lit (#1350)
denolf Apr 20, 2024
486d485
[asplos][PG section 3] and extra note (#1359)
denolf Apr 20, 2024
b2f2d91
[asplos][PG section 4b] fix typos (#1360)
denolf Apr 20, 2024
d0f479d
[ASPLOS] Fix vector scalar mul (#1352)
jgmelber Apr 20, 2024
cb638d4
[ASPLOS] Update Vector Scalar Image (#1361)
jgmelber Apr 21, 2024
145f6e7
Update README.md (#1364)
denolf Apr 21, 2024
8460af6
[asplos][PG section 4.b] minor fixes (#1362)
denolf Apr 21, 2024
c375ad7
[asplos][PG section 6] minor change (#1365)
denolf Apr 21, 2024
338d4af
[ASPLOS] Fixed section-4 type-o's (#1366)
jackl-xilinx Apr 21, 2024
83524d9
[asplos][vector_scalar_mul] remove unused debug lines (#1363)
denolf Apr 21, 2024
07725b4
[asplos] PG section 2.b.1: remove not needed for loop (#1349)
denolf Apr 21, 2024
3cfe709
[asplos][PG section 2.c] minor fixes (#1353)
denolf Apr 21, 2024
1fe0fdf
[asplos][PG section 2.2d] (#1354)
denolf Apr 21, 2024
746ef46
[asplos][PG section 2.e.2] add code segment (#1355)
denolf Apr 21, 2024
ccd366d
[asplos][PG section 2.e.3] add code sample (#1356)
denolf Apr 21, 2024
c180e1c
[asplos][PG section 2.e.4] add code sample (#1357)
denolf Apr 21, 2024
9e99a00
[asplos][PG section 2.e..5] add code sample (#1358)
denolf Apr 21, 2024
3907c38
Pjr ML examples cleanup (#1338)
jamesroxbypb Apr 21, 2024
def0de4
[ASPLOS] Update top-level README IRON (#1345)
jgmelber Apr 22, 2024
702817c
Resnet with python binding (#1368)
singagan Apr 22, 2024
0bb9ace
Update asplos24TutorialDescription.md (#1372)
jamesroxbypb Apr 22, 2024
d326765
[ASPLOS] Updated Makefile VPATH and quick_reference.md (#1373)
jackl-xilinx Apr 22, 2024
0a0ff6c
[ASPLOS] Tutorial Schedule (#1374)
jgmelber Apr 22, 2024
e3dfb7f
Pjr kernel readme (#1369)
jamesroxbypb Apr 22, 2024
543dfe9
[PYTHON] Move context to new format (#1375)
jamesroxbypb Apr 23, 2024
0b279aa
Add torch to lit cfg for programming_examples (#1370) (#1377)
jgmelber Apr 23, 2024
0092ed3
Remove failing log test (#1380)
jgmelber Apr 23, 2024
c56dd20
[asplos] don't run resnet test (#1378)
fifield Apr 23, 2024
ac905c3
[asplos][PG section 2.b2] fix def skip connection (#1351)
denolf Apr 23, 2024
62ce988
Section2.b.2 : depth as an array and DMAs (#1385)
AndraBisca Apr 23, 2024
44d5289
[asplos][programming guide] fix broken link (#1388)
denolf Apr 23, 2024
39b38bb
fix makefiles (#1384)
denolf Apr 23, 2024
d8e96a6
Consistency edits to vision examples (#1389)
efurst Apr 23, 2024
8a81023
Resolved most merge conflicts with main
abisca Apr 24, 2024
d647f94
More merge fixes
abisca Apr 24, 2024
5a4edaa
Fixed last conflicts
abisca Apr 24, 2024
2d3a6f5
Update programming_guide/section-3/vector_scalar_mul.cc
AndraBisca Apr 24, 2024
9af73f5
Update aie_kernels/aie2/conv2dk1_i8.cc
AndraBisca Apr 24, 2024
435d2b0
Update programming_examples/basic/matrix_multiplication/single_core/a…
AndraBisca Apr 24, 2024
608f1d4
Apply format fixes
abisca Apr 24, 2024
fbaff8e
Merge branch 'merge-asplos-main' of https://github.com/Xilinx/mlir-ai…
abisca Apr 24, 2024
04c3dd4
[asplos][vector_scalar_mul] Fix makefile (#1394)
denolf Apr 24, 2024
305eb5a
Update python/utils/trace.py
AndraBisca Apr 24, 2024
e30aa5b
fixups (#1395)
fifield Apr 24, 2024
1e13a60
Typos and Clarifications to ASPLOS Tutorial (#1390)
andrej Apr 24, 2024
9fc6fe4
Merge branch 'asplos' of https://github.com/Xilinx/mlir-aie into merg…
abisca Apr 24, 2024
a2de3c0
Remove redundant files
abisca Apr 24, 2024
bf1647d
Add back deleted file
abisca Apr 24, 2024
53bc083
Remove file
abisca Apr 24, 2024
3716661
fixups 2 (#1396)
fifield Apr 24, 2024
a4494d1
Merge branch 'merge-asplos-main' of https://github.com/Xilinx/mlir-ai…
abisca Apr 24, 2024
bc33fce
[ASPLOS] Major update to section-4, especially 4c (#1392)
jackl-xilinx Apr 24, 2024
147a949
Fixed conflicts with asplos
abisca Apr 24, 2024
329df67
Merge branch 'main' of https://github.com/Xilinx/mlir-aie into merge-…
abisca Apr 24, 2024
2cd4290
2-D Array Transpose Using ObjectFifo (#1386)
HashimSharifAMD Apr 24, 2024
b199f75
Merge branch 'asplos' of https://github.com/Xilinx/mlir-aie into merg…
abisca Apr 24, 2024
456b50a
Fix wrong git merge
abisca Apr 24, 2024
3cb9e58
Remove leftover ipu mentions
abisca Apr 24, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/cmakeModules*
.vscode
__pycache__
.DS_Store

/platforms/vck190_bare/petalinux/build
/platforms/vck190_bare/petalinux/components
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

This repository contains an [MLIR-based](https://mlir.llvm.org/) toolchain for AI Engine-enabled devices, such as [AMD Ryzen™ AI](https://www.amd.com/en/products/ryzen-ai) and [Versal™](https://www.xilinx.com/products/technology/ai-engine.html). This repository can be used to generate low-level configurations for the AI Engine portion of these devices. AI Engines are organized as a spatial array of tiles, where each tile contains AI Engine cores and/or memories. The spatial array is connected by stream switches that can be configured to route data between AI Engine tiles scheduled by their programmable Data Movement Accelerators (DMAs). This repository contains MLIR representations, with multiple levels of abstraction, to target AI Engine devices. This enables compilers and developers to program AI Engine cores, as well as describe data movements and array connectivity. A Python API is made available as a convenient interface for generating MLIR design descriptions. Backend code generation is also included, targeting the [aie-rt](https://github.com/Xilinx/aie-rt/tree/main-aie) library. This toolchain uses the AI Engine compiler tool which is part of the AMD Vitis™ software installation: these tools require a free license for use from the [Product Licensing Site](https://www.xilinx.com/member/forms/license-form.html).

This project is primarily intended to support the open-source community, particularly tool builders, with low-level access to AIE devices and enable the development of a wide variety of programming models from higher level abstractions. As such, although it contains some examples, this project is not intended to represent an end-to-end compilation flow for application design. If you're looking for an out-of-the-box experience for highly efficient machine learning, check out the [AMD Ryzen™ AI Software Platform](https://github.com/amd/RyzenAI-SW/).
This project is primarily intended to support the open-source community, particularly tool builders, with low-level access to AIE devices and enable the development of a wide variety of programming models from higher level abstractions. We provide an example programming flow: Interface Representation for hands-ON (IRON) close-to-metal programming of the AIE-array. IRON is an open access toolkit enabling performance engineers to build fast and efficient, often specialized designs through a set of Python language bindings around the mlir-aie dialect. As such, it contains some examples, however this project is not intended to represent an end-to-end compilation flow for all application designs. If you're looking for an out-of-the-box experience for highly efficient machine learning, check out the [AMD Ryzen™ AI Software Platform](https://github.com/amd/RyzenAI-SW/).

[Getting Started on a Versal™ board](docs/Building.md)

Expand All @@ -24,8 +24,10 @@ This project is primarily intended to support the open-source community, particu

[Getting Started and Running on Linux Ryzen™ AI](docs/buildHostLin.md)

[Full Documentation](https://xilinx.github.io/mlir-aie/)
[IRON AIE Application Programming Guide](programming_guide)

[MLIR Dialect and Compiler Documentation](https://xilinx.github.io/mlir-aie/)

-----

<p align="center">Copyright&copy; 2019-2023 Advanced Micro Devices, Inc</p>
<p align="center">Copyright&copy; 2019-2024 Advanced Micro Devices, Inc</p>
52 changes: 44 additions & 8 deletions aie_kernels/aie2/scale.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <aie_api/aie.hpp>

// Scalar scale template
template <typename T>
void scale_scalar(T *a, T *c, T factor, const int32_t N) {
event0();
Expand All @@ -24,35 +25,70 @@ void scale_scalar(T *a, T *c, T factor, const int32_t N) {
event1();
}

// Vectorized scale template
// Assume N is multiple of 16
template <typename T>
void scale_vectorized(T *a, T *c, T factor, const int32_t N) {
constexpr int vec_factor = 16;
void scale_vectorized(T *a, T *c, int32_t factor, const int32_t N) {
event0();
constexpr int vec_factor = 32;
T *__restrict pA1 = a;
T *__restrict pC1 = c;
const int F = N / vec_factor;
T fac = factor;
for (int i = 0; i < F; i++)
chess_prepare_for_pipelining chess_loop_range(16, ) {
aie::vector<T, vec_factor> A0 = aie::load_v<vec_factor>(pA1);
pA1 += vec_factor;
aie::accum<acc32, vec_factor> cout = aie::mul(A0, fac);
aie::store_v(pC1, cout.template to_vector<T>(0));
pC1 += vec_factor;
}
event1();
}

// Vectorized scale tempalte for int32_t (acc64 used)
// Assume N is multiple of 16
template <>
void scale_vectorized<int32_t>(int32_t *a, int32_t *c, int32_t factor,
const int32_t N) {
event0();
constexpr int vec_factor = 32;
int32_t *__restrict pA1 = a;
int32_t *__restrict pC1 = c;
const int F = N / vec_factor;
for (int i = 0; i < F; i++)
chess_prepare_for_pipelining chess_loop_range(16, ) {
aie::vector<int32_t, vec_factor> A0 = aie::load_v<vec_factor>(pA1);
pA1 += vec_factor;
aie::accum<acc64, vec_factor> cout = aie::mul(A0, factor);
aie::store_v(pC1, cout.to_vector<T>(0));
aie::store_v(pC1, cout.template to_vector<int32_t>(0));
pC1 += vec_factor;
}
event1();
}

extern "C" {

void vector_scalar_mul_aie(int32_t *a_in, int32_t *c_out, int32_t *factor,
int32_t N) {
// 16-bit datatype
void vector_scalar_mul_int32_scalar(int32_t *a_in, int32_t *c_out,
int32_t *factor, int32_t N) {
scale_scalar<int32_t>(a_in, c_out, *factor, N);
}

void vector_scalar_mul_int32_vector(int32_t *a_in, int32_t *c_out,
int32_t *factor, int32_t N) {
scale_vectorized<int32_t>(a_in, c_out, *factor, N);
}

void vector_scalar_mul_aie_scalar(int32_t *a_in, int32_t *c_out,
int32_t *factor, int32_t N) {
scale_scalar<int32_t>(a_in, c_out, *factor, N);
// 32-bit datatype
void vector_scalar_mul_int16_scalar(int16_t *a_in, int16_t *c_out,
int32_t *factor, int32_t N) {
scale_scalar<int16_t>(a_in, c_out, *factor, N);
}

void vector_scalar_mul_int16_vector(int16_t *a_in, int16_t *c_out,
int32_t *factor, int32_t N) {
scale_vectorized<int16_t>(a_in, c_out, *factor, N);
}

} // extern "C"
45 changes: 32 additions & 13 deletions docs/buildHostLin.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
# Linux Setup and Build Instructions

These instructions will guide you through everything required for building and executing a program on the Ryzen AI NPU, starting from a fresh bare-bones **Ubuntu 22.04 LTS** install. Only Ubuntu 22.04 LTS is supported. The instructions were tested on a ASUS Vivobook Pro 15.
These instructions will guide you through everything required for building and executing a program on the Ryzen™ AI NPU, starting from a fresh bare-bones **Ubuntu 22.04 LTS** install. Only Ubuntu 22.04 LTS is supported.

## Initial Setup

#### Update BIOS:

Be sure you have the latest BIOS for your laptop or mini PC, this will ensure the NPU (sometimes referred to as IPU) is enabled in the system. You may need to manually enable the NPU:
:
```Advanced → CPU Configuration → IPU```

> **NOTE:** Some manufacturers only provide Windows executables to update the BIOS, please do this before installing Ubuntu.

#### BIOS Settings:
1. Turn off SecureBoot (Allows for unsigned drivers to be installed)

```BIOS → Security → Secure boot → Disable```

1. Turn Ac Power Loss to "Always On" (Can be used for PDU reset, turns computer back on after power loss)

```BIOS → Advanced → AMD CBS → FCH Common Options → Ac Power Loss Options → Set Ac Power Loss to "Always On"```

## Overview
You will...

1. Install a driver for the Ryzen AI. As part of this, you will need to...
1. Install a driver for the Ryzen AI. As part of this, you will need to...

1. [...compile and install a more recent Linux kernel.](#update-linux)

Expand All @@ -15,7 +34,7 @@ You will...

1. [...install Xilinx Vitis and obtain a license.](#install-xilinx-vitis-20232-and-other-mlir-aie-prerequisites)

1. ...install MLIR-AIE [from precompiled binaries (fast)](#option-a---quick-setup-for-ryzen-ai-application-development) or [from source (slow)](#option-b---build-mlir-aie-tools-from-source-for-development).
1. ...install mlir-aie [from precompiled binaries (fast)](#option-a---quick-setup-for-ryzen-ai-application-development) or [from source (slow)](#option-b---build-mlir-aie-tools-from-source-for-development).

1. Build and execute one of the example designs. This consists of...

Expand All @@ -25,7 +44,7 @@ You will...

3. [...building and executing host (x86) code and device (NPU) code.](#build-and-run-host-part)

> Be advised that two of the steps (Linux compilation and Vitis install) may take hours. If you decide to build MLIR-AIE from source, this will also take a long time as it contains an LLVM build. Allocate enough time and patience. Once done, you will have an amazing toolchain allowing you to harness this great hardware at your hands.
> Be advised that two of the steps (Linux compilation and Vitis install) may take hours. If you decide to build mlir-aie from source, this will also take a long time as it contains an LLVM build. Allocate enough time and patience. Once done, you will have an amazing toolchain allowing you to harness this great hardware at your hands.

## Prerequisites

Expand Down Expand Up @@ -203,7 +222,7 @@ You will...
> [0000:66:00.1] : RyzenAI-Phoenix
> ```

### Install Xilinx Vitis 2023.2 and Other MLIR-AIE Prerequisites
### Install Xilinx Vitis 2023.2 and Other mlir-aie Prerequisites

1. Install Vitis under from [Xilinx Downloads](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vitis.html). You will need to run the installer as root. We will assume you use the default installation directory, `/tools/Xilinx`.

Expand All @@ -225,17 +244,17 @@ You will...
export LM_LICENSE_FILE=/opt/Xilinx.lic
```

1. Install the following packages needed for building MLIR-AIE:
1. Install the following packages needed for building mlir-aie:
```
sudo apt install \
build-essential clang clang-14 lld lld-14 cmake python3-venv python3-pip libxrender1 libxtst6 libxi6
```

1. Choose *one* of the two options (A or B) below for installing MLIR-AIE.
1. Choose *one* of the two options (A or B) below for installing mlir-aie.

### Option A - Quick Setup for Ryzen AI Application Development
### Option A - Quick Setup for Ryzen AI Application Development

1. Clone [the MLIR-AIE repository](https://github.com/Xilinx/mlir-aie.git), best under /home/username for speed (yourPathToBuildMLIR-AIE):
1. Clone [the mlir-aie repository](https://github.com/Xilinx/mlir-aie.git), best under /home/username for speed (yourPathToBuildMLIR-AIE):
```
git clone https://github.com/Xilinx/mlir-aie.git
cd mlir-aie
Expand All @@ -246,7 +265,7 @@ You will...

1. Jump ahead to [Build Device AIE Part](#build-device-aie-part) step 2 below.

### Option B - Build MLIR-AIE Tools from Source for Development
### Option B - Build mlir-aie Tools from Source for Development

1. Clone [https://github.com/Xilinx/mlir-aie.git](https://github.com/Xilinx/mlir-aie.git) best under /home/username for speed (yourPathToBuildMLIR-AIE), with submodules:
```
Expand Down Expand Up @@ -275,7 +294,7 @@ source ${MLIR_AIE_BUILD_DIR}/ironenv/bin/activate
source ${MLIR_AIE_BUILD_DIR}/utils/env_setup.sh ${MLIR_AIE_BUILD_DIR}/my_install/mlir_aie ${MLIR_AIE_BUILD_DIR}/my_install/mlir
```

> Replace `${MLIR_AIE_BUILD_DIR}` with the directory in which you *built* MLIR-AIE above. Replace `${NEW_CMAKE_DIR}` with the directory in which you installed CMake 3.28 above. Instead of search and replace, you can also define these values as environment variables.
> Replace `${MLIR_AIE_BUILD_DIR}` with the directory in which you *built* mlir-aie above. Replace `${NEW_CMAKE_DIR}` with the directory in which you installed CMake 3.28 above. Instead of search and replace, you can also define these values as environment variables.

> For quick setup, this step is only needed if you are starting with a new terminal. If you are continuing in the same terminal you used to install the prerequisites, the environment variables should all be set.

Expand All @@ -289,15 +308,15 @@ source /opt/xilinx/xrt/setup.sh
source ${MLIR_AIE_BUILD_DIR}/utils/env_setup.sh ${MLIR_AIE_BUILD_DIR}/install ${MLIR_AIE_BUILD_DIR}/llvm/install
```

> Replace `${MLIR_AIE_BUILD_DIR}` with the directory in which you *built* MLIR-AIE above. Instead of search and replace, you can also define `MLIR_AIE_BUILD_DIR` as an environment variable.
> Replace `${MLIR_AIE_BUILD_DIR}` with the directory in which you *built* mlir-aie above. Instead of search and replace, you can also define `MLIR_AIE_BUILD_DIR` as an environment variable.

## Build a Design

For your design of interest, for instance [vector_add](../programming_examples/basic/vector_add/), 2 steps are needed: (i) build the AIE desgin and then (ii) build the host code.

### Build Device AIE Part

1. Prepare your enviroment with the MLIR-AIE tools (built during prerequisites part of this guide) - see **"Setting Up Your Environment"** avove.
1. Prepare your enviroment with the mlir-aie tools (built during prerequisites part of this guide) - see **"Setting Up Your Environment"** avove.

2. Goto the design of interest and run `make`

Expand Down
34 changes: 27 additions & 7 deletions docs/buildHostWin.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
# Windows Setup and Build Instructions

These instructions will guide you through everything required for building and executing a program on the Ryzen AI NPU on Windows. The instructions were tested on a ASUS Vivobook Pro 15.
These instructions will guide you through everything required for building and executing a program on the Ryzen AI NPU on Windows. The instructions were tested on a ASUS Vivobook Pro 15.

You will set up a Windows subsystem for Linux (WSL) Ubuntu install, which will be used for building NPU device code. For building the host (x86) code, you will use MS Visual Code Community.

- Rely on WSL Ubuntu 22.04 LTS for Vitis tool install and to build and run our MLIR-AIE tools
- Rely on WSL Ubuntu 22.04 LTS for Vitis tool install and to build and run our mlir-aie tools
- Rely on MS Visual Studio 17 2022 to natively build the host code (aka test.cpp)

## Initial Setup

#### Update BIOS:

Be sure you have the latest BIOS for your laptop or mini PC, this will ensure the NPU (sometimes referred to as IPU) is enabled in the system. You may need to manually enable the NPU:

```Advanced → CPU Configuration → IPU```

> **NOTE:** Some manufacturers only provide Windows executables to update the BIOS.

#### BIOS Settings:
1. Turn off SecureBoot (Allows for unsigned drivers to be installed)

```BIOS → Security → Secure boot → Disable```

1. Turn Ac Power Loss to "Always On" (Can be used for PDU reset, turns computer back on after power loss)

```BIOS → Advanced → AMD CBS → FCH Common Options → Ac Power Loss Options → Set Ac Power Loss to "Always On"```


## Prerequisites
### MLIR-AIE tools: WSL Ubuntu 22.04
### mlir-aie tools: WSL Ubuntu 22.04
All steps in WSL Ubuntu terminal.
1. Clone [https://github.com/Xilinx/mlir-aie.git](https://github.com/Xilinx/mlir-aie.git) best under /home/username for speed (yourPathToBuildMLIR-AIE), with submodules:
```
Expand Down Expand Up @@ -44,7 +64,7 @@ All steps in WSL Ubuntu terminal.
ip link set vmnic0 addr <yourMACaddress>
```

1. Install or Build MLIR-AIE tools under WSL2:
1. Install or Build mlir-aie tools under WSL2:

* Use quick setup script to install from whls:
```
Expand All @@ -56,7 +76,7 @@ All steps in WSL Ubuntu terminal.

* [Optional] Build from source following regular get started instructions [https://xilinx.github.io/mlir-aie/Building.html](https://xilinx.github.io/mlir-aie/Building.html)

1. After installing the updated RyzenAI driver (see next subsection), use the gendef tool (from the mingw-w64-tools package) to create a .def file with the symbols:
1. After installing the updated Ryzen™ AI driver (see next subsection), use the gendef tool (from the mingw-w64-tools package) to create a .def file with the symbols:
```
mkdir /mnt/c/Technical/xrtNPUfromDLL; cd /mnt/c/Technical/xrtNPUfromDLL
cp /mnt/c/Windows/System32/AMD/xrt_coreutil.dll .
Expand All @@ -83,15 +103,15 @@ All steps in Win11 (powershell where needed).
```
lib /def:xrt_coreutil.def /machine:x64 /out:xrt_coreutil.lib
```
1. Clone [https://github.com/Xilinx/mlir-aie.git]([https://gitenterprise.xilinx.com/XRLabs/pynqMLIR-AIE](https://github.com/Xilinx/mlir-aie.git)) for instance under C:\Technical to be used to build designs (yourPathToDesignsWithMLIR-AIE)
1. Clone [https://github.com/Xilinx/mlir-aie.git](https://github.com/Xilinx/mlir-aie.git) for instance under C:\Technical to be used to build designs (yourPathToDesignsWithMLIR-AIE)

## Set up your environment

To make the compilation toolchain available for use in your WSL terminal, you will need to set some environment variables. We suggest you add the following to a file named `setup.sh`, so you can set up your environment easily by running `source setup.sh`.

### `setup.sh` - Option A - Using Quick Setup

If you used the quick setup script (precompiled MLIR-AIE binaries), use this setup script.
If you used the quick setup script (precompiled mlir-aie binaries), use this setup script.

```
# NOTE: if you did NOT exit the terminal you can skip this step.
Expand Down
Loading
Loading