Fix prod_set div-by-zero on fast CPUs and nice -n -20 EPERM in unprivileged guests#755
Closed
charles-typ wants to merge 1 commit into
Closed
Conversation
…ileged guests Summary: Two robustness fixes to the WDL prod_set runner, both hit while running the suite on a fast Arm (Olympus) host and inside an unprivileged VM guest. Problem 1 - scoring crash on fast cores. concurrency_concurrent_hash_map_bench and synchronization_lifo_sem_bench fail with "score: error (float division by zero)". On fast CPUs some sub-metrics (e.g. single_thread_lifo_trypost/trywait, CHM empty()/size() ops) complete in 0 ns, below the timer resolution. compute_score_from_time then does sum_baseline[key] / sum_c[key] and raises ZeroDivisionError, losing the whole workload's score. A 0 ns sample is not a real data point, so we skip those keys (the geomean of the remaining sub-metrics is still valid). If every sub-metric is 0, geomean([]) raises and the existing main() handler already reports a per-benchmark error without aborting the set. Problem 2 - nice -n -20 EPERM. run_prod.sh hard-codes nice -n -20, which needs root/CAP_SYS_NICE. In an unprivileged environment (e.g. a VM guest) every workload invocation fails with EPERM. We now probe nice -n -20 once and fall back to default priority when it is not permitted, so the run proceeds instead of failing. Differential Revision: D111817632
|
@charles-typ has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111817632. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Jul 14, 2026
…ileged guests (#755) Summary: Pull Request resolved: #755 Two robustness fixes to the WDL prod_set runner, both hit while running the suite on a fast Arm (Olympus) host and inside an unprivileged VM guest. Problem 1 - scoring crash on fast cores. concurrency_concurrent_hash_map_bench and synchronization_lifo_sem_bench fail with "score: error (float division by zero)". On fast CPUs some sub-metrics (e.g. single_thread_lifo_trypost/trywait, CHM empty()/size() ops) complete in 0 ns, below the timer resolution. compute_score_from_time then does sum_baseline[key] / sum_c[key] and raises ZeroDivisionError, losing the whole workload's score. A 0 ns sample is not a real data point, so we skip those keys (the geomean of the remaining sub-metrics is still valid). If every sub-metric is 0, geomean([]) raises and the existing main() handler already reports a per-benchmark error without aborting the set. Problem 2 - nice -n -20 EPERM. run_prod.sh hard-codes nice -n -20, which needs root/CAP_SYS_NICE. In an unprivileged environment (e.g. a VM guest) every workload invocation fails with EPERM. We now probe nice -n -20 once and fall back to default priority when it is not permitted, so the run proceeds instead of failing. Reviewed By: YifanYuan3, ahmadelyoussef Differential Revision: D111817632 fbshipit-source-id: 6e132cf9f2e2a598e4a801e07711881718785bde
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Two robustness fixes to the WDL prod_set runner, both hit while running the
suite on a fast Arm (Olympus) host and inside an unprivileged VM guest.
Problem 1 - scoring crash on fast cores. concurrency_concurrent_hash_map_bench
and synchronization_lifo_sem_bench fail with "score: error (float division by
zero)". On fast CPUs some sub-metrics (e.g. single_thread_lifo_trypost/trywait,
CHM empty()/size() ops) complete in 0 ns, below the timer resolution.
compute_score_from_time then does sum_baseline[key] / sum_c[key] and raises
ZeroDivisionError, losing the whole workload's score. A 0 ns sample is not a
real data point, so we skip those keys (the geomean of the remaining
sub-metrics is still valid). If every sub-metric is 0, geomean([]) raises and
the existing main() handler already reports a per-benchmark error without
aborting the set.
Problem 2 - nice -n -20 EPERM. run_prod.sh hard-codes nice -n -20, which needs
root/CAP_SYS_NICE. In an unprivileged environment (e.g. a VM guest) every
workload invocation fails with EPERM. We now probe nice -n -20 once and fall
back to default priority when it is not permitted, so the run proceeds instead
of failing.
Differential Revision: D111817632