Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make decode log interval configurable #1847

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/sglang/srt/managers/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def process_batch_result_decode(self, batch: ScheduleBatch, result):
self.token_to_kv_pool.free_group_end()

self.forward_ct_decode = (self.forward_ct_decode + 1) % (1 << 30)
if self.tp_rank == 0 and self.forward_ct_decode % 40 == 0:
if self.tp_rank == 0 and self.forward_ct_decode % self.server_args.decode_log_interval == 0:
self.print_decode_stats()

def add_logprob_return_values(
Expand Down
7 changes: 7 additions & 0 deletions python/sglang/srt/server_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ServerArgs:
stream_interval: int = 1
random_seed: Optional[int] = None
constrained_json_whitespace_pattern: Optional[str] = None
decode_log_interval: int = 40

# Logging
log_level: str = "info"
Expand Down Expand Up @@ -436,6 +437,12 @@ def add_cli_args(parser: argparse.ArgumentParser):
default=ServerArgs.watchdog_timeout,
help="Set watchdog timeout in seconds. If a forward batch takes longer than this, the server will crash to prevent hanging.",
)
parser.add_argument(
"--decode-log-interval",
type=int,
default=ServerArgs.decode_log_interval,
help="The log interval of decode batch"
)

# Data parallelism
parser.add_argument(
Expand Down
Loading