-
Notifications
You must be signed in to change notification settings - Fork 85
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
Ryzen AI Examples #757
Ryzen AI Examples #757
Conversation
from aie.dialects.func import * | ||
from aie.dialects.scf import * | ||
from aie.dialects.aie import * | ||
from aie.dialects.aiex import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a teaching exercise, it might be better to avoid these wild-card imports to makes things clear.
Imagine a casual reader not knowing about AIE(X), MLIR, compilation... :-)
At least you could use some namespace shortcut if you dislike spelling aie.dialects.aie.
and others all over the place.
For some context, https://peps.python.org/pep-0008
Wildcard imports (
from <module> import *
) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools. There is one defensible use case for a wildcard import, which is to republish an internal interface as part of a public API (for example, overwriting a pure Python implementation of an interface with the definitions from an optional accelerator module and exactly which definitions will be overwritten isn’t known in advance).When republishing names this way, the guidelines below regarding public and internal interfaces still apply.
7c85558
to
3c5dfd2
Compare
When this lands, please make sure that it gets squashed. |
Of course |
…meter in the decoder that I need to investigate.
Looks close. We need a run.lit for log_hello_world and to finish up color detect with a python. |
Yeah, we're almost there. I added the remaining missing lit tests but color_threshold and passthrough still need a bit more work to get it working properly. |
//#define IMAGE_WIDTH_IN 128 | ||
//#define IMAGE_HEIGHT_IN 64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define IMAGE_WIDTH_IN 128 | |
//#define IMAGE_HEIGHT_IN 64 | |
// #define IMAGE_WIDTH_IN 128 | |
// #define IMAGE_HEIGHT_IN 64 |
//#define IMAGE_WIDTH_OUT IMAGE_WIDTH_IN | ||
//#define IMAGE_HEIGHT_OUT IMAGE_HEIGHT_IN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define IMAGE_WIDTH_OUT IMAGE_WIDTH_IN | |
//#define IMAGE_HEIGHT_OUT IMAGE_HEIGHT_IN | |
// #define IMAGE_WIDTH_OUT IMAGE_WIDTH_IN | |
// #define IMAGE_HEIGHT_OUT IMAGE_HEIGHT_IN |
//#define IMAGE_AREA_IN (IMAGE_HEIGHT_IN * IMAGE_WIDTH_IN) | ||
//#define IMAGE_AREA_OUT (IMAGE_HEIGHT_OUT * IMAGE_WIDTH_OUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define IMAGE_AREA_IN (IMAGE_HEIGHT_IN * IMAGE_WIDTH_IN) | |
//#define IMAGE_AREA_OUT (IMAGE_HEIGHT_OUT * IMAGE_WIDTH_OUT) | |
// #define IMAGE_AREA_IN (IMAGE_HEIGHT_IN * IMAGE_WIDTH_IN) | |
// #define IMAGE_AREA_OUT (IMAGE_HEIGHT_OUT * IMAGE_WIDTH_OUT) |
if (errors < max_errors) | ||
std::cout << "Error: " << (uint8_t) * (bufOut + i) << " at " << i | ||
<< " should be zero " | ||
<< " : input " << std::dec << (uint8_t)srcVec[i] << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
<< " : input " << std::dec << (uint8_t)srcVec[i] << std::endl; | |
<< " : input " << std::dec << (uint8_t)srcVec[i] | |
<< std::endl; |
std::cout << "Below threshold: " << (uint8_t) * (bufOut + i) << " at " << i | ||
<< " is correct " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
std::cout << "Below threshold: " << (uint8_t) * (bufOut + i) << " at " << i | |
<< " is correct " | |
std::cout << "Below threshold: " << (uint8_t) * (bufOut + i) << " at " | |
<< i << " is correct " |
|
||
extern "C" { | ||
|
||
//#if BIT_WIDTH == 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#if BIT_WIDTH == 8 | |
// #if BIT_WIDTH == 8 |
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
//#define __AIENGINE__ 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define __AIENGINE__ 1 | |
// #define __AIENGINE__ 1 |
const int32_t height, | ||
const int32_t width) { | ||
//::aie::vector<int16_t, 16> WT(66, 129, 25, 128); //Y=0.299*R + 0.587*G + | ||
//:0.114*B (BT.470) :aie::vector<int16_t, 16> WT(25, 129, 66, 128); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//:0.114*B (BT.470) :aie::vector<int16_t, 16> WT(25, 129, 66, 128); | |
//: 0.114*B (BT.470) :aie::vector<int16_t, 16> WT(25, 129, 66, 128); |
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
//#define __AIENGINE__ 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define __AIENGINE__ 1 | |
// #define __AIENGINE__ 1 |
XF_THRESHOLD_TYPE_TOZERO_INV = 4, | ||
}; | ||
|
||
//#define THRESH_TYPE XF_THRESHOLD_TYPE_BINARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format] reported by reviewdog 🐶
//#define THRESH_TYPE XF_THRESHOLD_TYPE_BINARY | |
// #define THRESH_TYPE XF_THRESHOLD_TYPE_BINARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
black
reference_designs/ipu-xrt/matrix_multiplication/aie2.py|200 col 1|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|25|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|27 col 1|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|31|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|35|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|41|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|44|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|51|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|54|
reference_designs/ipu-xrt/passthrough_hardware/aie2.py|64 col 1|
reference_designs/ipu-xrt/vector_scalar/aie2.py|18 col 1|
reference_designs/ipu-xrt/vector_scalar/aie2.py|26|
reference_designs/ipu-xrt/vector_scalar/aie2.py|29|
reference_designs/ipu-xrt/vector_scalar/aie2.py|37|
reference_designs/ipu-xrt/vector_scalar/aie2.py|41|
reference_designs/ipu-xrt/vector_scalar/aie2.py|47|
reference_designs/ipu-xrt/vector_scalar/aie2.py|69 col 1|
reference_designs/ipu-xrt/vector_scalar/aie2.py|74|
reference_designs/ipu-xrt/vector_scalar/aie2.py|77 col 1|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|21|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|24|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|31|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|33 col 1|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|37|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|46|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|50|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|60|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|80|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|82|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|89|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|91|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|94|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|98|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|101|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|113|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|115|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|118|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|122|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|125|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|137|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|139|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|142|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|146|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|149|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|161|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|163|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|166|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|170|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|173|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|179|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|181|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|184 col 1|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|186|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|190|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|192|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|194|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|196|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|198|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|200|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|202|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|204|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|206|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|209|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|215|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|225 col 1|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|24|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|33|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|35 col 1|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|39|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|41|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|45|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|48|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|61|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|69|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|75|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|80|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|87|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|92|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|204|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|259|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|262|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|267|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|285|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|288 col 1|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|19|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|32|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|34 col 1|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|35|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|39|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|43|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|46|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|57|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|65|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|68|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|70|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|77|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|80|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|91|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|93|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|96|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|112|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|136|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|164|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|171|
reference_designs/lit.cfg.py|42|
reference_designs/lit.cfg.py|45|
reference_designs/lit.cfg.py|47|
from aie.dialects.extras import memref, arith | ||
from aie.util import mlir_mod_ctx | ||
|
||
def my_add_one_objFifo(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
def my_add_one_objFifo(): | |
def my_add_one_objFifo(): |
from aie.util import mlir_mod_ctx | ||
|
||
def my_add_one_objFifo(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
memRef_16_ty = T.memref(16, T.i32()) | ||
memRef_8_ty = T.memref(8, T.i32()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
memRef_16_ty = T.memref(16, T.i32()) | |
memRef_8_ty = T.memref(8, T.i32()) | |
memRef_16_ty = T.memref(16, T.i32()) | |
memRef_8_ty = T.memref(8, T.i32()) |
memRef_16_ty = T.memref(16, T.i32()) | ||
memRef_8_ty = T.memref(8, T.i32()) | ||
ofifo_memRef_16_ty = TypeAttr.get(ObjectFifoType.get(memRef_16_ty)) | ||
ofifo_memRef_8_ty = TypeAttr.get(ObjectFifoType.get(memRef_8_ty)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
ofifo_memRef_8_ty = TypeAttr.get(ObjectFifoType.get(memRef_8_ty)) | |
ofifo_memRef_8_ty = TypeAttr.get(ObjectFifoType.get(memRef_8_ty)) |
ShimTile = tile(0, 0) | ||
MemTile = tile(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) | |
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) |
ShimTile = tile(0, 0) | ||
MemTile = tile(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) | |
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) |
objectfifo("memA", MemTile, [ComputeTile2], 2, ofifo_memRef_A_ty, | ||
[(m//r, r*k*word_size_in//4), | ||
(k//s, s*word_size_in//4), | ||
(r, k*word_size_in//4), | ||
(s*word_size_in//4, 1)], []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
objectfifo("memA", MemTile, [ComputeTile2], 2, ofifo_memRef_A_ty, | |
[(m//r, r*k*word_size_in//4), | |
(k//s, s*word_size_in//4), | |
(r, k*word_size_in//4), | |
(s*word_size_in//4, 1)], []) | |
objectfifo( | |
"memA", | |
MemTile, | |
[ComputeTile2], | |
2, | |
ofifo_memRef_A_ty, | |
[ | |
(m // r, r * k * word_size_in // 4), | |
(k // s, s * word_size_in // 4), | |
(r, k * word_size_in // 4), | |
(s * word_size_in // 4, 1), | |
], | |
[], | |
) |
objectfifo("memB", MemTile, [ComputeTile2], 2, ofifo_memRef_B_ty, | ||
[(k//s, s*n*word_size_in//4), | ||
(n//t, t*word_size_in//4), | ||
(s, n*word_size_in//4), | ||
(t*word_size_in//4, 1)], []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
objectfifo("memB", MemTile, [ComputeTile2], 2, ofifo_memRef_B_ty, | |
[(k//s, s*n*word_size_in//4), | |
(n//t, t*word_size_in//4), | |
(s, n*word_size_in//4), | |
(t*word_size_in//4, 1)], []) | |
objectfifo( | |
"memB", | |
MemTile, | |
[ComputeTile2], | |
2, | |
ofifo_memRef_B_ty, | |
[ | |
(k // s, s * n * word_size_in // 4), | |
(n // t, t * word_size_in // 4), | |
(s, n * word_size_in // 4), | |
(t * word_size_in // 4, 1), | |
], | |
[], | |
) |
objectfifo("outC", MemTile, [ShimTile], 2, ofifo_memRef_C_ty, | ||
[(m//r, r*n*word_size_out//4), | ||
(r, t*word_size_out//4), | ||
(n//t, r*t*word_size_out//4), | ||
(t*word_size_out//4, 1)], []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
objectfifo("outC", MemTile, [ShimTile], 2, ofifo_memRef_C_ty, | |
[(m//r, r*n*word_size_out//4), | |
(r, t*word_size_out//4), | |
(n//t, r*t*word_size_out//4), | |
(t*word_size_out//4, 1)], []) | |
objectfifo( | |
"outC", | |
MemTile, | |
[ShimTile], | |
2, | |
ofifo_memRef_C_ty, | |
[ | |
(m // r, r * n * word_size_out // 4), | |
(r, t * word_size_out // 4), | |
(n // t, r * t * word_size_out // 4), | |
(t * word_size_out // 4, 1), | |
], | |
[], | |
) |
objectfifo_link(["memC"], ["outC"]) | ||
|
||
# Set up compute tiles | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
black
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|91|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|94|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|98|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|101|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|113|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|115|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|118|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|122|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|125|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|137|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|139|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|142|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|146|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|149|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|161|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|163|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|166|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|170|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|173|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|179|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|181|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|184 col 1|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|186|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|190|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|192|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|194|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|196|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|198|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|200|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|202|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|204|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|206|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|209|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|215|
reference_designs/ipu-xrt/vision_pipelines/color_threshold/aie2_colorThreshold.py|225 col 1|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|24|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|33|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|35 col 1|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|39|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|41|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|45|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|48|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|61|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|69|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|75|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|80|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|87|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|92|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|204|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|259|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|262|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|267|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|285|
reference_designs/ipu-xrt/vision_pipelines/edge_detect/aie2_edgeDetect.py|288 col 1|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|19|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|32|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|34 col 1|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|35|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|39|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|43|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|46|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|57|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|65|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|68|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|70|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|77|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|80|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|91|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|93|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|96|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|112|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|136|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|164|
reference_designs/ipu-xrt/vision_pipelines/passthrough/aie2.py|171|
reference_designs/lit.cfg.py|42|
reference_designs/lit.cfg.py|45|
reference_designs/lit.cfg.py|47|
|
||
print(ctx.module) | ||
|
||
my_matmul() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
my_matmul() | |
my_matmul() |
if len(sys.argv) == 2: | ||
N = int(sys.argv[1]) | ||
|
||
def my_passthrough(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
def my_passthrough(): |
|
||
def my_passthrough(): | ||
|
||
with mlir_mod_ctx() as ctx: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
with mlir_mod_ctx() as ctx: | |
def my_passthrough(): | |
with mlir_mod_ctx() as ctx: |
|
||
@device(AIEDevice.ipu) | ||
def device_body(): | ||
memRef_ty = T.memref(1024, T.i32()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
memRef_ty = T.memref(1024, T.i32()) | |
memRef_ty = T.memref(1024, T.i32()) |
ofifo_memRef_ty = TypeAttr.get(ObjectFifoType.get(memRef_ty)) | ||
|
||
# Tile declarations | ||
ShimTile = tile(0, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
ShimTile = tile(0, 0) | |
ShimTile = tile(0, 0) |
ShimTile = tile(0, 0) | ||
MemTile = tile(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) | |
ShimTile = tile(0, 0) | |
MemTile = tile(0, 1) |
objectfifo("inOOB_L3L2", ShimTile, [MemTile], 2, ofifo_line_channels_ty, [], []) | ||
objectfifo("inOOB_L2L1_0", MemTile, [ComputeTile2], 2, ofifo_line_ty, [], []) | ||
objectfifo("inOOB_L2L1_1", MemTile, [ComputeTile3], 2, ofifo_line_ty, [], []) | ||
objectfifo("inOOB_L2L1_2", MemTile, [ComputeTile4], 2, ofifo_line_ty, [], []) | ||
objectfifo("inOOB_L2L1_3", MemTile, [ComputeTile5], 2, ofifo_line_ty, [], []) | ||
objectfifo_link(["inOOB_L3L2"], ["inOOB_L2L1_0", "inOOB_L2L1_1", "inOOB_L2L1_2", "inOOB_L2L1_3"]) | ||
|
||
# Output RGBA | ||
objectfifo("outOOB_L2L3", MemTile, [ShimTile], 2, ofifo_line_channels_ty, [], []) | ||
objectfifo("outOOB_L1L2_0", ComputeTile2, [MemTile], 2, ofifo_line_ty, [], []) | ||
objectfifo("outOOB_L1L2_1", ComputeTile3, [MemTile], 2, ofifo_line_ty, [], []) | ||
objectfifo("outOOB_L1L2_2", ComputeTile4, [MemTile], 2, ofifo_line_ty, [], []) | ||
objectfifo("outOOB_L1L2_3", ComputeTile5, [MemTile], 2, ofifo_line_ty, [], []) | ||
objectfifo_link(["outOOB_L1L2_0", "outOOB_L1L2_1", "outOOB_L1L2_2", "outOOB_L1L2_3"], ["outOOB_L2L3"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
objectfifo("inOOB_L3L2", ShimTile, [MemTile], 2, ofifo_line_channels_ty, [], []) | |
objectfifo("inOOB_L2L1_0", MemTile, [ComputeTile2], 2, ofifo_line_ty, [], []) | |
objectfifo("inOOB_L2L1_1", MemTile, [ComputeTile3], 2, ofifo_line_ty, [], []) | |
objectfifo("inOOB_L2L1_2", MemTile, [ComputeTile4], 2, ofifo_line_ty, [], []) | |
objectfifo("inOOB_L2L1_3", MemTile, [ComputeTile5], 2, ofifo_line_ty, [], []) | |
objectfifo_link(["inOOB_L3L2"], ["inOOB_L2L1_0", "inOOB_L2L1_1", "inOOB_L2L1_2", "inOOB_L2L1_3"]) | |
# Output RGBA | |
objectfifo("outOOB_L2L3", MemTile, [ShimTile], 2, ofifo_line_channels_ty, [], []) | |
objectfifo("outOOB_L1L2_0", ComputeTile2, [MemTile], 2, ofifo_line_ty, [], []) | |
objectfifo("outOOB_L1L2_1", ComputeTile3, [MemTile], 2, ofifo_line_ty, [], []) | |
objectfifo("outOOB_L1L2_2", ComputeTile4, [MemTile], 2, ofifo_line_ty, [], []) | |
objectfifo("outOOB_L1L2_3", ComputeTile5, [MemTile], 2, ofifo_line_ty, [], []) | |
objectfifo_link(["outOOB_L1L2_0", "outOOB_L1L2_1", "outOOB_L1L2_2", "outOOB_L1L2_3"], ["outOOB_L2L3"]) | |
objectfifo( | |
"inOOB_L3L2", ShimTile, [MemTile], 2, ofifo_line_channels_ty, [], [] | |
) | |
objectfifo( | |
"inOOB_L2L1_0", MemTile, [ComputeTile2], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"inOOB_L2L1_1", MemTile, [ComputeTile3], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"inOOB_L2L1_2", MemTile, [ComputeTile4], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"inOOB_L2L1_3", MemTile, [ComputeTile5], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo_link( | |
["inOOB_L3L2"], | |
["inOOB_L2L1_0", "inOOB_L2L1_1", "inOOB_L2L1_2", "inOOB_L2L1_3"], | |
) | |
# Output RGBA | |
objectfifo( | |
"outOOB_L2L3", MemTile, [ShimTile], 2, ofifo_line_channels_ty, [], [] | |
) | |
objectfifo( | |
"outOOB_L1L2_0", ComputeTile2, [MemTile], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"outOOB_L1L2_1", ComputeTile3, [MemTile], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"outOOB_L1L2_2", ComputeTile4, [MemTile], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo( | |
"outOOB_L1L2_3", ComputeTile5, [MemTile], 2, ofifo_line_ty, [], [] | |
) | |
objectfifo_link( | |
["outOOB_L1L2_0", "outOOB_L1L2_1", "outOOB_L1L2_2", "outOOB_L1L2_3"], | |
["outOOB_L2L3"], | |
) |
rtpComputeTile3 = Buffer(ComputeTile3, [16], T.i32(), "rtpComputeTile3") | ||
rtpComputeTile4 = Buffer(ComputeTile4, [16], T.i32(), "rtpComputeTile4") | ||
rtpComputeTile5 = Buffer(ComputeTile5, [16], T.i32(), "rtpComputeTile5") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
rtpComputeTile5 = Buffer(ComputeTile5, [16], T.i32(), "rtpComputeTile5") | ||
|
||
# Set up compute tiles | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
# thresholdValue = arith.trunci(T.i16(), memref.load(rtpComputeTile2, [0])) | ||
# maxValue = arith.trunci(T.i16(), memref.load(rtpComputeTile2, [1])) | ||
# thresholdType = arith.trunci(T.i8(), memref.load(rtpComputeTile2, [2])) | ||
maxValue = arith.constant(255, T.i16()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[black] reported by reviewdog 🐶
maxValue = arith.constant(255, T.i16()) | |
maxValue = arith.constant(255, T.i16()) |
@jackl-xilinx you need to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for wrapping this up @jackl-xilinx.
@makslevental can we ignore this directory in the clang-tidy check: |
No description provided.