MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / main

Function main

imperative/python/megengine/tools/profile_analyze.py:52–425  ·  view source on GitHub ↗
(passed_args=None)

Source from the content-addressed store, hash-verified

50
51
52def main(passed_args=None): # pylint: disable=too-many-statements
53 is_profile_from_ocl = False
54 r"""Analyses profile info from :mod:`~.utils.profile_analyzer` .
55 Run this file with ``--help`` to get more usage.
56 """
57 parser = argparse.ArgumentParser(
58 description="analyze analyzer result",
59 formatter_class=argparse.ArgumentDefaultsHelpFormatter,
60 )
61 parser.add_argument("dump")
62 parser.add_argument(
63 "-t",
64 "--top",
65 type=int,
66 default=3,
67 help="number of most time-consuming operators to print",
68 )
69 parser.add_argument(
70 "--type", action="append", help="filter oprs in the top list by type"
71 )
72 parser.add_argument(
73 "--aggregate-by",
74 default=None,
75 choices=["type"],
76 help="aggragate profiling result by",
77 )
78 parser.add_argument(
79 "--opr-name", help="filter oprs in the top list by regex of name"
80 )
81 parser.add_argument(
82 "--input-dtype", type=str, help="filter oprs in the top list by input dtype"
83 )
84 parser.add_argument(
85 "--top-end-key",
86 default="end",
87 choices=["end", "kern"],
88 help="how time in top is calculated; end corresponds "
89 "to total device time, and kern corresponds to only "
90 "wait time",
91 )
92 parser.add_argument(
93 "--aggregate",
94 default=None,
95 help="aggregate operations",
96 choices=["max", "min", "sum", "mean"],
97 )
98 parser.add_argument(
99 "--order-by",
100 default="time",
101 help="sort result according to given column; the param can be "
102 "<col_name> or +<col_name>, meaning sorting in descending or "
103 "ascending order respectively",
104 )
105 parser.add_argument(
106 "--copy-time", action="store_true", help="show copy time related result"
107 )
108 parser.add_argument(
109 "--min-time",

Callers 1

profile_analyze.pyFile · 0.70

Calls 10

ProfileAnalyzerClass · 0.90
strFunction · 0.85
summaryFunction · 0.85
printFunction · 0.85
prof_detailsFunction · 0.85
appendMethod · 0.45
compileMethod · 0.45
matchMethod · 0.45
loadMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected