conclude_performance() crashes when test_iterations is 1 or 2

Đang mở Phù hợp với người mới
#44 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
performance, testing-qa

Hướng nghiên cứu

Bắt đầu tại khối cắt tỉa quanh dòng 201 của ros2_benchmark/ros2_benchmark/basic_performance_calculator.py trong conclude_performance(), và làm theo điều kiện bảo vệ len(metric_value_list) > 2 đã dùng trong utils/nvidia_smi_profiler.py. Tái hiện bằng rclpy giả lập (stub) và một hoặc hai lần lặp tổng hợp chạy qua calculate_performance() rồi conclude_performance(). Lưu ý test/benchmark_pol.py dùng chế độ TIMELINE nên không bao giờ chạy đường này. Hoàn thành khi 1, 2 và 3 lần lặp đều báo cáo số liệu thay vì ném ngoại lệ. Người báo lỗi đã đề nghị mở PR; hãy kiểm tra xem đã có PR chưa trước khi bắt đầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

BasicPerformanceCalculator.conclude_performance() always drops the highest and the lowest value of each metric before averaging (ros2_benchmark/ros2_benchmark/basic_performance_calculator.py, around line 201):

# Remove the best and the worst before concluding the metric
metric_value_list.remove(max(metric_value_list))
metric_value_list.remove(min(metric_value_list))

With test_iterations: 1 or 2 there is nothing left after that, so the run fails at the very end, after all iterations have finished, and no results file is written:

  • test_iterations: 1 -> ValueError: min() arg is an empty sequence
  • test_iterations: 2 -> ZeroDivisionError: division by zero (for the mean metrics)
  • test_iterations: 3 and up work

This is hit in LOOPING (the default), SWEEPING and LIVE modes, which call conclude_performance() after the iteration loop in ros2_benchmark_test.py. TIMELINE mode does not call it, which is probably why test/benchmark_pol.py (TIMELINE, test_iterations=1) does not show it.

The resource side already handles this: utils/nvidia_smi_profiler.py only trims when len(metric_value_list) > 2.

To reproduce without ROS, load the module with a stub rclpy, feed one or two iterations of synthetic timestamps to calculate_performance(), then call conclude_performance():

1 FAIL ValueError min() arg is an empty sequence
2 FAIL ZeroDivisionError division by zero
3 ok 111.11

Expected: with one or two iterations, report the metrics over those iterations, same as the resource profiler does. Using the same > 2 guard here would fix it. I can open a small PR for that.

Ngôn ngữ chính
Python
Star
145
Fork
18
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA-ISAAC-ROS/ros2_benchmark

Tất cả issue của NVIDIA-ISAAC-ROS/ros2_benchmark

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.