Repository navigation
test: run one unattended Codex optimization and validate latency on Ascend A2 - #677
zengchuang-hw wants to merge 4 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 <zengchuang3@huawei.com>
Agent-assisted-by: Codex (implementation and verification) Signed-off-by: zengchuang <zengchuang3@huawei.com>
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 <zengchuang3@huawei.com>
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 <zengchuang3@huawei.com>
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.
Refs #479
本 PR 增加一个 Ascend A2 上的黑盒 E2E 用例。测试者提供固定环境和一条自然语言请求,启动一次 pytest。用例独立检验 Codex 能否在无人值守的情况下恰好完成 3 轮并交付三轮中的最佳补丁,以及该补丁能否保持图像像素一致并降低生图耗时。
黑盒测试图
flowchart TB E["测试条件<br/>单卡 A2、固定基线和只读模型"] I["测试输入<br/>用户请求、固定生图负载"] T["黑盒入口<br/>启动一次 pytest,无人值守完成 3 轮"] O["可观察输出<br/>最终回复、补丁、图像和原始耗时"] V["验收校验<br/>交付可重建、像素一致、耗时下降"] R["PASS / FAIL / INCONCLUSIVE"] E --> T I --> T T --> O --> 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。如 #479 约定最低降幅,用QWEN_E2E_MIN_GAIN_PCT在开跑前设定。完整运行说明可观察输出与校验点
frozen.json。candidate.patch。从另一份干净基线应用补丁,核对重建后的vllm_omni/Git 树与交付源码一致。result.json记录阶段、要求完成的轮数、实际完成轮数(campaign 校验通过后)、判定及错误原因。复测完成时还记录基线与候选耗时、节省毫秒数、降幅、加速比和像素不一致的种子。降幅按100 × (基线耗时 − 候选耗时) / 基线耗时计算。通过与失败
PASSFAILINCONCLUSIVEFAIL和INCONCLUSIVE都使 pytest 返回非零,具体原因以result.json为准。当前验证状态
result.json记录为INCONCLUSIVE(stage=codex)。暂无候选独立复测数据或三轮优化幅度。sample_sigmas。本地模拟实际步数从 8 减到 7 时,凭证仍一致,实际执行的网格和步数仍待校验。