-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] OpInfo Metric in Pytorch namespace
Currently, OpInfo metric will print: OpIndex, OpName, TotalExecutionTime, MaxKernelIndex, MaxKernelName, MaxKernelExecutionTime, kernelNumTracer, kernelNumCounter, TotalDramRead, TotalDramWrite, TotalSFOp, TotalElapsedCycles In addition, we find the reason why mapping mechanism is invalid and fixed it. Signed-off-by: YushuoEdge <[email protected]>
- Loading branch information
1 parent
a1e9913
commit 50d1e60
Showing
12 changed files
with
346 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import amanda | ||
import torch | ||
import torchvision | ||
from profiler import Profiler | ||
|
||
def main(): | ||
|
||
device = "cuda" | ||
|
||
model = torchvision.models.resnet50().to(device) | ||
x = torch.rand((32, 3, 227, 227)).to(device) | ||
|
||
metric = "OpInfo" | ||
profiler = Profiler(metric) | ||
profiler.setConfigs(metric=metric, supplyInfo=[]) | ||
|
||
with amanda.tool.apply(profiler.counter): | ||
y = model(x) | ||
with amanda.tool.apply(profiler.tracer): | ||
y = model(x) | ||
|
||
profiler.showResults() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.