ros-acceleration / acceleration_examples

ROS 2 package examples demonstrating the use of hardware acceleration.
Apache License 2.0
40 stars 19 forks source link

Unable to generate Benchmarking Graphs from tracedata #20

Open yashwant-d opened 1 year ago

yashwant-d commented 1 year ago

Hi @vmayoral,

I am trying to reproduce ROS Perception benchmarking data which is published on KRS Documentation i.e. this with KRS 1.0.

I ran CPU Only ROS Perception application which produced following trace data:

trace_rectify_resize/ust/uid/0/64-bit/
├── index
│   ├── ros2_0.idx
│   ├── ros2_1.idx
│   ├── ros2_2.idx
│   └── ros2_3.idx
├── metadata
├── ros2_0
├── ros2_1
├── ros2_2
└── ros2_3

After this I launched the analysis launch file: https://github.com/ros-acceleration/acceleration_examples/blob/main/graphs/perception/perception_2nodes/launch/analyse_rectify_resize.launch.py

while keeping only image_pipeline_msg_sets_ms_cpu I have commenting out subsequent message_sets* as we didn't have trace data for gpu, fpga and other scenarios.

After launching the modified launch file, following errors are observed:

root@kria:~/.ros/tracing# ros2 launch perception_2nodes analyse_rectify_resize.launch.py 
[INFO] [launch]: All log files can be found below /root/.ros/log/2022-08-08-11-55-00-972134-kria-347256
[INFO] [launch]: Default logging verbosity is set to INFO
/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/usr/lib/python3/dist-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: zero-size array to reduction operation minimum which has no identity

As per trace_tools architecture doc , there is a conversion required which generateds data model from tracedata i.e. converted file. if we run the launch file by passing converted file path, this leads to below error:

root@kria:~/.ros/tracing# ros2 launch perception_2nodes analyse_rectify_resize.launch.py 
[INFO] [launch]: All log files can be found below /root/.ros/log/2022-08-08-12-19-32-941406-kria-348467
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: list index out of range

Can you please help in understanding what might be missing? Also can you share any example tracedata on which this analyze launch file works well? this would be helpful in comparison and narrowing down the issue.

shubhamnagla commented 1 year ago

After commenting all the non-CPU related code blocks after this line as well as un-commenting all the CPU related code in the plot function, I was able to generate the benchmark data for CPU only. However, I am still struggling with the streamline case. After examining the code a little it is found that even after giving the converted data to the file, which is further given to this msgsets_from_trace_concurrent it generates an empty list for the streamlined case. But, when I uncomment this msgsets_from_trace_start_end_streamlined, and update the previously mentioned function in this line also comment out the non-CPU/non-Streamlined related code after the line 1111. I am able to see the list generating out of msgsets_from_trace_start_end_streamlined, But most of the values are zeros. Further, when the code implementation reaches this line it gives the following error: [ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: list index out of range

PS: I and @yashwant-d are working together on this.