Context
Comparing Legion with another task-based runtime. I've been benchmarking both systems on the same machine and would like to confirm whether the scaling behaviour I'm seeing is expected, or whether I'm misconfiguring something on my side.
Setup
- Hardware: single node, AMD EPYC 7282 (2 sockets, 64 logical CPUs), 125 GB RAM
- Legion: 25.09.0, built in Release (
-O3 -DNDEBUG), with hwloc enabled
- Realm: built separately, Release, installed and linked via
find_package
- Launch: one process per node,
-ll:cpu N -ll:util 1 -ll:bgwork 1, pinned with taskset -c 0-(N+1) so that every worker/utility/bgwork thread gets its own core
- Verification: every benchmark result is checked against a precomputed reference value
Benchmarks
Four benchmarks, all with identical algorithms and parameters on both systems:
- Fibonacci — recursive task splitting, cutoff = n/2 (very fine-grained, ~33M tasks at n=50)
- N-Queens — recursive backtracking, spawn-then-prune (fine-grained)
- Synthetic checksum — one task per point, ~1M work iterations per task (coarse-grained)
- LCS — longest common subsequence, deep task trees
Observed scaling (median of 5 runs, speedup from 1 worker to 32 workers)
| Benchmark |
Legion speedup ll:cpu N (1→32) |
| Fibonacci |
0.54× (gets slower) |
| N-Queens |
0.22× (gets slower) |
| Synthetic (coarse) |
3.5× (scales) |
| LCS |
0.30× (gets slower) |
So Legion scales positively only on the coarse-grained benchmark, and negatively on all fine-grained ones.
What I'd like to confirm
- Is this negative scaling on fine-grained, CPU-only tasks expected for Legion/Realm? I understand Realm has a per-task overhead floor (I recall the ~50 µs figure from Task Bench discussions), and that more workers can increase contention on the runtime's internal structures (completion queues, dependence analysis, locks). Is that the right way to think about it?
- Is there anything in my configuration that would make this worse than it should be — e.g. the
-ll:util 1 -ll:bgwork 1 choice, the single-process-per-node setup, or the taskset pinning?
Thanks in advance for any clarification.
The benchmark implementations can be found here:
The upload for cpp files didn't work, so I pasted them in pastebin.
Fib
N-Queens
Syntetic
LCS
Context
Comparing Legion with another task-based runtime. I've been benchmarking both systems on the same machine and would like to confirm whether the scaling behaviour I'm seeing is expected, or whether I'm misconfiguring something on my side.
Setup
-O3 -DNDEBUG), with hwloc enabledfind_package-ll:cpu N -ll:util 1 -ll:bgwork 1, pinned withtaskset -c 0-(N+1)so that every worker/utility/bgwork thread gets its own coreBenchmarks
Four benchmarks, all with identical algorithms and parameters on both systems:
Observed scaling (median of 5 runs, speedup from 1 worker to 32 workers)
So Legion scales positively only on the coarse-grained benchmark, and negatively on all fine-grained ones.
What I'd like to confirm
-ll:util 1 -ll:bgwork 1choice, the single-process-per-node setup, or thetasksetpinning?Thanks in advance for any clarification.
The benchmark implementations can be found here:
The upload for cpp files didn't work, so I pasted them in pastebin.
Fib
N-Queens
Syntetic
LCS