Repository navigation
[TRTLLM-16460][feat] agent-flow: trtllm_modeling_v2 workflow for gated ModelingV2 onboarding and perf tuning - #20145
Wanli-Jiang wants to merge 13 commits into
Conversation
| @@ -0,0 +1,129 @@ | |||
| --- | |||
| name: staircase-modeling-disagg | |||
| description: Load when a target must work under disaggregated serving — prefill on one engine, decode on another, with per-sequence state transferred between them. The modeling duty is that EVERY piece of per-sequence state prefill produces is in the transferable set, which for a hybrid model is not just the attention KV pages. | |||
There was a problem hiding this comment.
Thanks for putting all these together.
-
Lets try to rename staircase to "trtllm_modeling_v2"?
-
One open question. Shall each feature have its own skill or it should be part of the main skill with reference doc on how each feature shall be implemented?
There was a problem hiding this comment.
updated codes and comments in #20145 (comment)
|
I am still understanding and reviewing the code in the workflow section. Regarding the "skills" section, I do not recommend incorporating these skills into the repo. The previous experience of the modeling agent tells us that, first, detailed skills may limit the model's performance. Second, the large amount of information carried in the skills is difficult to maintain, and errors and outdated information will become difficult to manage. We can first place them in an internal small repo. If there are clear AB tests proving that this is effective, then we can incorporate them into the repo. |
ad3e732 to
6490d8b
Compare
|
Thanks both for the reviews. I've force-pushed an updated branch: it is rebased onto main now that #19977 has merged (so only this PR's own commits remain), aligned with modeling_v2 as merged, and it adds the
Both concerns are fair, and this week gave a concrete example of the second: aligning with modeling_v2 as merged meant rewriting 32 skill documents. Some context on how these skills differ from
Proposal, and I'd like your view before I change the code:
I lean towards (a) for this PR plus the A/B as a follow-up, but would go with (b) if you'd rather keep the detailed text out of the repo until there is data. Which do you prefer? |
6490d8b to
58c446b
Compare
69cd243 to
27d849b
Compare
…the organization accepts
The agent SDK launches its bundled CLI binary, which only moves when the
SDK is upgraded; an organization that requires a newer CLI then refuses
every in-process turn at start-up ("older than the minimum version
required by your organization"). A layer now launches the CLI named by
the backend's CLI-path environment variable, or else the CLI on PATH when
it is newer than the bundled one, and otherwise keeps the SDK's choice.
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…nfiguration variants The spec a run starts from, validated before any agent is constructed: - spec/task_schema.py: the task.yaml schema with closed keys and batched errors: checkpoint, units and features, parallel members, the serving envelope, accuracy workloads and floors, runtime blocks, sessions, the launch environment, source embargo, agents and the perf block. - spec/intake/: `trtllm-modeling-v2 intake check|confirm|compile`. A user-facing task.yaml is checked against its checkpoint and device, confirmed (and the run refuses one changed since), and compiled with a per-cluster site.yaml into the resolved spec. - spec/variants.py: configuration variants, a unit's target served under another configuration, as members of their own. - task.example.yaml documents every key. - spec/intake/derive.py: the fast path. `--checkpoint <hf_dir> --site site.yaml --goal "..."` derives the request from config.json, the site's device and defaults blocks and a one-line goal, compiles it with per-unit options, discriminators and per-member perf configs, and starts the run; its intake checks are the first part of phase 0, and confirmation is a sidecar file. - Task validation refuses a TMPDIR too long for the LLM API's unix socket. - `coverage.accept` names requested cells the run accepts leaving uncovered; `knowledge: production|measurement` chooses what earlier runs' knowledge applies; a storage variant boots at every member of its unit. - accuracy.anchor: pending (per unit or variant): the benchmark is no check, the logit gate is the oracle, and delivery stays incomplete until a written anchor is recorded. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…scheduler and command execution Where GPU work runs. A compute session is a Slurm allocation that runs a spool scheduler; jobs are files in its spool: - infra/substrate/scheduler.py: a priority queue over device slots with wall and memory limits and a scrubbed MPI environment; a device is quarantined until its memory is released; a job lost with its allocation runs again or is closed out node_lost; a native rebuild is held until the jobs that map the libraries are done (rebuild.py). - spoolctl.py: submit, launch, wait, status and cancel, also runnable by path from a shell without the CLI. placement.py routes a job to a session that can run it now and lets it borrow idle devices. - sessions.py and cli.py: sessions declared in task.yaml, their entry scripts and their hand-over; watchdog.py returns when one needs a human. - provenance.py and the resolve hook record which checkout every process of a job imported, so a job with mixed checkouts is refused. - infra/execution/: one command or one agent turn as a request and an outcome, run here or through a spool, and how many checks and tasks the sessions' free devices admit. - Within a priority, pending jobs run in the order they were queued (mtime, then a queue stamp), and a native rebuild also holds jobs whose native build is linked into the rebuilt checkout. - infra/execution/agent_gate.py: one cap on the agents working at once, slots granted by priority (planner, critical, required, side, background). Every role turn takes a slot, one stays free for the planner, and background turns take only idle slots. - The planner's reserved slot takes nothing from the tasks; critic and improver turns use only the slots the foreground work leaves idle (or the next one free after 20 minutes). - A queued gate moves to a session that would start it now (an atomic rename, so it never runs twice), and a dev session lends its free devices while nothing of the campaign's own runs there. - A session near its end judges a job by how long such jobs ran (twice the 90th-percentile of its spool's history), not by its worst-case wall limit. - incremental_build.sh builds from a venv of its own that sees the run's packages, and fails if the run's venv changed under it. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…mits and the external transport - infra/environment.py: the launch environment, resolved once into the command prefix every role's prompt carries. - infra/vcs.py: questions to git about a checkout, asked with an argv and no optional locks. - infra/committer.py: commit.sh for concurrent agents: it commits and signs off as the repository's user and refuses symlinks, placeholders and out-of-policy paths. - infra/transport.py and infra/driver/: the external agent transport. A role turn is written as files and answered by a driver session (`trtllm-modeling-v2 driver wait|claim|prompt|answer|status|reload`); the orchestrator keeps a heartbeat, so a driver sees it exit, and a reload drains it and re-executes it on the current flow code. - A one-rank command runs its worker in process (TLLM_WORKER_USE_SINGLE_PROCESS), derived by the environment so every command and the prompt's prefix agree. - A turn a stopped process left is adopted only for the work it was for (TurnRequest.work), never by another task asked the same words. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…the runtime map and delivery checks What onboarding a checkpoint knows before and after the agents run: - onboard/survey.py: what the checkpoint demands and what this build already supplies, read off disk without importing the engine, including the installed FlashInfer's public callables. - onboard/vocabulary.py: vocabulary.yaml, the survey's machine-readable product: each computation step mapped to a catalog entry, a queue row to onboard, or a gap. - onboard/runtime_map.py with runtime_index.yaml and kernel_sources.yaml: which engine area a checkpoint needs, where it lives, and which kernel source each catalog entry draws on. - onboard/delivery.py: the agents' claims checked against disk: the catalog's executable contract (CELLS, ARCHS), target selection over PrefillTarget/DecodeTarget, the W-row weight table and the routing. - onboard/embargo.py and logit_reference.py: source_embargo entries, and the Hugging Face reference's per-position predictions for the logit gate. - onboard/coverage.py: a certification whose cells the entry's CELLS already hold closes without a smith turn. - onboard/promotion.py: kernel rows on a shared catalog entry land as target-local variants so they run in parallel; one promote task merges them into the catalog, and delivery checks that none is left (`ops:promoted`). - Promotion is per entry: an entry's variants are promoted once they landed and the target imports them, beside the feature work. - A promote declares only the files it rewrites (the target's tests that import a variant included), cells-only variants beside a catalog call are due at once, and its dispatch names the variants' smith reports. - The vocabulary holds one row per shared entry, every call site's shapes as its cells; delivery fails accuracy:reference while the anchor is pending; the logit reference trusts a checkpoint that ships its own code unless told not to. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…ses and their harness Checks are commands with exit codes, never agent judgements. Every one runs with modeling_v2=require and attests the engine it ran: - checks/gates.py: boot (the declared workload, matched on generated text; a multimodal target gets an image), accuracy (trtllm-eval against the anchor with an anchor - k*SE floor and a cross-member finding) and acceptance (acceptance length on natural-text prompts, paired against the previous verdict). Each verdict records the engine's attested configuration, its pools, free memory and block-reuse hits. - checks/witness.py: features boot and accuracy cannot see (disagg equivalence, kv_quant, host offload, bounded replay) as two legs that differ in one variable. The equivalence witness uses natural prose, proves itself sensitive by an ablation leg, and pins attention-DP rank pairs. - envelope_boot.py, logit_agreement.py and serve_gate.py: the target at its declared limits, per-position log-probs against the HF reference, and trtllm-serve answering over HTTP. - checks/harness/: the programs the gates run under the measured tree's interpreter (engine driver, engine facts, reuse probe, eval and quickstart shims). - gate_cli.py: `trtllm-modeling-v2 gate <name>`, one gate run exactly as the orchestrator runs it, on a snapshot of a commit or on a tree. - checks/bundle.py and harness/bundle_driver.py: checks of one unit, member and snapshot that run the same engine share one engine start; each keeps its own verdict, and a failed section reruns singly. - Boot also compares greedy tokens against the HF reference when one exists. - harness/disagg_leg_b.py: the equivalence witness's leg B ships with the flow (rank pairs, an ablation leg), so no operator script is needed. - harness/geometry_probe.py: measures the serving geometry before kernels. - checks/testcache.py: a test-result cache keyed by the files each test read; `trtllm-modeling-v2 tests affected|compare` runs only what a change affects. - Every gate and job gets a per-run TRITON_CACHE_DIR unless the task sets one, and the generated affected-tests command carries a timeout. - checks/observables.py: per feature, the evidence a check must observe and the oracle it is judged by. A variant is about the engine fields its overlay sets; one it did not observe fails its boot. Every rank's worker prints its own engine record (harness/rankhook, first on PYTHONPATH), so a multi-rank member is never attested from llm.args. A chunked variant must serve a prompt it splits; without a stock speculator each draft depth must beat the one below; serve answers are held to the boot keywords. - The acceptance gate records a stock path that cannot load the checkpoint and skips that leg after; the test cache judges a process by its program; testcache.head_results says whether a file's tests pass at one commit. - A setting both launchers take (KV fraction and dtypes, tokens per block, max_num_tokens, trust_remote_code) is stated once and handed to the launcher that did not state it; trust_remote_code follows the checkpoint's auto_map. - Every process of a check writes the tree's Python modules it imported (the rank hook), and the gate result carries them. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
… the lessons store - agents/roles.py: the roles (planner, plan drafter, plan reviewer, smith, assembler, reviewer, tuner, improver) and which backend and model each runs on, routed per role through the spec's agents block. - agents/prompts/: each role's system prompt, kept to its contract and its traps; every prompt carries the resolved launch prefix, the embargo and the task's notes. - agents/lessons.py: lessons kept across runs by scope (all, role, host, family), validated before they are kept. A workflow_defect lesson files a flow issue, and a lesson is retired once the commit that fixed it is in the running flow. - The improver drafts patches for workflow defects (validated, never applied) and keeps `engine_defect` lessons naming their upstream fix, which preflight checks against the target tree. The planner links the core to kernel rows by soft edges, starts a width as a check task, answers FAILED/BLOCKED events first in a small revision and keeps its first turn to what can start now; a smith hands back a FAILED_RECEIPT as soon as the defect is in shared code; the improver reads only the checkout's HEAD history. - agents/decisions.py: one decision table, per role every decision, when to write it and what follows; each prompt's "Ending your turn" section, the enum and the orchestrator's finishing set are read from it. - Engine defects in the lessons store are keyed by what triggers them (affects, regime, detect, disposition), open until fixed upstream; `knowledge: measurement` leaves the registry and family lessons out. - The plan drafter writes one row per shared entry, its cells spanning the served envelope; smiths and assemblers list what they leave uncertified in their decision file, which reaches the planner. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
The skills each role materializes, kept to invariants and traps: core, parallel, kernel feasibility, kernel onboarding and verification (with integer-width probes and a test-cost budget per cell), speculators, multimodal, disaggregated serving, host offload, KV-cache quantization, bounded replay, and perf tuning. A run is handed them without any one checkpoint's specifics. Workers run only their own tests and those of the files they touch; the cross-model regression runs once, in the batched review task. The kernel skills take their certification scope from the dispatch and hand a defect outside the entry back early, with the structured engine_defect. - The promote procedure reads the reports of the smiths that landed the variants. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…, integration and run records - run/contract.py: every check a run owes, compiled from the resolved spec. A verdict is recorded under the fingerprint of the tree its check read; a pass is shared between checks that measure one engine, and a stale verdict runs again, riskiest first. - run/graph.py: the task graph, the planner's only output: task kinds, dependencies, the files a task touches, exclusive and nice_to_have tasks, attempts, and which ready tasks start. - run/integration.py: one sparse worktree per task, rebased onto the checkout and fast-forwarded in, so the checkout moves only by whole tasks; a conflict goes back to the task's worker, and a retry starts from the integration head. - run/snapshots.py: read-only snapshots of the checkout's commits, the trees contract checks measure, leased while a check runs. - run/receipts.py, runtime_facts.py: what a finished task hands the tasks that depend on it, and what the engines of passed gates ran. - run/state.py, journal.py, progress.py, drain.py: checkpointed state, the journal, typed decision files (the only channel an agent's verdict reaches the orchestrator through) and what a reload waits for. - The graph gains `check` tasks (checks with no agent turn) and soft dependencies (`depends_on_soft`: start early, integrate after the dependency lands); regression reviews cover batches of landed shared changes. - With the logit gate on, the accuracy benchmark runs at tp1, the widest member and attention-DP members; logits prove the others. - Every check carries an inputs digest (the spec as it applies to its unit, file contents outside the checkout); a verdict on other inputs is stale. Options are compared by content, and acceptance checks share verdicts. - One full-support predicate; a check that raises leaves its task landed and runs again; the decision enums are the decision table's. - A verdict records what its check read of the tree (its Python files) and the marker narrowed to them; it holds on a later state while that is unchanged. - A milestone names the commit its checks measured (contract.measured_commit), however the checkout moved since; the run's clock starts when it goes past preflight, not at a dry run. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…loop and the workflow - run/preflight.py and run/stages/preflight.py: everything that must hold before an agent is worth starting: the checkpoint, the host, the launch substrate, the KV-cache and capture-list configuration, a probe that every in-process agent can run Bash, and the surface survey. The substrate gate runs beside the first turns and stops them if it fails. - run/orchestrator.py: the graph-driven loop. Tasks start as capacity and their files allow; the planner runs on its own thread and is woken by events it has not already answered; the graph critic is advisory; the checks a finished task claims run on a shared pool; the survey's queue rows become kernel tasks with no planner turn. - run/stages/: the planned run's services (worktrees, snapshots, checks, capacity), the kernel, assembly, delivery and improver stages. - run/workflow.py: the run's lifecycle, the target marker, the correctness milestone (`<branch>-correct`, CORRECTNESS DELIVERED) and the closing verdict. - Phase 0 runs intake checks, the geometry probe and the known-defect warning beside the survey; the improver runs beside the run, woken by what costs it time; `BRINGUP DELIVERED` marks the core at tp1 before the correctness milestone; a promote task is added before delivery when local variants exist. - At most --max-parallel-tasks agents (default 8) work at once. Tasks on equal critical paths start in natural id order; a kernel row of the core unit is wired as a soft dependency of the core's assembly so it starts first; a FAILED_RECEIPT whose entry landed on the target meets its dependents' hard edges. - A report already answered by the graph, and a green landing that satisfies no check and whose dependents are wired, wake no planner turn; a wake whose signature an open flow issue already lists is recorded on that issue and opens no improver turn. - TMPDIR is checked before sessions are submitted; a multimodal task's processor dependencies are imported in preflight; an unregistered `large` pytest marker becomes a host fact. - Full support (every required check, the delivery files, every shared change reviewed, no local variant waiting) delivers the run and stops a running campaign; a DONE that leaves it out of reach counts toward the stall cap; tune is background work on idle agent slots. - Fault containment: a planner turn that raises is asked again on the same events, an unreadable proposal is refused and sent back, nothing ends on a lost result. Continuous verification: a member's delivery tier is rehearsed once its other checks hold, a landing is re-checked beside the work in flight, and the orchestrator adds the delivery-files task. - run/requirements.py: the request as a feature x member matrix, written to coverage.yaml; an uncovered cell stops preflight unless task.yaml accepts it. - A smith's engine_defect receipt is registered and its fix task added; the survey marks rows in a known defect's regime; the target's geometry is probed again on the target per width, as one re-certification event. - A blocked assembler and a MACRO tell the planner why and what to add; a regression review has a dispatch of its own; certifications close only on a recorded pass, and delivery requires the delivered tests to pass. - tests/.../flow_sim.py and test_flow_simulation.py run whole runs on the CPU, first graph to delivery. - An orchestrator note names what answers it (the run it follows from, or the tasks it reports), so a revision that already holds them wakes no planner turn, and a passing check task wakes none; a ready task's wait ages its rank. - A due promote holds the check tasks that have not started; a task the orchestrator adds goes before the regression review it needs; an engine-defect fix task carries the receipt's whole proposal and its test. - Preflight refuses a placeholder anchor and two values for one launch setting; a reload sets a proposal it did not read aside, or merges it, instead of deleting it. - A production run's improver turns once, at the close; a measuring run's beside the work, on idle slots. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
A task of the planned run once the core is correct, or `trtllm-modeling-v2 tune` on a delivered target; it never gates delivery: - tune/stage.py: perf smoke, ground truth (baseline, in-tree reference, identity repeats as the noise floor, spread over the perf nodes), the candidate campaign and its wrap-up, bounded by perf.campaign.max_hours. - tune/campaign.py, worktree.py: one hypothesis per tuner turn and per worktree, measured against a same-host control, with stacked evaluation of compatible winners. - tune/keep_gate.py, inert.py, split.py: a keep needs the target's suite and the contract's accuracy gate; a loss is judged against the tree's own noise and never at a member the candidate does not change; a loss split by member asks for a member-gated variant. - bench.py, measure.py, nsys_summary.py, microbench.py, sol.py, serving_config.py: the serving sweep, its jobs on the perf sessions, per-step nsys summaries, op-level A/B, speed-of-light ceilings and the serving config derived from the workload. - A campaign told to stop (full support holds) dispatches nothing new, keeps what is measuring, and ends; its turns run at background priority. - A derived serving config trusts a checkpoint that ships its own code. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…nd package entry point `trtllm-modeling-v2 --task task.yaml --workspace W` runs (and resumes) a run; subcommands are tune, gate, perf, spool, intake, session and driver. pyproject.toml adds the entry point and package data, and an E501 per-file ignore for prompt tables. examples/ holds one model's worked values for operators writing a task.yaml; a run never materializes it. The fast path (`--checkpoint`, `--site`, `--goal`, `--confirm`) and the `tests` subcommand are part of the CLI. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…r guides, examples, results and reference docs - README.md: the pipeline, the gates, the execution substrate, tuning, lessons and every flag. - docs/: the documentation set: an index, design.md (goals, principles, architecture, lifecycle, checks, task graph, substrate, tuning, decisions, limitations), user-guide.md, developer-guide.md, examples.md (an end-to-end worked run) and results.md (measured results and what is not measured yet). - INTAKE.md: the user-facing task.yaml, site.yaml and the fast path. - TROUBLESHOOTING.md: keyed on the verbatim error, including the environment failures that read as model failures. - BUILD_AND_TEST.md: building and testing at each scale. - LESSONS.md: what real runs got wrong, and the mechanism that now prevents each. - AGENTS.md gains a short table of environment failures that read as model failures; agent-flow/README.md lists the workflow. - The docs cover full support, the capacity model, fault containment, continuous verification, the requirements matrix, observables, inputs digests, the engine-defect registry, the decision table and the CPU simulation. - design.md: staleness by what each check read of the tree. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
27d849b to
0ba6a0e
Compare
|
Another agent flow is #20792 |
!! Let's use #20907 which is more relied on LLM ability to figure the code organizations.
@coderabbitai summary
Description
What
trtllm_modeling_v2istrtllm_modeling_v2is an agent-flow workflow that takes one Hugging Face checkpoint to a gated ModelingV2 target, then makes the target fast without making it less correct. A target is a flat, self-contained forward attensorrt_llm/_torch/_experimental/modeling_v2/models/<family>/<checkpoint>__<arch>__<parallel>/, built from catalog entries and the target's ownops/. It is trusted because it passes accuracy gates, not because it shares abstractions with other models. The modeling_v2 catalog, targets and router are already in tree (#19977); this PR adds the agents that build them.A run has these steps:
trtllm-modeling-v2 --checkpoint <hf_dir> --site site.yaml --goal "<features, members, workload>"derives the spec from the checkpoint's config, the site's defaults and a one-line goal, orintake check|confirm|compileturns a user-facingtask.yamlinto it. Intake checks are the first part of phase 0.contract.yaml, the list of every check the run owes: boot, accuracy, witnesses, acceptance, logits, serve and envelope, at every parallel member.survey,kernel,assemble,feature,integrate,investigate,review,check,tune. Achecktask runs contract checks with no agent turn;depends_on_softlets a task start before its dependency lands.BRINGUP DELIVERED <sha>marks the core passing at tp1. The first tree on which every required check holds is recorded as<branch>-correctandCORRECTNESS DELIVERED <sha>. Neither waits for performance work.An improver runs beside the run. It is woken by what costs the run time, and turns failures into scoped lessons, patch drafts for workflow defects, and a registry of known engine defects, all kept across runs.
The documentation set is in
docs/: a design doc, a user guide, a developer guide, an end-to-end worked example and the measured results.What changed since the previous revision
The previous revision ran a fixed staircase: plan, then assemble one unit at a time, then gate, then a remediation cycle run by an auditor, then deliver. This revision replaces that with a contract plus a task graph, and its history is rewritten as the 13 commits below. Two from-scratch onboardings of one real checkpoint then hardened it:
Added:
trtllm-servegate.reload.Added in the last rounds (CPU-tested, to be validated by the next run):
promotetask merges them;checktasks and soft dependencies.Added after run 3 (CPU-tested), each aimed at the time to full support:
--max-parallel-tasksagents (default 8) work at once, the planner, critic and improver included; task turns leave one slot for the planner.checktasks, answers failures first in a small revision and keeps its first turn to what can start now; a smith hands back a failed receipt as soon as the defect is in shared code; workers run only their own tests and the cross-model regression runs once in the review task.largepytest marker are checked before sessions or agents start; every gate gets a per-run Triton cache.Added after a design review of run 3 (CPU-tested), each fixing a class of defect rather than one instance:
coverage.yaml, and the delivery report): each cell certified, sampled or not covered with the reason, and an uncovered cell stops the run unlesstask.yamlaccepts it.engine_defectreceipt is registered and gets its fix task automatically.knowledge: measurementleaves it out of a calibration run.Added after runs 4 and 5 (CPU-tested), aimed at quick onboarding of any model. Two more from-scratch runs on the design-review revision delivered bring-up in 4.6 h and 4.1 h, and neither reached correctness. What held them back was generic:
max_num_tokens,trust_remote_code) is stated once and handed to the other; two values are refused at preflight;trust_remote_codefollows the checkpoint'sauto_map; a one-rank command runs its worker in process.accuracy.anchor: pendingmakes the logit gate the oracle and keeps delivery incomplete until a written anchor exists; an anchor of 1 or less is refused.Removed:
premergepack and tool-enforced embargo hooks (the embargo is now a rule in every role's prompt);--overlap-units(tasks run in parallel by default);eplb/dwdpfeatures;slurm,slurm_brokerand per-workload launch paths (session spools only);Validation on a real model
Both onboarding runs used the same unreleased checkpoint, which has no in-tree implementation. Setup:
tp1 tp2 tep2 dep2 tp4 tep4 dep4.Accuracy anchors were measured with the HF reference.
Onboarding, run 2 against run 1. Both are timed from the start of the run, over the same first 11.9 h:
Accuracy: in run 2, the core's accuracy gate passed at all seven members, and MTP acceptance passed at every depth it was gated at.
Neither run reached the correctness milestone. Both were stopped by the operator:
Run 2's findings, addressed in this revision but not yet re-measured on a run:
Tune, on run 1's target. The table compares 21 headline points (7 members × 3 metrics) against the tune baseline.
The tune code path was also validated earlier on a Qwen3.8-Flash-Next-NVFP4 target: 1.11× and 1.28× over the in-tree model with matched kernel switches. The staircase-era onboardings of MiMo-V2.6 and DeepSeek-V4.1-Flash-NVFP4 are condensed in
LESSONS.md.The runs also found engine defects outside modeling_v2. Each goes in its own PR, not in this one:
causalConv1d;What changed (by area)
task.yamlschema,intake check|confirm|compilewith asite.yaml, and the fast path that derives the spec from the checkpoint, the site and a goal. Configurationvariants, and members of different widths. A capture-list agreement check and a KV-cache configuration check for hybrid models (reuse without a snapshot policy).contract.yamllists every check owed; the accuracy benchmark runs at tp1, the widest and attention-DP members when the logit gate covers the rest.run/graph.pydecides which tasks may run and when (filetouches,exclusive,nice_to_have, attempts,checktasks, soft dependencies, batched regression reviews, promote). The planner runs on its own thread with an event window. Receipts and runtime facts are handed to dependent tasks. An infrastructure failure is retried once. A relaunched orchestrator adopts answered turns, anddriver reloaddrains it and re-executes it on new flow code.trtllm-serve), envelope. Every check runs withmodeling_v2=requireand attests the engine it ran. Verdicts are fingerprinted by the tree they read and shared when one engine is measured. Checks are admitted by the sessions' free devices. Gate bundles share one engine across checks; boot compares greedy tokens with the reference; the disaggregated witness's leg B ships with the flow; a test-result cache runs only the tests a change affects.task.yamland handed over by allocation, with a watchdog. The external-transport driver (driver wait|claim|prompt|status|reload). In-process turns leave their files and keep their role's time bound.perf.campaign.max_hours, correctness delivered beside a running campaign. Plusbench.py,nsys_summary.py,microbench.py, and theperfCLI.all,role:,host:,family:). Aworkflow_defectlesson files a flow issue with an optional validated patch draft, anengine_defectlesson names its upstream fix, and a lesson is retired once the commit that fixed it is in the running flow. The improver runs beside the run, woken by failed receipts, repeated certifications, stalled ready tasks, no-op planner turns, VOID verdicts and reported flow issues.OpWrapperclasses.CELLSandARCHSare the executable contract that the survey reads and delivery checks. Delivery checks_select_target, theW-row weight table and routing. Gates passmodeling_v2through the LLM API and setTRTLLM_MODELING_V2_VALIDATE=1. FlashInfer is a sourcing tier.docs/(design, user guide, developer guide, examples, results), README, INTAKE, BUILD_AND_TEST, TROUBLESHOOTING andLESSONS.md. A short "environment failures that read as model failures" table inAGENTS.md.Outside
agent-flow/agent_flow/workflows/trtllm_modeling_v2/and its tests, the PR touches only:agent-flow/agent_flow/backends/andagent-flow/tests/test_backends.py. In-process turns launch the agent CLI named by the backend's CLI-path variable, or a newer CLI onPATH, instead of only the SDK's bundled binary, which an organization's minimum-version policy can refuse.agent-flow/pyproject.toml: thetrtllm-modeling-v2entry point, package data, and an E501 per-file ignore for prompt tables.agent-flow/README.md: one sentence.AGENTS.md: one table.There are no changes under
tensorrt_llm/,cpp/ortests/, and no new dependencies.Commits
The PR is 13 commits, one per layer, each carrying its own tests, so it can be read in order:
agent_flow: the CLI agent backend (the only change to agent-flow's core).Modules refer to later layers, so only the last commit is complete. The tests below ran on it.
How to run
Test Coverage
All tests run on CPU and need no GPU, model weights or cluster. Pass
PYTHONPATH=agent-flowwhen an editable install points at another checkout.pytest agent-flow/tests/workflows/trtllm_modeling_v2on this revision: 2936 passed, 2 skipped. The previous revision's fullpytest agent-flow/testswas 4479 passed, 5 skipped. The trtllm_modeling_v2 suites include:test_flow_simulation(whole runs on the CPU, first graph to delivery);test_verdict_reads), launch settings (test_launch_settings), turn adoption by work, pending anchors, promote timing, gate relocation and expected run times;test_deliveryagainst the in-tree gpt_oss and DeepSeek-V3 targets;test_package_hygiene, which keeps checkpoint specifics and personal paths out of the package..pre-commit-config.yamlpasses on every file this PR changes.GPU validation is the two onboarding runs and the tune campaign described above.
Known limitations and follow-ups
sitecustomizehook on the gates'PYTHONPATH; it is exercised against a fake engine in a real subprocess, not yet undermpirunon GPUs. No check yet proves image inputs across the disaggregated hand-over: the requirements matrix shows it as an uncovered row a run must accept.task.yaml.dsparkspec stops at preflight with an explicit message.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.