conclude_performance() crashes when test_iterations is 1 or 2
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- performance, testing-qa
Research direction
Start at the trimming block around line 201 of ros2_benchmark/ros2_benchmark/basic_performance_calculator.py in conclude_performance(), and mirror the len(metric_value_list) > 2 guard already used in utils/nvidia_smi_profiler.py. Reproduce with a stubbed rclpy and one or two synthetic iterations through calculate_performance() then conclude_performance(); note that test/benchmark_pol.py uses TIMELINE mode and so never exercises this path. Done means 1, 2 and 3 iterations all report metrics instead of raising. Note the reporter has offered to open a PR, so check for one before starting.
Written by the indexing model from the issue text.
Description
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 sequencetest_iterations: 2->ZeroDivisionError: division by zero(for the mean metrics)test_iterations: 3and 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.
- Dominant language
- Python
- Stars
- 145
- Forks
- 18
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA-ISAAC-ROS/ros2_benchmark
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in NVIDIA-ISAAC-ROS/ros2_benchmark
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
py-econometrics/pyfixest#2072 ·
Maintainers usually reply within 1 day
-
~planning docs
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Kromatic-Innovation/athenaeum#3084 ·
Maintainers usually reply within 1 day
-
Bosch Room Thermostat II number entities offer -500 to 3000 °C setpoint limits and a -32768 to 32767 °C outdoor temperaturePossibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zigpy/zha-device-handlers#5769 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 80/100
R0Y00/Xbox2Windows#254 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kludex/python-multipart#375 ·
Maintainers usually reply within 1 day