MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / cmd_status

Function cmd_status

orchestrate.py:351–411  ·  view source on GitHub ↗

Print the current orchestration status.

(state: dict)

Source from the content-addressed store, hash-verified

349
350
351def cmd_status(state: dict) -> None:
352 """Print the current orchestration status."""
353 kernels = state["kernels"]
354 idx = state.get("current_kernel_idx", 0)
355 current = kernels[idx] if idx < len(kernels) else None
356
357 print()
358 print("=" * 55)
359 print(" AutoKernel Orchestration Status")
360 print("=" * 55)
361 print()
362
363 # Check if all done
364 all_done = all(k["status"] in (STATUS_DONE, STATUS_SKIPPED) for k in kernels)
365 if all_done:
366 print(" All kernels optimized. Run verify.py for end-to-end check.")
367 print()
368 elif current:
369 kname = Path(current["file"]).name
370 print(f" Currently optimizing: {kname} (rank {current['rank']}, {current['op_type']})")
371 exp_run = current["experiments_run"]
372 exp_kept = current["experiments_kept"]
373 minutes = current["time_spent_minutes"]
374 print(f" Progress: {exp_run} experiments ({exp_kept} kept), {minutes} min elapsed")
375
376 baseline = current["baseline_tflops"]
377 best = current["best_tflops"]
378 speedup = current["speedup"]
379 if baseline is not None and best is not None and speedup is not None:
380 print(f" Baseline: {baseline:.1f} TFLOPS -> Current best: {best:.1f} TFLOPS ({speedup:.1f}x speedup)")
381 elif baseline is not None:
382 print(f" Baseline: {baseline:.1f} TFLOPS (no improvement yet)")
383 print()
384
385 # Kernel table
386 print(" Kernel Status:")
387 max_op_len = max((len(k["op_type"]) for k in kernels), default=8)
388 for k in kernels:
389 tag = _STATUS_DISPLAY.get(k["status"], k["status"].upper())
390 op = k["op_type"]
391 rank = k["rank"]
392 if k["status"] in (STATUS_DONE, STATUS_OPTIMIZING) and k["speedup"] is not None:
393 detail = f"{k['speedup']:.1f}x speedup, {k['experiments_run']} experiments"
394 elif k["status"] == STATUS_SKIPPED:
395 detail = "skipped"
396 else:
397 detail = ""
398 pad_op = op.ljust(max_op_len)
399 if detail:
400 print(f" [{tag:<10}] {pad_op} (rank {rank}) -> {detail}")
401 else:
402 print(f" [{tag:<10}] {pad_op} (rank {rank})")
403 print()
404
405 # Aggregate speedup
406 agg = estimate_aggregate_speedup(kernels)
407 if agg > 1.0:
408 print(f" Estimated aggregate model speedup: {agg:.2f}x")

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected