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

Add e2e and lit tests for ukernel+dcg mix #517

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

newling
Copy link
Contributor

@newling newling commented Jul 8, 2024

This PR adds a test where we use a microkernel for a matmul, and directly generated code for a subsequent elementwise operation -- ie we mix ukernel with direct code generation.

@newling newling requested review from erwei-xilinx and yzhang93 July 8, 2024 20:36
@newling newling changed the title add failing ukernel test Add mixed ukernel test for tracking Jul 8, 2024
@erwei-xilinx
Copy link
Contributor

This fix should get the example to work: Xilinx/mlir-air#656.

@newling newling force-pushed the ukernel_with_dcg branch from 7e6b607 to 2c79fa0 Compare July 9, 2024 18:53
@newling
Copy link
Contributor Author

newling commented Jul 9, 2024

Thanks @erwei-xilinx , the e2e matmul works with mixed ukernel and dcg now!

Copy link
Contributor

@yzhang93 yzhang93 left a comment

Choose a reason for hiding this comment

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

Could you rebase your PR and check if it passes ci?

return %matmul_add : tensor<?x?x?x?xbf16>
}
// CHECK: func @zero_fill_matmul_elmwise
// CHECK: iree_codegen.ukernel.generic "zero_bf16"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would include // CHECK-NOT: linalg.fill

Comment on lines 252 to 254



Copy link
Contributor

Choose a reason for hiding this comment

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

Remove these empty lines.

Comment on lines 330 to 335
#The flag '--iree-amdaie-path-to-ukernels' currently does not work,
#see for example https: // github.com/nod-ai/iree-amd-aie/issues/340
#Therefore we need to manually copy(or link) the mm.o file to the
#directory in which iree - compile is run.iree - compile is run in the
#output directory.Create the softlink only if it is has not already
#been created.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Please add/remove spaces for this comment.
Question: Will this issue be fixed next?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't planning on looking at it next

@newling newling changed the title Add mixed ukernel test for tracking Add e2e and lit tests for ukernel+dcg mix Jul 11, 2024
@newling newling requested a review from yzhang93 July 11, 2024 00:14
compilation_flags="${compilation_flags} --iree-amdaie-enable-ukernels=all"

# The flag '--iree-amdaie-path-to-ukernels' currently does not work,
# see for example https://github.com/nod-ai/iree-amd-aie/issues/340
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a full stop at the end of this line.

# The flag '--iree-amdaie-path-to-ukernels' currently does not work,
# see for example https://github.com/nod-ai/iree-amd-aie/issues/340
# Therefore we need to manually copy (or link) the mm.o file to the
# directory in which iree - compile is run.iree - compile is run in the
Copy link
Contributor

Choose a reason for hiding this comment

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

Still see some format issue.
-> iree-comple is run. iree-compile ...

@newling newling requested a review from yzhang93 July 11, 2024 15:22
@newling newling force-pushed the ukernel_with_dcg branch from a3def8d to c7c5464 Compare July 11, 2024 20:15
@newling newling enabled auto-merge (squash) July 11, 2024 20:56
@newling newling merged commit 9191fa2 into nod-ai:main Jul 11, 2024
2 checks passed
@newling newling deleted the ukernel_with_dcg branch July 13, 2024 20:28
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