Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions Framework/Core/scripts/dpl-tune/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Python 3 standard library only.
| option | changed when | metrics used |
|---|---|---|
| `--aod-memory-rate-limit` | the devices are mostly idle and few TFs are in flight | `total-timeframes-in-flight`, `table-bytes-*-created`, `total_wall_time_ms` |
| `--pipeline dev:N` | one device is the slowest by at least 1.3x and can be pipelined | `total_wall_time_ms`, `cpuUsedAbsolute` |
| `--pipeline dev:N` | one device is the slowest by at least 1.3x and can be pipelined, or the devices within 1.3x of it can all be, and pipelining them together gains 1.3x | `total_wall_time_ms`, `cpuUsedAbsolute` |
| `--readers` | the AOD reader becomes the slowest device | `total_wall_time_ms`, `aod-file-read-info` |
| `--timeframes-rate-limit` | an explicit limit would cap the TFs in flight | `total-timeframes-in-flight` |
| `--shm-segment-size` | only raised, to twice the in-flight data | sampled shared memory, `arrow-bytes-delta` |
| `--timeframes-rate-limit` | analysis: an explicit limit would cap the TFs in flight; reconstruction: the limit binds while the devices are idle (measured, or inferred when the TFs in flight are not in the metrics), or the probe exceeds the budget | `total-timeframes-in-flight`; reconstruction: `performed_computations` of the reader, `total-timeframes-consumed`, else the busy times along the topology's critical path |
| `--shm-segment-size` | only raised, to twice the in-flight data | sampled shared memory, `arrow-bytes-delta`, `total_bytes_out` |

The steady state is taken from the first to the last completed TF
(`total-timeframes-consumed`). The throughput is modelled as limited by the
Expand Down Expand Up @@ -75,6 +75,9 @@ dpl-tune run workflow.json --inputs inputs.txt --files 4 --tuning out/tuning.jso
Install with `pip install ./Framework/Core/scripts/dpl-tune/` to get a
`dpl-tune` command, or run `python3 dpl_tune.py` directly.

`python3 -m unittest` in this directory runs the tests, on a synthetic
reconstruction (no O2 needed).

## Outputs

- `tuning.md`: the changes with the numbers behind them, the observations, the
Expand All @@ -91,11 +94,21 @@ Install with `pip install ./Framework/Core/scripts/dpl-tune/` to get a
plus the resident size of the shared-memory segment). The sum is an upper
bound: shared pages are counted once per process touching them. On Linux PSS
is read from `/proc/<pid>/smaps_rollup`, which counts them once.
- **Reconstruction**: only `--pipeline` is tuned, and only when a device is
busy most of the time. The TFs in flight, the shared memory free and the
dropped messages are not in `performanceMetrics.json`, so
`--timeframes-rate-limit` and `--shm-segment-size` cannot be tuned for
reconstruction without more metrics.
- **Reconstruction**: `--timeframes-rate-limit` and `--shm-segment-size` need
the TFs in flight, which O2 writes to `performanceMetrics.json` only since
"DPL: dump the rate limiting and drop metrics". With an older O2 the driver's
`total-timeframes-in-flight` is negative (only the AOD reader counts the TFs
read), so it is ignored, and whether the configured limit binds is inferred
with Little's law: the busy times per TF along the critical path of the
topology, a lower bound of the latency, against the limit times the observed
s/TF. The memory per TF is then the shm segment size over the limit, an
upper bound, unless the shm or `total_bytes_out` metrics give it; the
segment is scaled with the limit. `tuning.md` says when the limit is inferred.
A TF source (e.g. the CTF reader) waits in its callback for the TF rate
limit, so its CPU time, not its wall time, is used as its busy time.
`performed_computations` is published at most every 5 s, so the TFs in
flight are sampled coarsely. `tuning.md` lists dropped computations and
messages, missing resource offers and whether the TF limit binds.
- **Readers guard**: in the O2 versions tested, `--readers` > 1 combined with
`--aod-memory-rate-limit` deadlocked (the readers wait for AOD memory offers
that never come). When a verification with both fails, the extra readers are
Expand Down
Loading