-
Notifications
You must be signed in to change notification settings - Fork 13
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 options to ttmlir-translate
to output C++ from TTKernel dialect
#1602
base: main
Are you sure you want to change the base?
Conversation
d77935c
to
3a50482
Compare
ecfef6c
to
fbd3a0d
Compare
emitKernelAsCpp(mlir::ModuleOp op, llvm::raw_ostream &os, const ttkernel::ThreadType &threadType ) | ||
{ | ||
std::vector<func::FuncOp> ops; | ||
op->walk([&](func::FuncOp entry) { |
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.
Is there a better way to extract the nested FuncOp
from ModuleOp
?
//TODO: Should generalize this to read kernel type from Attribute? | ||
void registerTensixKernelToCpp() { | ||
TranslateFromMLIRRegistration reg( | ||
"tensixkernel-to-cpp", "translate tensix kernel to C++", |
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.
Feel like I need to change the option to ttkernel-to-cpp=noc
and ttkernel-to-cpp=tensix
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.
Is this possible? If so, where can I find an example?
ttmlir-translate
ttmlir-translate
ttmlir-translate
to output C++ from TTKernel dialect
ttmlir-translate
to output C++ from TTKernel dialectttmlir-translate
to output C++ from TTKernel dialect
Shardon requires emitting C++ from python kernels. To help with the testing and debug process, I've added a TTKernel to C++ target and options to
ttmlir-translate
to directly dump C++ from TTKernel dialect.There are separate Noc and Tensix kernel dumping options because shardon users need to explicitly control the definition of Noc and Tensix kernels separately.