-
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
Feed HW alignment requirements from system desc into allocator #310
Conversation
- Enforce the Noc/DRAM/PCIE alignment requirements taken from the system descriptor on the allocator. - Annotate function arguments with new attribute "argument_allocations" with info about where inputs are allocated.
f75e128
to
1680064
Compare
lib/Dialect/TT/IR/TTOpsTypes.cpp
Outdated
@@ -479,6 +502,17 @@ uint64_t TileType::getSizeBytes() const { | |||
} | |||
} | |||
|
|||
SystemDescAttr mlir::tt::getCurrentScopeSystemDesc(mlir::Operation *op) { | |||
while (op) { | |||
if (auto systemDesc = |
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.
Each OP can now have system desc attr? Or only module and funcops? Can system desc be different between different func ops?
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.
Only ModuleOps can have a system desc, this is just a convenience method that gets the system desc of the current scope. This routine just walks up parent ops until it hits the top level module op.
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.
It allows you to get at the system desc from anywhere. If you're in some rewrite pattern you don't necessarily have a direct handle to the enclosing module.
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.
isa<ModuleOp>
check might be better then? You clearly state what type has the attr and you will throw if not found where expected instead of returning nullptr, or there is a valid case for nullptr to be returned?
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.
Yeah I copy pasted this from getCurrentScopeDevice
and I think in the future the device attribute could appear on specialized ops (like ttir.with_device
op which reinterprets the device grid), but it makes more sense to be more strict here. I'll fix this with your suggestion.
descriptor on the allocator.
with info about where inputs are allocated.