Quiet test_bs_1_speed CI log (#25548)

This commit is contained in:
Liangsheng Yin
2026-05-17 19:29:44 -07:00
committed by GitHub
parent a080358cac
commit 43e133208a
3 changed files with 15 additions and 5 deletions
+4 -1
View File
@@ -3495,7 +3495,10 @@ class Scheduler(
if empty_cache:
current_platform.empty_cache()
logger.info("Cache flushed successfully!")
# Per-DP-group leader logs once: ranks within a DP group are
# state-synchronous, but DP groups may diverge.
if self.is_stats_logging_rank:
logger.info("Cache flushed successfully!")
success = True
else:
logging.warning(
+3 -2
View File
@@ -14,8 +14,9 @@ class SpecDecodingMixin:
acc_length, speed = 0.0, 0.0
for attempt in range(1, self.bs_1_speed_attempts + 1):
requests.get(self.base_url + "/flush_cache")
acc_length, speed = send_one_prompt(args)
print(f"attempt {attempt}: {acc_length=:.2f} {speed=:.2f}")
acc_length, speed = send_one_prompt(
args, label=f"attempt {attempt}", print_output=False
)
if acc_length > self.accept_length_thres and speed > self.bs_1_speed_thres:
break
requests.get(self.base_url + "/flush_cache")
+8 -2
View File
@@ -105,7 +105,11 @@ class BenchArgs:
return cls(**{attr: getattr(args, attr) for attr in attrs})
def send_one_prompt(args: BenchArgs):
def send_one_prompt(
args: BenchArgs,
label: Optional[str] = None,
print_output: bool = True,
):
base_url = f"http://{args.host}:{args.port}"
# Construct the input
@@ -235,10 +239,12 @@ def send_one_prompt(args: BenchArgs):
speed = ret["meta_info"]["completion_tokens"] / latency
tokens = ret["meta_info"]["completion_tokens"]
if not args.stream:
if not args.stream and print_output:
print(ret["text"])
print()
if label is not None:
print(label)
headers = ["Latency (s)", "Tokens", "Acc Length", "Speed (token/s)"]
rows = [[f"{latency:.3f}", f"{tokens}", f"{acc_length:.3f}", f"{speed:.2f}"]]
msg = tabulate.tabulate(rows, headers=headers, tablefmt="pretty")