From f787bb2b5a3bb2988f851bddd5e438a6f408f867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Wed, 13 Sep 2023 11:57:51 +0200 Subject: [PATCH] Plan: staticdeps eval --- plan/60_staticdeps.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/plan/60_staticdeps.md b/plan/60_staticdeps.md index 36e133f..e87c3bd 100644 --- a/plan/60_staticdeps.md +++ b/plan/60_staticdeps.md @@ -113,7 +113,47 @@ On SKX, ### Dependencies detection -TODO +#### With valgrind + +* Instrument binary: + * for each write, add `write_addr -> writer_pc` to a hashmap + * for each read, fetch `writer_pc` from hashmap + * if found, add a dependency `reader_pc -> writer_pc` + * At the end, write deps file: + * `#occur, src_elf_pc, src_elf_path, dst_elf_pc, dst_elf_path` + * Run for each binary in genbenchs + +* For each binary in genbenchs, + * for each BB with more than 10% of max BB hits, + * predict deps with staticdeps + * check which dependencies are found/missed from the instrumented ones + * limitation: will only find deps from/to the same BB! Dependencies leaving + a BB are discarded. + +* Result: about 38% of deps found. + +* Cause: kernels executed in loops. + * No dependency in the kernel + ``` + while: + read (%rax) + %rax ++ + write (%rax) + ``` + * But dependencies if executed in a loop! "Unwanted" deps. + * and irrelevant in real life anyway: they are far away and will not cause + latency +* Fix: introduce dependency lifetime + * timestamp = instructions executed (VG instrumentation, added up at the + end of each BB) + * lifetime fixed to 1024 instructions + * dependencies are discarded if written to more than a lifetime ago + +* Result: about (?? TODO) of deps found + +#### With Gus + +TODO ? ### UiCA enriching