-
Notifications
You must be signed in to change notification settings - Fork 93
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
[Experimental] ONNI v2 #91
Conversation
uint64_t max_size = 0; | ||
for (ComputeOperand *co : pModule.getComputeOperands()) { | ||
if (ComputeMemOperand *mem = dyn_cast<ComputeMemOperand>(co)) { | ||
Value *v = co->getValue(); |
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.
how about mem->getValue();
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.
ok~
if (ComputeMemOperand *mem = dyn_cast<ComputeMemOperand>(co)) { | ||
Value *v = co->getValue(); | ||
if (mem->isInput()) { | ||
// XXX: Multiple inputs |
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.
Use assert? assert(inputNum == 1 && "TODO: Support multiple inputs);
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.
Good advice!
// TODO: Refactor this. We need a table printer. | ||
size_t val_len = 8; | ||
for (ComputeOperator &cm : *pModule.getRootComputeGraph()) { | ||
if (dyn_cast<InputOperator>(&cm)) continue; |
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.
How about add a function:
bool skipInMemStatistics(ComputeOperator *pCm) {
if (isa(pCm) ||
isa<...> || isa<...>)
return true;
return false;
}
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.
ok~
@@ -27,6 +30,9 @@ Pass::ReturnType CountOperatorsPass::runOnModule(Module &pModule) | |||
uint64_t total = 0; | |||
|
|||
for (ComputeOperator &cm : *pModule.getRootComputeGraph()) { | |||
if (dyn_cast<InputOperator>(&cm)) continue; |
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.
Replace with a function? IsIOWOperator() or SkipInCountStatistics()?
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.
Ok, that's Great! Thanks a lot!
LTGM! (But please keep fixing TODO list ;P) |
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.
LGTM
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.
Thanks so much!
if (ComputeMemOperand *mem = dyn_cast<ComputeMemOperand>(co)) { | ||
Value *v = co->getValue(); | ||
if (mem->isInput()) { | ||
// XXX: Multiple inputs |
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.
Good advice!
uint64_t max_size = 0; | ||
for (ComputeOperand *co : pModule.getComputeOperands()) { | ||
if (ComputeMemOperand *mem = dyn_cast<ComputeMemOperand>(co)) { | ||
Value *v = co->getValue(); |
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.
ok~
// TODO: Refactor this. We need a table printer. | ||
size_t val_len = 8; | ||
for (ComputeOperator &cm : *pModule.getRootComputeGraph()) { | ||
if (dyn_cast<InputOperator>(&cm)) continue; |
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.
ok~
@@ -27,6 +30,9 @@ Pass::ReturnType CountOperatorsPass::runOnModule(Module &pModule) | |||
uint64_t total = 0; | |||
|
|||
for (ComputeOperator &cm : *pModule.getRootComputeGraph()) { | |||
if (dyn_cast<InputOperator>(&cm)) continue; |
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.
Ok, that's Great! Thanks a lot!
Ready for review:
Print memory usage and overall time.
Print the final ONNC IR before inference.
Print the operator counts.
Print the per layer inference time.
Print internal memory layout.