Unverified Commit 57454300 authored by Graham King's avatar Graham King Committed by GitHub
Browse files

chore(sglang): Warn if --skip-tokenizer-init missing (#2463)

parent 3ef08d40
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import contextlib
......@@ -22,7 +10,19 @@ from argparse import Namespace
from sglang.srt.server_args import ServerArgs
class SkipTokenizerInitError(RuntimeError):
def __init__(self):
super().__init__("--skip-tokenizer-init flag is required")
def parse_sglang_args_inc(args: list[str]) -> ServerArgs:
# Currently we only support Dynamo doing the tokenization, so we must give
# sglang the skip-tokenizer-init flag. We don't default it because this is temporary.
# Allow the --version and --help flags through.
temp_need_tok = ["--skip-tokenizer-init", "--version", "--help", "-h"]
if not any(w in args for w in temp_need_tok):
raise SkipTokenizerInitError()
parser = argparse.ArgumentParser()
bootstrap_port = _reserve_disaggregation_bootstrap_port()
ServerArgs.add_cli_args(parser)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment