Skip to content

Add deterministic emulator timing and stage profiling#93

Draft
Happymic wants to merge 2 commits into
feat/routed-moe-emulator-substratefrom
feat/emulator-timing-core
Draft

Add deterministic emulator timing and stage profiling#93
Happymic wants to merge 2 commits into
feat/routed-moe-emulator-substratefrom
feat/emulator-timing-core

Conversation

@Happymic

@Happymic Happymic commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What This PR Does

This PR makes emulator timing repeatable and auditable. It adds the core machinery we need before measuring MoE workloads: deterministic event ordering, cycle/byte attribution, and timing golden checks.

Concrete Changes

  • Makes runtime event ordering deterministic so repeated runs produce the same timing.
  • Adds cycle-level stage-profile fields, including resource/busy/wait-style accounting needed by later MoE timing reports.
  • Adds HBM/Ramulator accounting hooks used to compare logical bytes with physical emulator traffic.
  • Adds timing golden workloads and a checker that fails when cycles or HBM bytes drift.
  • Extends emulator runner metadata so timing runs can be traced back to workload/build settings.

Why This Is Separate

This is the foundation PR for the timing stack. It does not introduce Qwen traces or representative experiments yet; it only makes the emulator timing path stable enough for those later PRs.

Validation

Ran locally:

nix develop -c bash -lc 'cd transactional_emulator && cargo build --release && cargo test --workspace --release'

export PLENA_ROOT=/path/to/plena
export PYTHONPATH="$PWD:$PWD/PLENA_Compiler:$PWD/PLENA_Tools:$PWD/transactional_emulator/testbench${PYTHONPATH:+:$PYTHONPATH}"
python3 transactional_emulator/testbench/timing_goldens/check_timing_goldens.py --plena-root "$PLENA_ROOT"

All timing goldens matched.

@Happymic Happymic changed the title Add emulator timing core attribution and deterministic goldens Add deterministic emulator timing and stage profiling Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant