prain: pin the RAM tier per expert (big pinned blocks take minutes on eGPU hosts); sim charges disk reads on the CPU path; measure CPU cost on cold experts
This commit is contained in:
@@ -57,6 +57,14 @@ class Simulate(unittest.TestCase):
|
||||
copy = self.run_sim().ms_per_decode
|
||||
self.assertLess(self.run_sim(miss=Miss(mode="auto")).ms_per_decode, copy)
|
||||
|
||||
def test_cpu_path_pays_the_disk_read_of_disk_experts(self):
|
||||
on_disk = {layer: LayerPlacement((), (), tuple(range(32)), 3) for layer in range(4)}
|
||||
cpu = Miss(mode="cpu", admit=0)
|
||||
ram = simulate(self.forwards, all_ram(3), Policy(), Prefetch(), cpu, Cost())
|
||||
disk = simulate(self.forwards, on_disk, Policy(), Prefetch(), cpu, Cost())
|
||||
self.assertAlmostEqual(disk.total_ms - ram.total_ms, ram.counters["cpu"] * Cost().read_ms(),
|
||||
places=3)
|
||||
|
||||
def test_prefetch_helps_when_predictions_are_right(self):
|
||||
none = self.run_sim().hit_rate
|
||||
good = self.run_sim(prefetch=Prefetch(mode="pregate", budget=4))
|
||||
|
||||
Reference in New Issue
Block a user