# profilerparser **Repository Path**: ziruiwu/profilerparser ## Basic Information - **Project Name**: profilerparser - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-28 - **Last Updated**: 2021-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Usage of parse.py 1. Clone this repo by ``` git clone https://gitee.com/ziruiwu/profilerparser.git``` 2. run the test script (Only dependency is **matplotlib**) ```python scripts/parse.py --path=devque_samples --device_id=0``` 3. you will this graph ![](./demo.png) 4. you will see the following summary info as well in the console ``` sampling_interval:10 cpu_core_cnt:32 pipeline:Mnist(id=8) -> Map(id=7) -> Map(id=6) -> Map(id=5) -> Map(id=4) -> Map(id=3) -> Shuffle(id=2) -> Batch(id=1) -> DeviceQueue(id=0) num_samples:154 pipeline time:2.7363344051446945 tdt time:0.0 batch time:2.7363344051446945 num_batches:311 pipeline_file:devque_samples/pipeline_profiling_0.json cpu_file:devque_samples/minddata_cpu_utilization_0.json ``` ### Note: 1. Need to make sure the ```somedir``` in ```--path=somedir``` contains these three files ``` device_queue_profiling_0.txt (or dataset_iterator_profiling_0.txt) minddata_cpu_utilization_0.json pipeline_profiling_0.json``` 2. if these files ends with digit other than 1, need to specific the ```device_id```. 3. you can play around with these input args to tweak stuff like transparancy or plot interval ``` parser.add_argument("--path", required=False, type=str, help='folder containing md profiling files', default=".") parser.add_argument("--device_id", required=False, type=str, help='device_id, suffix of files', default="1") parser.add_argument("--save", required=False, type=str, help='director/name to save img to', default=None) parser.add_argument("--top", required=False, type=int, help='display ops with highest CPU usage', default=None) parser.add_argument("--plot_itv", required=False, type=int, help='interval for plotting data points', default=1) parser.add_argument("--throughput", required=False, type=str, help='plot 3rd graph throughput', default="F") '''args related to plot''' parser.add_argument("--no_plot", required=False, type=str, help='display plotted image', default="False") parser.add_argument("--marker", required=False, type=str, help='marker type', default='o') parser.add_argument("--width", required=False, type=float, help='line/marker size type', default=1) parser.add_argument("--alpha", required=False, type=float, help='transparency of each pixel displayed', default=0.9) ``` 4. For support please contact repo owner