Repository navigation
Description
Integration branch: k31-perf-opt
Parent: LLM-Booster#437.
Ready for measured optimization. Improve Kimi-K3.1 on one eight-GPU MI355X node until it meets the B300 C12 performance point. Development and independent review happen in this fork; required AITER changes belong in whx-sjtu/aiter.
Owner-confirmed requirement and operating agreement
Goals
- Reach at least 8003 total tokens/s/chip and 128.5 tokens/s/user P90 full-response interactivity in the same valid official 3600-second AgentX measurement.
- Preserve quality and the existing precision policy. Report P90 TTFT and E2E-normalized interactivity, including their changes against comparable controls, for the final acceptance judgement.
- Continue this conversation's optimization work. Select other work linked from the parent only when evidence supports substantial performance value; do not duplicate completed upstream work or pursue unrelated cleanup.
Acceptance
- Performance: run the reviewed single-node AgentX recipe with its frozen scenario, dataset, client, draft revision and golden-acceptance policy. Use canonical bundle fields
summary.request_metrics.throughput.per_gpu.total_tput_tpsandsummary.request_metrics.latency.full_response_intvty.p90. Throughput uses successful profiling input plus output tokens over the actual first-start to last-end span per GPU. Interactivity is 1000 divided by P90 full-response inter-token latency in milliseconds; the legacy dashboard native-ITL field is not this metric. The same result must satisfy both target numbers, disclose actual GPU count/concurrency, and pass the official protocol's validity checks. A short run, changed workload, layer-duration sum or alternative timing window is not target proof. - Evidence:
python -m atom.benchmarks.results verify "$RUN_BUNDLE" --require-fullmust report a complete bundle. Preserve actual commands, runtime/source versions, eligible request data and measurement boundaries. This completeness check alone establishes neither measurement validity nor the performance thresholds. Verify the actual 3600-second client command, frozen configuration, request and cancellation ledger, server stability and cleanup separately. Preserve forced-acceptance synthetic markers and generic publication eligibility; the design must specify the approved golden-protocol comparison without relabeling it as natural acceptance. - Quality: run the full GSM8K 5-shot recipe with natural acceptance, 1319 examples, generation cap256 and fixed seeds. Its command is
lm_eval --model local-completions --tasks gsm8k --num_fewshot 5 --model_args "model=kimi-k3.1-pro,base_url=http://127.0.0.1:$PORT/v1/completions,num_concurrent=8,max_retries=3,tokenized_requests=False,tokenizer=$MODEL_ROOT,trust_remote_code=True,max_gen_toks=256,timeout=300" --log_samples --output_path "$QUALITY_RESULTS" --seed 0,1234,1234,1234. Flexible-extract accuracy must be at least96%, with no significant paired degradation against a matching baseline; publish discordant counts and the statistical result, without calling a nonsignificant result equivalence. - Stability and guardrails: the accepted service run must have no server failures or stalls, retain valid cleanup evidence, and report TTFT/E2E guardrails and protocol-defined cancellations explicitly. E2E-normalized interactivity is
1 / P90(request_latency_s / actual_output_tokens). Final acceptance cannot be inferred from CPU tests, placeholder CI, an unverified runtime path or a microbenchmark alone.
Owner priority: model performance first
Prioritize fixed-configuration model/operator performance toward measured hardware limits before serving-configuration tuning. Use the verified ROCm#519 recipe/source record as a historical stable reference, with unrecovered runtime artifacts disclosed. Keep C12 final acceptance and all existing precision/quality requirements. Initial model/operator design does not wait for the deferred save-diagnostic line. Decision: #1 (comment)
Owner requirement: daily combined measurements
Owner update (2026-11-22, Asia/Shanghai): produce one daily complete 3600-second C12 end-to-end result combining the day's runnable model optimizations, so progress is visible. The daily lane proceeds alongside operator optimization and does not wait for #3/#15/#19 to close.
- Cadence: default 20:07 Asia/Shanghai daily; prepare the first complete baseline immediately. Queue for verified available GPUs without preemption. Deduplicate by date/candidate and preserve every failed or blocked attempt.
- Candidate: freeze an isolated reproducible combination of compatible implemented changes. Record exact ATOM/AITER commits, flags and included/excluded candidates with reasons. Experimental unmerged changes need source review, relevant numerical correctness and bounded model smoke; pending quality/performance status is explicit. Keep production landing gates unchanged.
- Comparison: retain the established C12 recipe, dataset, client, precision and speculative/golden policy. Run the full 3600-second client profiling window; record startup/warmup/drain separately. Compare with the previous valid daily run and a fixed comparable baseline. Mark unchanged days and start a labeled new series for essential recipe changes.
- Report: provide a dated row with total tok/s/chip, P90 full-response interactivity, P90 TTFT, E2E-normalized interactivity, requests/errors/cancellations, actual span, deltas, source/configuration, change roster, quality status and cleanup evidence.
- Priority and limits: reserve the daily GPU measurement opportunity and re-enable only the minimum baseline/stability work necessary for valid completion. This supersedes milestone-only long runs and prior indefinite stability deferral for this lane. Reuse existing AgentX/results/ownership tools; no generic framework or unannounced serving sweep. Daily evidence does not waive final C12, natural GSM8K, precision, stability or merge/review gates.
Scope and non-goals
- Start from this fork's
main@cbf1617468110a81e720a00021c5d3c5e14ce232. Land reviewed work onk31-perf-opt; preserve old experimental revisions and results as historical controls, never relabel them as current-main results. - This milestone targets C12. Other concurrency points are a later milestone. Keep the existing distinction between the target B300 point and the actual ATOM concurrency tested.
- Native BF16 linear/shared/combine/collective policy, permitted Mono latent dispatch, A4W4 experts, FP8 KV, FP4 indexer, FP32 KDA state and BF16 convolution state remain binding. No FP4 KV, static EPLB, silent protocol changes or unreviewed numerical relaxation.
- Prefer engine improvements. Scheduling delay/admission tradeoffs remain last-resort work and must be reported separately.
- No writes to ROCm/ATOM or ROCm/aiter. Parent reporting and cross-repository issue links are authorized. Do not close or rewrite unrelated upstream PRs merely because this work moved to a fork.
Team and validation policy
- Use a total pool of eight subagents, all GPT-6.1 Sol/xhigh. Author, reviewer and orchestrator are distinct. Review capacity and GPU ownership determine active assignments.
- Measurement tooling that preserves default inference may land after CPU checks and independent review. Optimizations changing inference or numerical paths require the corresponding GPU correctness, performance and established quality evidence before landing.
- CPU tests and Black remain required. Record the existing Ruff findings at the baseline and reject new findings; do not turn unrelated lint cleanup into performance scope or silently expand the allowance.
- GPU runs on g24 use the existing ownership lock, idle/pause checks, private compatible caches, bounded supervision and verified cleanup. CPU work remains isolated from GPU measurements. Large artifacts stay outside Git; GitHub records carry their locations, hashes and conclusions.
- The owner will be away and authorizes recommended subsequent decisions without waiting. Use independent automatic rulings for ordinary technical choices within this agreement. Keep the agreed targets and validation boundaries; report only important progress and material risks.
Activity
whx-sjtu commentedon Nov 21, 2026
Ready: the natural quality baseline is qualified; C12 performance remains open.
The #10 handoff fixes canonical A0 and its independent comparison. PR #11 closed unmerged after APPROVE; integration source is unchanged.
The latest diagnostic hit an earlier req9 native failure outside its req130 selection. Failed evidence is preserved. Prospective selection and failure-notification work awaits the internal technical decision; no new run or cause claim follows.
whx-sjtu commentedon Nov 21, 2026
Ruling: prioritize model/kernel performance at fixed configuration before serving-configuration tuning. Ready to revise #3 and start the model-first work plan.
This records the owner's direction: bring the model itself toward hardware limits first, then tune configuration. #519 is the primary historical stable reference. The C12 targets, quality/precision contract, fork ownership and integration branch remain unchanged.
Priority, baseline and current diagnostic disposition
Lock the tested source, precision, representative shapes and serving recipe for each comparison. Optimize the model compute path: operators, memory movement, fusion, launch overhead and required communication. Measure target-part compute, memory and communication limits and use focused profiling/ablation to bound remaining opportunity; report untested axes instead of asserting an absolute ceiling. Ablations with invalid outputs are diagnostic floors only. Production candidates still need numerical correctness, performance and the agreed full quality evidence.
Do not pursue concurrency, MTP-width/acceptance, cache-sizing, timeout or admission-delay searches as the first optimization wave. Restoring and documenting the known-good control is baseline recovery, with every departure explicit. Keep ROCm#519's C16 metrics separate from C12 acceptance, and distinguish independently reviewed historical evidence from raw artifacts that have not been recovered. Develop on the existing fork-main-derived integration branch; do not silently reset it to the historical tree.
Revise #3's model-first design and dependency order so #6's serving/save diagnostic no longer blocks initial model/operator work. Retain end-to-end stability and the full official C12 run as later acceptance gates. Preserve #6 and its unmet original-exposure criteria as deferred work; its latest leased run has already ended naturally. Finish only passive outcome/release sealing and handoff, then stop new save-observer implementation/experiments until the model-first plan reactivates that work.
The first wave should reuse existing model/operator benchmarks, prior trace evidence and useful Inferact/amd-kernels implementations. The planner must provide small claimable tasks, isolated source ownership, separate author/reviewer roles and qualified GPU commands before new leases. Reuse the existing eight GPT-6.1 Sol/xhigh agents; no additional agents or unreviewed GPU work is authorized by this priority record.
Also: #1 priority updated; #3 brief/dependency updated; #6 deferred after evidence duty; #12 notified.
whx-sjtu commentedon Nov 21, 2026
Ruling on #14 affects this: Ready to prepare #19 as a separately gated actual-native-input qualification. The ruling concludes the original spike as INCONCLUSIVE_OUTSIDE_FROZEN_RANGES, unmerged and without APPROVE.
Keep the fixture ratios as research evidence, with the failed absolute intervals visible. Reuse valid capture machinery without equating #15 K2 core to raw MLA inputs or delaying #15. Parent production, quality and C12 gates are unchanged.
whx-sjtu commentedon Nov 22, 2026
Ready: owner-approved daily combined 3600-second C12 measurements.
The owner requests one daily full-model result containing that day's runnable optimizations, so progress is visible.
Use 20:07 Asia/Shanghai as the default daily slot, with the first complete baseline prepared now. Queue for verified free GPUs without preempting another job.
This adds a daily end-to-end lane alongside model/operator optimization. It supersedes milestone-only long runs and the stability deferral where they prevent daily measurement. It does not wait for #3/#15/#19 to close.
Daily measurement agreement
Freeze a reproducible isolated candidate from the fork baseline and compatible implemented changes. Preserve the current C12 recipe, dataset, precision, client, speculative/golden policy and metric definitions. List included commits/flags and excluded candidates with reasons. Unmerged candidates may be measured after source review, relevant numerical checks and a bounded model smoke; pending quality or performance qualification stays explicit. Do not promote standalone-kernel figures into integrated model gains.
Run a full 3600-second client profiling window, with startup/warmup/drain and owned cleanup recorded separately. Compare with the previous valid daily result and a fixed comparable baseline. An unchanged candidate gets an unchanged-candidate record; a recipe change starts a clearly labeled series. Preserve failures and blocked attempts, then repair a concrete cause before a separately qualified replacement.
Report total tokens/s/chip, P90 full-response interactivity, P90 TTFT, E2E-normalized interactivity, successful requests/errors/cancellations, actual span, both deltas, source/configuration, inclusion/omission roster, quality status and release evidence. Use a dated tracking issue under #1; #1 remains under LLM-Booster#437.
Reuse AgentX, result-bundle and ownership tools. The planner will identify the minimum readiness/stability work without reviving unrelated observer or serving-configuration sweeps. Keep all final natural GSM8K, precision, stability, review/landing and C12 acceptance gates unchanged. A daily experimental result is not release approval.
whx-sjtu commentedon Nov 22, 2026
Ready: plan published: #21, #22, #23.
Checked: independent preparation, immediate baseline/report, daily composition, deduplication/comparability and unchanged acceptance gates.
#21 and #22 are claimable now; #23 depends on both. None waits for #3/#15/#19. Plan review passed; exact implementation/run qualification and Root's GPU lease remain separate.
Independent plan review1: REVISE
Reviewed draft SHA256
d24674c41b6f7ddd12dcdda15222567d2476fed8e151d33154d0a4debab55e7f. Review record:/share_nfs/whx/work/k31_perf_opt/.opt-team/agent-team/work/daily-plan-1/review-v1.md, SHA256c937d9512ead2d7cea42373aa249f60fa6a1e2d68de825ef33a87131896606ae.Three blocking findings: the baseline must publish its own immediate dated report; the adapter must exclude the historical finalizer that closes ownership on unverified release; the baseline must use ordinary measurement-tool gates rather than a spike workflow that could require a duplicate long run. The nonblocking note distinguishes immutable runnable identity from mutable evidence/status and requires explicit comparison controls beyond the canonical fingerprint.
The review accepted the independent baseline/composition preparation and downstream reporting decomposition, exact-source isolation, complete client window/ledger/report requirements, experimental unmerged admission with explicit quality status, and preservation of final precision/quality/stability/landing gates. It performed no implementation qualification or GPU action.
Independent plan review2: PASS for publication
Reviewed final draft:
/share_nfs/whx/work/k31_perf_opt/.opt-team/agent-team/work/daily-plan-1/plan-1-v2.md, SHA2560ac804fdc1d76c6976197898a0355a0db04c93c149807506c0a66db7cbb0d93f. Review record SHA2563b92ab45235c456a41083710aab406770a7430c97b8123c20b1eb6d0c2222aa7at the adjacentreview-v2.md.All blocking findings are resolved; no remaining plan blocker or required revision. Code/test estimates are650/180 for #21,250/180 for #22,350/180 for #23. Each is a separate module with existing-interface tests, below the1000-line split threshold. Standard CPU gates apply; no task receives a GPU lease from this plan.
#21 produces the first valid full C12 baseline and minimum dated row immediately, using explicit current1.0.13/C12/K3/AL2.88 controls and qualified ownership components. #22 freezes compatible implemented changes and an honest inclusion/exclusion/quality roster. #23 adds reusable daily20:07 Asia/Shanghai reservation/comparison/reporting, consuming the existing first row. The initial inference-change roster may be empty; standalone kernels, diagnostic floors and measurement tools are not model optimizations.
Same-date/candidate duplicates are prevented; queued ownership is not preempted; failed/blocked attempts remain and replacements need qualified repair. Candidate identity excludes mutable status and tool-only updates. Full canonical fingerprints remain intact while fixed comparison controls distinguish intended ATOM/AITER source treatments from essential recipe/runtime changes. The baseline's first report does not wait for reporting convenience tooling.
This new daily lane follows the owner update. Existing #6/#12 failures and deferred observer work remain preserved; ROCm#519 stays historical C16 evidence. No design dependency or existing operator result was changed. The three tasks are linked as native sub-issues of #1.
whx-sjtu commentedon Nov 22, 2026
Ready: the owner directs immediate model-performance work and removes peripheral process from the experimental critical path.
Prioritize the compatible ROCm#3327 recovery on current source, necessary numerical/source checks, GPU A/B and C12 behavior. General roadmap documents, report/composition tooling and repeated whole-repository CPU gates must not delay a qualified experiment. Historical runtime reconstruction is deferred.
Final precision, quality, truthful measurement, ownership and landing requirements remain. The failed full-01 result is unchanged; no gain is accepted by this priority decision.
Concrete operating change
The owner explicitly said to stop spending time on peripheral work and make performance improvement the only important deliverable. Root has assigned MLA to the current-source model change, Moe to focused independent review, Next to its minimal implementation record, and Mono to the smallest existing-runner integration required to measure the changed source accurately.
Use existing interfaces and runtime; preserve current OPUS/layout/padding/ownership/stream contracts. Do not add a communication backend, generic measurement framework or historical rebuild prerequisite. Keep each experiment's exact source, flags, outputs, numerical validity and bounded cleanup reviewable. GPU leases remain explicit Root actions; final adoption still needs its agreed evidence.
Already-approved CPU isolation PR26 landed as 791da5d and #25 is closed. It removes the known fixture obstacle and is not counted as an inference optimization. Other tooling/documentation work can finish later when it does not consume the model experiment's critical resources.
whx-sjtu commentedon Nov 22, 2026
Ready: plan published: #35. Mono authors and History reviews; the task serves #21 without changing #30.
Checked: the two-file fatal-only witness preserves the existing exception, deadline, completion and lease behavior. Unknown/concurrent post-query state is not an atomic RPC/GPU cause verdict.
Independent plan review
History found no blocking scope, claim or exit issue. Its factual class-name correction was applied and verified against integration 4d0904c: NativeStateLMCacheMPConnector._poll_native_save. No further review round was requested.
The real-API CPU receipt hash was independently matched. Source/CPU implementation checks remain required; any later GPU action needs a separate root lease after qualified performance work.
whx-sjtu commentedon Nov 22, 2026
Ready: plan published: #37. AMD authors and Source reviews; implementation can proceed independently of the model HSA diagnosis.
Checked: fixed S64 q1/q4, existing global state-slot validity shared by MLA/KDA, slot 0/-1, bitmap/order filtering, empty-union safety and zero routed contributions with all downstream completion tags. The graph ladder, GEMM, concurrency and precision remain fixed.
Independent plan review
Source independently traced the current producer/consumer on integration 4d0904c and found no blocking scope, semantic or exit issue. Its per-lane predicate requirement was added: K1's uniform slot read cannot be reused in K2's mixed live/padded wave.
AMD confirmed the first-slot request mapping, exact file set and code 700/tests 300 estimate, including necessary qualification maintenance. Actual picks/union/tiles and whole-K2 timing decide the result; row percentages and donor attribution do not establish gain.
whx-sjtu commentedon Nov 22, 2026
Ready: plan published: #38. Moe authors and History reviews; independent implementation starts at clean integration 4d0904c.
Checked: reuse the existing workspace before profiling, charge it once, preserve exact bands/FP32/budget and DCP Mono decode behavior, and retain unsupported-topology fallback.
Independent plan review
History found no blocking scope, claim or exit issue. Full effective-cap sizing avoids max-context tile rounding changing Q bands; PP1/PCP1/no-TBO and same-stream ownership are explicit. The 5a/c9 closure is runtime evidence only.
The 16 MiB warmup figure is only a shape bound because dummy execution may return early. HSA causality remains unclassified. Source/CPU evidence comes first; any GPU check has its own root lease.
whx-sjtu commentedon Nov 22, 2026
Ready: plan published: #39. Mono authors and Benchmark reviews; independent of #38 and based on clean integration 4d0904c.
Checked: only validated native BF16 model storage may alias; is_set_to requires identical storage/offset/shape/stride. Converted or shifted temporaries keep compact band ownership and existing refusal checks.
Independent plan review
Benchmark read exact brief fed04e36546d735f055e2e22dcae71770ff6ae337a92e285ed2835dd42c08971 and found no blocking scope, contract or exit issue. The intentional native-copy assertion update, preserved temporary-ownership regression, TP offsets/bytes and lifetime controls are explicit.
Source/CPU evidence precedes any separately leased GPU validation. The 563.5 MiB per-rank duplicate payload is source accounting, not a measured reservation saving or HSA-cause diagnosis.
whx-sjtu commentedon Nov 23, 2026
Operating change (2026-11-23 03:40 UTC, owner-confirmed): the workstream moves to a lighter lead/worker process to get measured performance faster.
k31-perf-opt(andwhx-sjtu/aiterk31-perf-optwhen needed), without per-task PRs. Open issues and PRs Design the evidence-driven K3.1 C12 optimization roadmap #3-Reserve DCP FP4 prefill logits before KV memory profiling #42 stay open as reference material; their code may be re-validated and carried over.k31-perf-opthead with Mono off and native state save off (the configuration that previously completed long runs), C12, full 3600 s. Daily 3600 s measurements resume after it.Only key results will be posted here.
whx-sjtu commentedon Nov 23, 2026
2026-11-23 daily C12 row (first valid full run of this series).
k31-perf-opt4d0904c (no inference changes), AITER 572232d2total_tput_tps)verify --require-full: complete (19 files)Gap to the B300 C12 point: throughput +31.9%, interactivity x2.56.
Main finding from a same-client paired replay: the old
whx/k31-perfstack is 30.3% faster per request than this head. The head splits most prefills at the last 64-token block before the prompt end, so the 83-417-token remainder runs as an extra prefill step that interrupts every decode. Removing that split (old-line 4c95436, upstream port ROCm#3501, blocked on resume correctness) is now the top item, together with porting the other old-line optimizations through their upstream port PRs.whx-sjtu commentedon Nov 23, 2026
2026-11-23 17:25 UTC:
k31-perf-optadvanced 4d0904c → 7bfa08c (merged stack INT1, 89 commits, fast-forward).Contents. Upstream ports (PRs ROCm#3311 chain, ROCm#3577 chain, ROCm#3614 chain, ROCm#3636, ROCm#3637/ROCm#3638, ROCm#3501), plus the following fixes:
The production config used for validation is Mono on, K4, with the gate.
Validation
Next. INT2 (INT1 plus Mono coverage of 5/7/9/11-request widths and bitwise kernel switches) is in validation. Its replay gives P90 interactivity 66.87, P90 TTFT 1.31 s and throughput 6763, with 8.8% lower latency than INT1. If INT2 passes, it will be the stack for the 2026-11-24 daily 3600 s C12 run.
whx-sjtu commentedon Nov 23, 2026
2026-11-23 21:40 UTC:
k31-perf-optadvanced 7bfa08c → 049d2aa (merged stack INT2, 28 commits, fast-forward).Contents on top of INT1. INT2 adds Mono coverage for 5/7/9/11-request decode widths. It also turns on bit-exact kernel switches:
The latent-down row shard is merged but off by default.
Validation (production config: Mono on, K4, producer-ready gate)
Next. INT3 adds DSA decode attention, KDA prefill, indexer, drafter, KDA tail and token-graph bucket work, plus a bundled numerics A/B. It is in GPU validation overnight. The 2026-11-24 daily 3600 s C12 run will use the best stack validated by 11:00 UTC.
whx-sjtu commentedon Nov 24, 2026
2026-11-24 13:27 UTC:
k31-perf-optadvanced 049d2aa → a70ba4d (merged stack INT3b plus 2 test-only commits, 38 commits, fast-forward).Contents on top of INT2. INT3 merges eight points. Bit-exact switches are on by default from INT3a; the numerics-changing ones are on from INT3b. Every switch turns off with
=0.Validation (production config: Mono on, K4, producer-ready gate; C12 replay of 250 requests)
Each replay figure is one run. P90 TTFT is 0.3 s worse than INT2's, and P90 E2E-normalised interactivity is level with it.
Next. INT4 is being trial-merged on this head. Candidates:
INT4 will be validated as one bundle: T2 paired with INT3b, logprob/decode checks for the numerics-changing part, and GSM8K with a same-code INT3b reference.