Conversation
Adds the UniRL side of the optional AISimulate/Dynamo Replay integration: a versioned manifest/workload/measured-outcome contract (stdlib only) and the workload-to-replay converter for the open-loop and dependency-arrival contracts. Keeps measured outcomes unreachable from the converter, refuses unsupported lifecycles and incomplete captures instead of trimming them, distinguishes a zero wait from an unknown one, and labels trajectory-slot and collector-barrier semantics as unmodelled rather than inventing a representation. Refs Tencent-Hunyuan#483 (measurement tooling)
0z5a
requested review from
CjhHa1,
celve and
leviking98z-rgb
as code owners
September 18, 2026 07:52
Collaborator
|
Same note as on #484: we currently only have H20. If the Replay / AI Configurator tables have no calibrated H20 profile, I don't think this adapter should land yet — the H20 data would need to come first, otherwise we cannot validate replay against real execution. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incremental review: Files changed against
main.Summary
Adds the UniRL side of the optional AISimulate / Dynamo Replay integration proposed in #484:
a versioned trace contract and the workload-to-replay converters, with their CPU contract
tests. It is deliberately the half that can be built and verified without a simulator.
experimental/aisim/schema.py— the trace contract, stdlib only:manifest(configuration and provenance),workload(what apredictor may read), measured outcomes (report-only). The separation is structural, not
conventional: no converter function accepts a measured result.
where an int belongs, missing lengths, unknown ids, self-referential or missing
predecessors, dependency cycles and unsupported status.
external_delay_ms(0.0must be writtendeliberately), and a first-turn request carries an absolute release offset instead of a
fabricated predecessor, so a missing wait can never be read as a zero wait.
failed/aborted/partial/retry/cancelledterminations raise instead of beingdropped, and
capture_status="incomplete"cannot produce a fidelity run.experimental/aisim/convert.py— the converters:to_open_looppreserves observed arrivals verbatim (rebased to a recorded origin) and addsno
session_id, nowait_forand no synthesised tool wait; it also refuses to run under adependency contract and refuses a window that mixes both arrival kinds.
to_dependencyemits predecessor-plus-external-delay entries and keeps measured service timeout of the predictor input;
assert_no_outcome_leakagere-checks the converted rows.slot_semantics="not_modelled"andbarrier_semantics="not_modelled"rather than inventing arepresentation that would make the replay look more faithful than it is.
Deliberately absent:
runner.pyandrequirements.txt. The runner is the only file allowed toimport a simulator API, and it should land once a pinned simulator revision is confirmed instead
of being written against a guessed interface.
Related Issue
Refs #484. This is the adapter slice of that RFC; the RFC itself stays open for the interface
and profile questions it asks maintainers.
Test Plan
Environment:
jk01, 8× L20 (driver 570.86.10), torch 2.11.0+cu128, base SHAf8d95462837df00188dab1376e19347b43996307.Lint and guards:
CPU contract harness (repo-external, not committed), 18/18 not-FAIL — 16 PASS, 2 NOT_RUN:
Capability probe that scopes this PR (P0 of the RFC, recorded in the evidence directory):
import dynamo|aisimulate|spica→ModuleNotFoundErrorfor all three; no such package inpip list; no AISimulate/Spica reference anywhere in the checkout; the two documented Dynamopages and the
ai-dynamoPyPI name do resolve. Hence: contract and converters only, everythingsimulator-facing
NOT_RUN.Compatibility / Risk
experimental/; no existing module imports it, no core file is touched, andno dependency is added (stdlib only). Normal training is unchanged and the package can be
deleted without a trace.
SCHEMA_VERSION(unirl.rollout.trace.v1) is stamped into every record and into the manifest;a field rename is a breaking change for the evidence artifacts, not for the runtime.
hook does not exist yet, which is why every capture-dependent claim is left
NOT_RUN.Reviewer Notes
simulator): no PR claims a simulator integration, and
"AISimulate"returns zero results. Theclosest replay work (feat(diffusion): batch video replay timesteps #394, perf(bagel): pack FlowGRPO replay steps #384, feat(flowgrpo): add bounded-memory chunked replay backward #465) is training-side batching and is unrelated.
to_open_loop's refusal paths andassert_no_outcome_leakage— they arethe two places that keep a predictor from being handed the answer.
interface is first, and whether the chosen runner can emit per-request completions at all. The
adapter reports
AGGREGATE_ONLYrather than reconstructing group tails from percentiles if itcannot.