-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【Op Profiling】Add operator run time profiling feature #58809
Conversation
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.
相同逻辑的代码拷贝太多了,考虑下代码复用。
paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc
Outdated
Show resolved
Hide resolved
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.
utils.py里添加的代码需要优化,许多实现过于复杂。如果添加的代码太多,可以直接写成一个独立模块。
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.
utils.py新增的功能,代码行数比较多,建议拆分成一个独立的模块
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
PR types
New features
PR changes
APIs
Description
use
from paddle.distributed.auto_parallel.static.cost import measure_program_real_op_cost
and
from paddle.distributed.auto_parallel.static.cost import check_if_op_supports_runtime_profiling
to import them.
op.dist_attr.run_time_us, or
program.global_block().ops[i].dist_attr.run_time_us
to obtain op run time from a profiled program object.
check_if_op_supports_runtime_profiling(op)
请通过
from paddle.distributed.auto_parallel.static.cost import measure_program_real_op_cost
from paddle.distributed.auto_parallel.static.cost import check_if_op_supports_runtime_profiling
来导入这两个API.
op.dist_attr.run_time_us
获取其具体运行时间(微秒),或者使用
program.global_block().ops[i].dist_attr.run_time_us
来从已被profile的program对象中获取op实际运行时间
PCard-71568