[CI][RFC] Replace black-jupyter with ruff-format (#37210)

Co-authored-by: Alison Shao <a.shao@wustl.edu>
This commit is contained in:
Alex Nails
2026-09-02 19:46:08 -07:00
committed by GitHub
co-authored by Alison Shao
parent 2641e427be
commit 28262c20df
1411 changed files with 7766 additions and 8176 deletions
+3 -3
View File
@@ -34,9 +34,9 @@ from ci_register import CIRegistry, HWBackend, ut_parse_one_file
# (highest test volume historically), then accelerators that have been
# wired into the registry more recently (XPU, MUSA, MLX).
BACKEND_DISPLAY_ORDER = ("CUDA", "AMD", "NPU", "CPU", "XPU", "MUSA", "MLX")
assert set(BACKEND_DISPLAY_ORDER) == {
b.name for b in HWBackend
}, "BACKEND_DISPLAY_ORDER is out of sync with HWBackend"
assert set(BACKEND_DISPLAY_ORDER) == {b.name for b in HWBackend}, (
"BACKEND_DISPLAY_ORDER is out of sync with HWBackend"
)
# --------------------------------------------------------------------------- #
# multimodal_gen test coverage
@@ -198,7 +198,7 @@ def print_suite_summary(
)
for standalone_file in suite_info.missing_standalone_estimates:
print(f" - {standalone_file}")
print(f" Total estimated time: {total_time:.1f}s ({total_time/60:.1f} min)")
print(f" Total estimated time: {total_time:.1f}s ({total_time / 60:.1f} min)")
print(f" Selected partitions: {len(partitions)}")
print()
@@ -207,7 +207,7 @@ def print_suite_summary(
partition_time = sum(item.est_time for item in partition)
print(f" Partition {idx}:")
print(
f" Estimated time: {partition_time:.1f}s ({partition_time/60:.1f} min)"
f" Estimated time: {partition_time:.1f}s ({partition_time / 60:.1f} min)"
)
for item in partition:
fallback_suffix = (
@@ -304,9 +304,11 @@ def main():
sys.exit(1)
print("=== Diffusion Partition Computation ===")
print(f"Min partition time: {args.min_time}s ({args.min_time/60:.1f} min)")
print(f"Target partition time: {args.target_time}s ({args.target_time/60:.1f} min)")
print(f"Max partition time: {args.max_time}s ({args.max_time/60:.1f} min)")
print(f"Min partition time: {args.min_time}s ({args.min_time / 60:.1f} min)")
print(
f"Target partition time: {args.target_time}s ({args.target_time / 60:.1f} min)"
)
print(f"Max partition time: {args.max_time}s ({args.max_time / 60:.1f} min)")
print()
for suite_name, suite_info in suites.items():
@@ -273,7 +273,7 @@ def generate_dashboard(
if pct > REGRESSION_THRESHOLD:
regressions.append(
f"**{cid}** ({fw}): {prev:.2f}s -> {cur:.2f}s "
f"(+{pct*100:.1f}%)"
f"(+{pct * 100:.1f}%)"
)
if regressions:
+6 -6
View File
@@ -855,9 +855,9 @@ def _install_framework(fw_name: str, dry_run: bool = False) -> bool:
if dry_run:
print(f" [DRY-RUN] Would install: bash {INSTALL_SCRIPT} {fw_name}")
return True
print(f"\n{'='*60}")
print(f"\n{'=' * 60}")
print(f"Installing framework: {fw_name}")
print(f"{'='*60}")
print(f"{'=' * 60}")
ret = subprocess.run(
["bash", str(INSTALL_SCRIPT), fw_name],
timeout=600,
@@ -943,9 +943,9 @@ def run_comparison(
installed_fws.add(fw_name)
for case, fw_cfg in pairs:
print(f"\n{'='*60}")
print(f"\n{'=' * 60}")
print(f"Case: {case['id']} | Model: {case['model']} | Framework: {fw_name}")
print(f"{'='*60}")
print(f"{'=' * 60}")
if dry_run:
cmd = build_server_cmd(fw_name, case, fw_cfg, port)
@@ -982,9 +982,9 @@ def run_comparison(
print(f"\nResults written to {output}")
# Print summary table
print(f"\n{'='*60}")
print(f"\n{'=' * 60}")
print("SUMMARY")
print(f"{'='*60}")
print(f"{'=' * 60}")
for r in results:
lat = f"{r['latency_s']:.2f}s" if r["latency_s"] else r.get("error", "N/A")
print(f" {r['case_id']:30s} | {r['framework']:12s} | {lat}")
@@ -155,8 +155,7 @@ def print_missing_standalone_estimates_summary(
print("\n" + "=" * 60)
print(
"Add standalone estimate(s) to "
"python/sglang/multimodal_gen/test/run_suite.py"
"Add standalone estimate(s) to python/sglang/multimodal_gen/test/run_suite.py"
)
print("=" * 60)
print("The following standalone file(s) used fallback estimate 300.0s.")
-1
View File
@@ -311,7 +311,6 @@ def copy_trace_files(source_dir, target_base_path):
for root, dirs, files in os.walk(source_dir):
for file in files:
if file.endswith(".json.gz"):
# Only upload TP rank 0 traces to avoid duplicates across tensor parallel ranks
if "TP-" in file and "TP-0" not in file:
continue
+1 -1
View File
@@ -321,7 +321,7 @@ def fetch_all_jobs_snapshot(
for i, run in enumerate(unique_runs):
if (i + 1) % 20 == 0:
print(f"Processing run {i+1}/{total_runs}...", file=sys.stderr)
print(f"Processing run {i + 1}/{total_runs}...", file=sys.stderr)
workflow_name = run.get("_workflow", "-")
try:
+3 -4
View File
@@ -675,7 +675,7 @@ def resolve_test_file(file_part):
full_path = (
file_part
if file_part.startswith("python/")
else f"python/sglang/multimodal_gen/test/{file_part[len(prefix):]}"
else f"python/sglang/multimodal_gen/test/{file_part[len(prefix) :]}"
)
if not os.path.isfile(full_path):
return None, False, f"File not found: `{full_path}`"
@@ -1207,9 +1207,8 @@ def handle_rerun_test(
):
return False
if (
refresh_precision_baseline
and not _check_precision_baseline_refresh_permissions(gh_repo, pr, comment)
if refresh_precision_baseline and not _check_precision_baseline_refresh_permissions(
gh_repo, pr, comment
):
return False
+1 -1
View File
@@ -323,7 +323,7 @@ def fetch_all_jobs_snapshot(
for i, run in enumerate(unique_runs):
if (i + 1) % 20 == 0:
print(f"Processing run {i+1}/{total_runs}...", file=sys.stderr)
print(f"Processing run {i + 1}/{total_runs}...", file=sys.stderr)
workflow_name = run.get("_workflow", "-")
try: