chore: cleanup garbage code (#29770)

This commit is contained in:
Xiaoyu Zhang
2026-07-02 16:14:01 +08:00
committed by GitHub
parent 0ae76117ef
commit b276a9acee
55 changed files with 86 additions and 262 deletions
+4 -4
View File
@@ -143,7 +143,7 @@ def parse_args() -> argparse.Namespace:
return parser.parse_args()
def build_sandbox_image() -> "modal.Image":
def build_sandbox_image() -> modal.Image:
if modal is None:
raise RuntimeError(
"The 'modal' package is required. Run this script with "
@@ -213,7 +213,7 @@ Do not skip issue filing. The whole point of this system is automated triage.
"""
def upload_tree(sandbox: "modal.Sandbox", log_dir: Path) -> None:
def upload_tree(sandbox: modal.Sandbox, log_dir: Path) -> None:
log_files = [path for path in log_dir.rglob("*") if path.is_file()]
logger.info("Uploading %d log files into the sandbox", len(log_files))
for index, log_file in enumerate(log_files, start=1):
@@ -225,7 +225,7 @@ def upload_tree(sandbox: "modal.Sandbox", log_dir: Path) -> None:
logger.info("Uploaded %d/%d files", index, len(log_files))
def clone_context_repos(sandbox: "modal.Sandbox", repo_urls: list[str]) -> None:
def clone_context_repos(sandbox: modal.Sandbox, repo_urls: list[str]) -> None:
if not repo_urls:
return
@@ -244,7 +244,7 @@ def clone_context_repos(sandbox: "modal.Sandbox", repo_urls: list[str]) -> None:
).wait()
def read_optional_file(sandbox: "modal.Sandbox", path: str) -> str | None:
def read_optional_file(sandbox: modal.Sandbox, path: str) -> str | None:
try:
return sandbox.filesystem.read_text(path)
except Exception:
+9 -9
View File
@@ -231,10 +231,10 @@ docker run $DOCKER_COMMON --name mi355x_decode \
$COMMON_FLAGS --disaggregation-mode decode --disaggregation-bootstrap-port $DBOOT
EOF
# Smoke-test payload + validator (separate files to avoid quoting inside the
# Probe payload + validator (separate files to avoid quoting inside the
# bench.sh `bash -lc '...'` block). One real request exercises the full
# prefill->decode KV handoff before we commit to the whole sweep.
cat > "$WORKDIR/smoke.json" <<'JSON'
cat > "$WORKDIR/probe.json" <<'JSON'
{"text": "The capital of France is", "sampling_params": {"max_new_tokens": 16, "temperature": 0.0}}
JSON
cat > "$WORKDIR/assert_nonempty.py" <<'PY'
@@ -242,9 +242,9 @@ import sys, json
d = json.load(sys.stdin)
t = d.get("text", "") if isinstance(d, dict) else ""
if not (t and t.strip()):
print("[smoke] empty/invalid output:", str(d)[:200])
print("[probe] empty/invalid output:", str(d)[:200])
sys.exit(1)
print("[smoke] ok:", t[:80].replace("\n", " "))
print("[probe] ok:", t[:80].replace("\n", " "))
PY
# Bench script runs on the prefill node; \$PIP/\$DIP injected at srun time.
@@ -267,12 +267,12 @@ docker run $DOCKER_COMMON --name mi355x_bench \
--disable-circuit-breaker &
for i in \$(seq 1 30); do curl -sf http://127.0.0.1:$LBPORT/health >/dev/null && break; sleep 2; done
CIDIR=/host_home/.mi355x_ci/${MATRIX_CONFIG_NAME}
echo "[smoke] PD end-to-end check via LB"
echo "[probe] PD end-to-end check via LB"
curl -sf -X POST http://127.0.0.1:$LBPORT/generate \
-H "content-type: application/json" -d @\$CIDIR/smoke.json > \$CIDIR/smoke_out.json \
|| { echo "[smoke] request failed -- PD path not serving; aborting before sweep"; exit 1; }
python3 \$CIDIR/assert_nonempty.py < \$CIDIR/smoke_out.json \
|| { echo "[smoke] empty/invalid generation; aborting before sweep"; exit 1; }
-H "content-type: application/json" -d @\$CIDIR/probe.json > \$CIDIR/probe_out.json \
|| { echo "[probe] request failed -- PD path not serving; aborting before sweep"; exit 1; }
python3 \$CIDIR/assert_nonempty.py < \$CIDIR/probe_out.json \
|| { echo "[probe] empty/invalid generation; aborting before sweep"; exit 1; }
# Correctness gate runs BEFORE the perf sweep: if the model is wrong there
# is no point spending ~15min measuring how fast it is wrong, so a failure
# here exits immediately and the sweep never runs.