-
Notifications
You must be signed in to change notification settings - Fork 16
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 llama and resnet emitc tests #2144
Conversation
One weird thing here though... in llama test, generating the flatbuffer takes ~75 seconds for some reason, the rest of the compiler is much faster (total 1-2 sec). We should look into what is so slow in the fyi @nsmithtt |
@svuckovicTT You might want to try this #1782. |
e640031
to
fb0972a
Compare
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.
Looks good. Thanks!
ArrayAttr arrayAttrs = rewriter.getArrayAttr({ | ||
rewriter.getIndexAttr(0), // input tensor | ||
repeatInterleaveOp.getRepeatsAttr(), repeatInterleaveOp.getDimAttr(), | ||
repeatInterleaveOp.getMemoryConfig().has_value() |
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.
Nit: has_value()
is not needed.
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.
Sure, but I prefer it this way as it makes it obvious what is being checked.
repeatInterleaveOp.getMemoryConfigAttr(), | ||
repeatInterleaveOp.getLoc()) | ||
->getResult(0)), | ||
mlir::cast<Attribute>(rewriter.getIndexAttr(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.
Is this cast really needed?
Also I struggle to follow the logic here, you can maybe derive work related to ?:
operator before ArrayAttr
creation.
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.
The cast is indeed needed, otherwise the error is Incompatible operand types ('IntegerAttr' and 'emitc::OpaqueAttr')
. I remember that you and I actually looked into this while working on OnesOp
conversion haha!
you can maybe derive work related to ?: operator before ArrayAttr creation.
I'll leave it like this since it's "closer" to the automated approach we discussed, with the idea of this op (and OnesOp
with same-style implementation) being one of the first to rework into it (automated approach).
- added `assumeVefied()` to `printFlags` that are used for printing op - greately lowers TTNN->Flatbuffer compile time (on LlamaPrefill example from #2144 compile time was lowered from ~70s -> ~1.5s
### Ticket #2156 ### Problem description As described here #1782 `getOpDebugString` was taking more than 99% of the time of `ttmlir-translate -ttnn-to-flatbuffer` execution. From that time, 99% was spent on op verification. ### What's changed - added `assumeVefied()` to `printFlags` that are used for printing ops (the way we are running our pipelines I believe this is a safe assumption) - greatly lowers TTNN->Flatbuffer compile time (on LlamaPrefill example from #2144) compile time was lowered from ~70s -> ~1.5s (around 0.8s was spent on op printing)
fb0972a
to
a07e6b2
Compare
Ticket
Closes #2143
Problem description
Add llama and resnet tests for emitc path.
What's changed
ttnn::repeat_interleave
support added thru emitc--ttnn-create-input-gens
wasn't putting tensors on device when they were assumed on device by their layout desc, fixed thatci_compile_dylib.py
to not removettnn-dylib.cpp
as it is useful for debugging - this is okay as the file is gitignored already