harness: each creation row's first is a fresh object's on a device that has made one of its kind
A creation row's first sample was the first of its kind in a fresh process, so it held the device's own first use (its first recorder, submission, upload, staging region, stamp pool) together with the object's. A guest keeps one device for the machine's life, so what a device pays once never reaches it. The planner ruled that every first row is judged on a new object's first use on a warm device. Each creation row now makes a warm-up of its kind first, made and used as the first is and kept until the first is done, then the timed first on a fresh object: - Shared and Private buffers: a buffer of the same length, kept, so the first takes memory the warm-up did not give back (a new 16 MiB Private block on rt's harness placement); the next take still follows the first's release. - compute states: a state of another authored kernel (lcg_step, bound as signed_zero_products is), created and dispatched once, its word checked; - render states: a state of another fragment function (sampled_fragment) with the row's vertex function and attachment. The warm-up's time is its own record, `<row>/device_first`. The matrix shows it with the ratio of its medians and never judges it (results.SHOWN_FIRST now names each shown sample with its reason). time_states takes the first as its caller timed it; its other form had no caller left. Tests: a host-buffer device shows the buffer row's order (the warm-up alone, the first and the next beside it, the timed ones alone); the matrix shows a warm-up and judges the first it comes before; the device test checks every row records its warm-up.
This commit is contained in:
1 parent
fe30952248
commit
99ec109264
9 files changed
+258
-69
No files matched your search
@@ -644,16 +644,23 @@ def past_limit(leg_id, row, gpu=False):
|
||||
#: store, so no row before them moves their times.
|
||||
HARNESS_CREATES = "create_"
|
||||
#: A creation row's first samples (`<row>/first`, `/first_take`, `/next_take`,
|
||||
#: `/first_allocation_total`) are one sample per process, so harness_budget judges each by the
|
||||
#: median of FIRST_RUNS processes per runtime: the first process's own record and the later
|
||||
#: processes' `harness-first/<row>/<n>/<runtime>`. A first sample alone is never past its limit.
|
||||
#: `/first_allocation_total`, `/device_first`) are one sample per process, so harness_budget judges
|
||||
#: each by the median of FIRST_RUNS processes per runtime: the first process's own record and the
|
||||
#: later processes' `harness-first/<row>/<n>/<runtime>`. A first sample alone is never past its
|
||||
#: limit.
|
||||
FIRST_RUNS = 5
|
||||
HARNESS_FIRST = "harness-first/"
|
||||
#: A compute creation row's `/first` sample is its creation and one dispatch through to completion,
|
||||
#: as Metal compiles at the creation and a runtime may compile at the dispatch instead (the old
|
||||
#: runtime does); its `/first_call` sample, the creation call alone, is shown beside it with the
|
||||
#: ratio of its medians, and never judged.
|
||||
SHOWN_FIRST = "/first_call"
|
||||
#: runtime does). A creation row's first sample is a fresh object's on a device that has made one of
|
||||
#: its kind: the harness makes a warm-up of the row's kind first. The first samples SHOWN_FIRST
|
||||
#: names are shown with the ratio of their medians, and never judged, each for its reason: the
|
||||
#: creation call alone (`/first_call`), and the warm-up (`/device_first`), which holds what the
|
||||
#: device pays once, which a guest that keeps its device pays once in its life.
|
||||
SHOWN_FIRST = {
|
||||
"/first_call": "the creation call alone, which old returns from before it makes its pipeline",
|
||||
"/device_first": "the warm-up, the first object of its kind on the device",
|
||||
}
|
||||
#: The sed program the first creation process's output goes through: its device's gauges at drop
|
||||
#: become `harness-<runtime>/creates/device/...`, apart from the other rows' process's, so each
|
||||
#: key is recorded once.
|
||||
@@ -796,13 +803,13 @@ def harness_budget(leg_id, leg):
|
||||
gated, named = instruction_gate(leg_id, row, records)
|
||||
problems += gated
|
||||
parked += named
|
||||
if first_row(row) and row.endswith(SHOWN_FIRST):
|
||||
shown = next((why for end, why in SHOWN_FIRST.items() if row.endswith(end)), None)
|
||||
if first_row(row) and shown:
|
||||
samples = first_samples(times, row)
|
||||
if samples is not None:
|
||||
old, new = (statistics.median(values) for values in samples)
|
||||
parked.append(f"harness budget {row}: median of {FIRST_RUNS} processes, new {new:.1f} us "
|
||||
f"over old {old:.1f} us is {new / old:.3f}: shown, not judged: the creation "
|
||||
"call alone, which old returns from before it makes its pipeline")
|
||||
f"over old {old:.1f} us is {new / old:.3f}: shown, not judged: {shown}")
|
||||
continue
|
||||
if first_row(row):
|
||||
samples = first_samples(times, row)
|
||||
|
||||
@@ -523,6 +523,22 @@ class HarnessBudgetTests(unittest.TestCase):
|
||||
one = {f"harness-old/{row}": 1000.0, f"harness-new/{row}": 5000.0}
|
||||
self.assertEqual(self.budget("a", one), ([], []))
|
||||
|
||||
def test_a_warm_up_is_shown_beside_the_first_it_comes_before_and_never_judged(self):
|
||||
row = "create_private_16MiB/device_first"
|
||||
times = {f"harness-old/{row}": 1000.0, f"harness-new/{row}": 3000.0}
|
||||
for n in range(2, results.FIRST_RUNS + 1):
|
||||
times[f"{results.HARNESS_FIRST}{row}/{n}/old"] = 1000.0 + n
|
||||
times[f"{results.HARNESS_FIRST}{row}/{n}/new"] = 3000.0 + n
|
||||
with mock.patch.object(results, "HARNESS_CEILINGS", {}):
|
||||
self.assertEqual(self.budget("a", times), ([], [
|
||||
f"harness budget {row}: median of 5 processes, new 3003.0 us over old 1003.0 us is 2.994: "
|
||||
"shown, not judged: the warm-up, the first object of its kind on the device"]))
|
||||
# The first it comes before is judged.
|
||||
first = {key.replace("/device_first", "/first_take"): us for key, us in times.items()}
|
||||
self.assertEqual(self.budget("a", first), ([
|
||||
"harness budget create_private_16MiB/first_take: median of 5 processes, new 3003.0 us over "
|
||||
"old 1003.0 us is 2.994, past 1.03"], []))
|
||||
|
||||
def test_the_creation_processes_record_each_key_once_beside_the_other_rows(self):
|
||||
others = ["M2V-MATRIX time harness-new/alu 10.000", "M2V-MATRIX gauge harness-new/device/blocks@drop 0"]
|
||||
creates = ["M2V-MATRIX time harness-new/create_64MiB 700.000",
|
||||
|
||||
Reference in new issue
Block a user