commit
3ca968441d
Before Width: | Height: | Size: 344 KiB After Width: | Height: | Size: 344 KiB |
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 69 KiB |
@ -0,0 +1,27 @@
|
||||
## how to use timeline tool to do profile
|
||||
|
||||
1. Add `with profiler.profiler(...)` to the main training loop. After run, the code will generate a profile record file `/tmp/profile`. **Warning**: Please do not run too many batches when use profiler to record timeline information, for the profile record will grow with the batch number.
|
||||
|
||||
```python
|
||||
with profiler.profiler('All', 'total', '/tmp/profile') as prof:
|
||||
for pass_id in range(pass_num):
|
||||
for batch_id, data in enumerate(train_reader()):
|
||||
exe.run(fluid.default_main_program(),
|
||||
feed=feeder.feed(data),
|
||||
fetch_list=[],
|
||||
use_program_cache=True)
|
||||
...
|
||||
```
|
||||
|
||||
1. Run `python paddle/tools/timeline.py` to process `/tmp/profile`, it will generate another
|
||||
file `/tmp/timeline` by default. You can change the path by cmd parameter, please take a look at
|
||||
[timeline.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/timeline.py) for details.
|
||||
|
||||
1. Open chrome and visit <chrome://tracing/>, use `load` button to load the generated `timeline` file.
|
||||
|
||||

|
||||
|
||||
1. The resulting timeline should be like:
|
||||
|
||||
|
||||

|
After Width: | Height: | Size: 30 KiB |
@ -1,3 +1,6 @@
|
||||
if(WITH_DISTRIBUTE)
|
||||
grpc_library(sendrecvop_grpc SRCS sendrecvop_utils.cc grpc_client.cc grpc_server.cc PROTO send_recv.proto DEPS lod_tensor selected_rows)
|
||||
grpc_library(sendrecvop_grpc SRCS bytebuffer_stream.cc sendrecvop_utils.cc grpc_client.cc grpc_server.cc PROTO send_recv.proto DEPS lod_tensor selected_rows)
|
||||
set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
|
||||
set_source_files_properties(test_serde.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
|
||||
cc_test(serde_test SRCS test_serde.cc DEPS grpc++_unsecure grpc_unsecure gpr cares zlib protobuf sendrecvop_grpc)
|
||||
endif()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue