Repository navigation
test: run one unattended Codex optimization and validate latency on Ascend A2 - #677
zengchuang-hw wants to merge 6 commits into
Conversation
Exercise the natural-language entry point, recompute round decisions and independent results, and verify the delivered source against the measured candidate. Keep historical replay and the real Codex/A2 run opt-in. Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
Static review of the opt-in test and audit; no live Codex or Ascend run.
| plan, _ = seal(options["project"], options["baseline_revision"], campaign, | ||
| options["patch"], output / "independent", submission=submission) | ||
| execute(output / "independent", plan, options["timeout_seconds"]) | ||
| report = audit(campaign, options["observer"], host_reply=output / "final-reply.txt") |
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
The local-retest path writes the new receipt to output / "independent", but audit() then reads observer["independent_directory"] relative to the observer directory. If the observer and output are separate, the audit can ignore the just-run attempt and use a different receipt for the same patch, or report missing evidence even after the retest succeeded. Please bind the live audit to the directory it just created and add a local-mode regression with a different observer receipt and separate directories.
… on A2 Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
Static review of the rewritten unattended A2 path; no live Codex or NPU run.
| "model_index_sha256": hashlib.sha256(model_bytes).hexdigest(), "sample_sigmas": sigmas, | ||
| "seeds": [case["seed"] for case in workload["requests"]], | ||
| "warmup_ms": warmup_ms, "latencies_ms": latencies_ms, "median_ms": median(latencies_ms), | ||
| } |
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
sample_sigmas here records the requested values from workload.json, not the grid the scheduler actually executed. A candidate can change how those values are handled and this receipt still matches the baseline. #479 requires the effective grid to be retained for the compared runs. Capture the effective timestep/sigma sequence and step count at the runtime boundary and reject a mismatch; add a regression that keeps the requested values unchanged while the effective grid differs.
Freeze the exact round budget in the user journey and verify it against the completed campaign before independent retest. Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
The new exact-three assertion still permits three submissions of the same unchanged candidate. I verified this in isolation with the exact optimize function and controlled campaign records; no live Codex or A2 run.
| # The campaign and final reply must both belong to this fresh invocation. | ||
| plan = json.loads((campaign / "plan.json").read_bytes()) | ||
| state = json.loads((campaign / "state.json").read_bytes()) | ||
| completed_rounds = len(state["rounds"]) |
There was a problem hiding this comment.
This counts records, not effective optimization iterations. I ran the current optimize() with a synthetic completed campaign whose three rounds and final all held the same candidate digest; it returned 3. The governing #479 contract explicitly excludes an unchanged repeat from the optimization-candidate count. Validate retained round identities/evidence (source and declared candidate configuration), and add a negative fixture with three records but only one real change. A real distinct candidate may still count if its measured result is rejected.
Bind each measured round to the preceding candidate source. Independently compare the third accumulated result with the original baseline. Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
PR review verdict — DO NOT PASS. Score: 26/100. Base 0ae7d0d5aca5a523786a19c98b1d18bf9b37783e7 is not the review base; the exact reviewed base is 0ae7d0d5aca90bf9725cf9661ba2897996e68a1d, head ae01db16ec09aac9ef73c6af0d9022ae53530430.
The prior repeated-candidate case is now rejected by the chained snapshots. The new inline finding concerns binding the independent retest to the third measured snapshot. Ratings (0–3): scope 1 (the governing workflow calls for selected-source replay); correctness 0 (the reconstructed source can differ); validation 2 (Ready CI and CPU controls, no completed A2 run); claim evidence N/A (no completed model-run result claimed); simplicity 0 (new explanatory code comment).
| report.update(completed_optimization_rounds=len(loops), optimization_loops=loops) | ||
|
|
||
| report["stage"] = "reconstruct" | ||
| git(project, "add", "-A", "--", "vllm_omni") |
There was a problem hiding this comment.
The final Git patch can drop files that were part of the third measured snapshot. identity(..., ["vllm_omni"]) includes ignored files, but git add -A skips new ignored files. I confirmed this in a clean local Git repo with one changed tracked module and one new ignored helper: the two Git trees can match while the measured snapshot had both files. Compare the rebuilt source digest with loops[-1]["candidate_sha256"] before retesting (and add that ignored-file regression), or use the same file manifest for both snapshot and patch.
Require a run-specific threshold and reject results at or below it. Preserve the A/A timing observations and compare the unrounded cumulative gain. Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <[email protected]>
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
PR review verdict — DO NOT PASS. Score: 18/100. Reviewed base 0ae7d0d5aca90bf9725cf9661ba2897996e68a1d, head f34850a703b9a9faa11352124c8ccd91728182f8.
The strict comparison rejects a result of exactly 10% when the run is configured for 10%. The new inline finding concerns the effective minimum and the removal of the A/A confidence check. The prior candidate-digest finding is unchanged. Ratings (0–3): scope 1 (governing acceptance case not bound), correctness 0 (verdict and replay can diverge from the contract), validation 2 (exact Ready CI passed; local arithmetic check only), claim evidence 0 (the reported A2 runs do not link their generated PNGs or raw timings), simplicity 0 (explanatory code comments in the full diff).
| speedup=before / after, quality_passed=len(reference) - len(failed_seeds), | ||
| quality_total=len(reference), failed_seeds=sorted(failed_seeds)) | ||
| report["verdict"] = ( | ||
| "PASS" if not failed_seeds and gain > Decimal(str(minimum)) else "FAIL" |
There was a problem hiding this comment.
This can report PASS below the PR’s stated >10% acceptance floor, and it no longer checks the measured A/A noise. I evaluated the pinned verdict logic with clean pixels: a configured floor of 1% and a measured 2% gain pass; a floor of 10%, an 11% gain and 14% A/A variation also pass. Can we reject any configuration below the fixed 10% acceptance floor and make a gain inside the frozen noise window INCONCLUSIVE, as a separate check? Please retain both cases as regressions.
Refs #479
本 PR 增加一个 Ascend A2 上的黑盒 E2E 用例。测试者提供固定环境和一条自然语言请求,启动一次 pytest。用例独立检验 Codex 能否在无人值守的情况下连续完成 3 轮叠加优化,并交付第三轮结束后的累计补丁。主要指标是累计版本相对原始基线的单张生图耗时降幅百分比,性能验收门槛为严格大于 10%。
黑盒测试图
flowchart TB E["测试条件<br/>单卡 A2、固定基线和只读模型"] I["测试输入<br/>用户请求、固定生图负载"] L1["第 1 轮<br/>原始 B0 → 改进 B1 · 实测反馈"] L2["第 2 轮<br/>从 B1 继续改进为 B2 · 实测反馈"] L3["第 3 轮<br/>从 B2 继续改进为累计 B3"] V["独立复测<br/>原始 B0 ↔ 累计 B3 · 校验像素和源码"] R["输出<br/>累计补丁、最终降幅百分比、严格大于 10% 才通过"] E --> L1 I --> L1 L1 --> L2 --> L3 --> V --> R测试条件与输入
f69b1f2b19cece03f6736c7da093ea25de0e24fd(见 task: 设计首个 Codex 用户使用 InferRSI 的端到端用例 #479)。原始基线从这个提交开始,第二、三轮分别从上一轮的累计源码继续,QWEN_E2E_REVISION使用该完整 SHA。workload.json固定 2 次预热和 6 个测量输入(种子 42–47)。1280×704、BF16、请求 8 步、CFG=1、每请求 1 张图。基线与候选使用相同负载。从调用Omni.generate到取得解码图像计时,模型加载、预热和 PNG 写盘分别处理。启动前配置
QWEN_E2E_REPO、QWEN_E2E_REVISION和QWEN_E2E_CHECKPOINT。本次显式使用QWEN_E2E_MIN_GAIN_PCT=10,用例在测量前将门槛写入运行计划。完整运行说明可观察输出与校验点
frozen.json。candidate.patch。从另一份干净基线应用补丁,核对重建后的vllm_omni/Git 树与交付源码一致。result.json记录阶段、要求完成的轮数、实际完成轮数与每轮源码继承关系、判定及错误原因。复测完成时还记录基线与候选耗时、节省毫秒数、降幅、加速比和像素不一致的种子。主要指标为第三轮累计版本相对原始基线的最终降幅,按100 × (原始基线耗时 − 第三轮累计版本耗时) / 原始基线耗时计算。通过与失败
PASSFAILINCONCLUSIVE降幅用未四舍五入的值判定。A/A 波动记录在结果中,作为测量参考。
FAIL和INCONCLUSIVE都使 pytest 返回非零,具体原因见result.json。A2 独立复测结果
在单张 Ascend 910B3 上,按 AB → BA → AB 独立复测原始基线 B0 和第三轮累计版本 B3。下表耗时为各侧三个组中位数的中位数。
最终降幅为 10.101%,严格大于 10%,用例判定通过(
PASS)。 36 张复测图均与对应种子的基线 RGBA 像素一致。当前验证状态
INCONCLUSIVE。sample_sigmas。本地模拟实际步数从 8 减到 7 时,凭证仍一致,实际执行的网格和步数仍待校验。