which means profiling range [start_batch, end_batch).
which means profiling range [start_batch, end_batch).
on_trace_ready (Callable, optional): Callable object, serves as callback function, and takes the Profiler object as parameter, which provides a way for users to do post-processing.
on_trace_ready (Callable, optional): Callable object, serves as callback function, and takes the Profiler object as parameter, which provides a way for users to do post-processing.
This callable object will be called when ``scheduler`` returns ``ProfilerState.RECORD_AND_RETURN``. The default value is :ref:`export_chrome_tracing <api_paddle_profiler_export_chrome_tracing>` (./profiler_log/).
This callable object will be called when ``scheduler`` returns ``ProfilerState.RECORD_AND_RETURN``. The default value is :ref:`export_chrome_tracing <api_paddle_profiler_export_chrome_tracing>` (./profiler_log/).
timer_only (bool, optional): If it is True, the cost of Dataloader and every step of the model will be count without profiling. Otherwise, the model will
be timed and profiled. Default: False.
Examples:
Examples:
1. profiling range [2, 5).
1. profiling range [2, 5).
...
@@ -316,6 +319,68 @@ class Profiler:
...
@@ -316,6 +319,68 @@ class Profiler:
p.stop()
p.stop()
p.summary()
p.summary()
4. Use profiler to get throughput and cost of the model