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

[UKernel] Add ukernel to be compiled through peano #1097

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

jtuyls
Copy link
Collaborator

@jtuyls jtuyls commented Feb 11, 2025

Adds a path to compile ukernels through peano. The compilation time is a lot faster this way, potentially at a decrease in performance, but potentially ukernels could be written in a way that enables good performance via peano as well.

Copy link
Contributor

@Abhishek-Varma Abhishek-Varma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice @jtuyls ! A few comments to address.

Copy link
Contributor

@Abhishek-Varma Abhishek-Varma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jtuyls jtuyls merged commit 08e7777 into nod-ai:main Feb 12, 2025
7 checks passed
@jtuyls jtuyls deleted the peano-ukernel branch February 12, 2025 10:16
args.emplace_back("-o");
args.emplace_back(outputFile);
if (verbose) args.emplace_back("-v");
if (failed(runTool((peanoDir / "bin" / "clang").string(), args, verbose))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, you can do this with peano? I must play around with this, see what the .ll generated looks like.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this is seems quite useful for experimentation and speed of dev. However, I have run into a couple of issues already that I think you have seen as well with vectorization:

  • O0 results in compilation errors
  • Sometimes the stack size usage blows up and this results in incorrect results if it's larger than 1024 and I needed to manually increase it:
    DefaultValuedAttr<I32Attr, "0x400">:$stack_size,
    . Ideally, we should know the stack size usage before allocating a stack buffer...

Also, it should work with the high level AIE_API as well, but then you need to include those header files and I think they are only available inside Vitis. But with Vitis installed on our CI machines, that should work as well in theory, although I haven't tried it yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack overflow, I suspect that's what is causing the current numerical issues I'm observing Xilinx/llvm-aie#342 -- thanks for this pointer, very well timed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants