Skip to content

Add deterministic emulator timing and stage profiling#93

Closed
Happymic wants to merge 2 commits into
mainfrom
feat/emulator-timing-core
Closed

Add deterministic emulator timing and stage profiling#93
Happymic wants to merge 2 commits into
mainfrom
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
@qichao-arlo-wang
qichao-arlo-wang force-pushed the feat/routed-moe-emulator-substrate branch from 978948b to 0a4d268 Compare July 22, 2026 20:30
Base automatically changed from feat/routed-moe-emulator-substrate to main July 22, 2026 20:39
@qichao-arlo-wang
qichao-arlo-wang force-pushed the feat/emulator-timing-core branch from a14ba62 to ca77bb1 Compare July 22, 2026 23:41
# Conflicts:
#	transactional_emulator/src/stage_profile.rs
@qichao-arlo-wang
qichao-arlo-wang force-pushed the feat/emulator-timing-core branch from ca77bb1 to 65d25e9 Compare July 22, 2026 23:44
Deterministic event ordering (executor sequence_id tie-break, ordered HBM
gather/transfer issue) plus a run-to-run repeat gate and cycle-latency
reporting. Original golden-drift fixture was dropped: it depended on
out-of-repo build artifacts and was not CI-runnable.
@qichao-arlo-wang

Copy link
Copy Markdown
Collaborator

Superseded by #97, which consolidates the MoE timing-replay stack (#93#96) into a single branch against main with the review findings fixed. Closing in favor of #97 (CI green).

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.

2 participants