CI: use 'sglang serve' in CI tests (#18597)
Co-authored-by: Mick <mickjagger19@icloud.com> Co-authored-by: sglang-bot <sglangbot@gmail.com>
This commit is contained in:
@@ -879,18 +879,22 @@ def popen_launch_server(
|
||||
|
||||
use_mixed_pd_engine = not pd_separated and num_replicas is not None
|
||||
if pd_separated or use_mixed_pd_engine:
|
||||
command = "sglang.launch_pd_server"
|
||||
command = [
|
||||
"python3",
|
||||
"-m",
|
||||
"sglang.launch_pd_server",
|
||||
"--model-path",
|
||||
model,
|
||||
*[str(x) for x in other_args],
|
||||
]
|
||||
else:
|
||||
command = "sglang.launch_server"
|
||||
|
||||
command = [
|
||||
"python3",
|
||||
"-m",
|
||||
command,
|
||||
"--model-path",
|
||||
model,
|
||||
*[str(x) for x in other_args],
|
||||
]
|
||||
command = [
|
||||
"sglang",
|
||||
"serve",
|
||||
"--model-path",
|
||||
model,
|
||||
*[str(x) for x in other_args],
|
||||
]
|
||||
|
||||
if pd_separated or use_mixed_pd_engine:
|
||||
command.extend(["--lb-host", host, "--lb-port", port])
|
||||
@@ -1308,7 +1312,7 @@ def run_score_benchmark(
|
||||
json=warmup_data,
|
||||
timeout=aiohttp.ClientTimeout(total=30),
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
pass # Ignore warmup errors
|
||||
|
||||
test_requests = []
|
||||
@@ -1376,17 +1380,9 @@ def run_embeddings_benchmark(
|
||||
|
||||
async def _run_benchmark():
|
||||
|
||||
# Load tokenizer for generating test data
|
||||
from sglang.srt.utils.hf_transformers_utils import get_tokenizer
|
||||
|
||||
tokenizer = get_tokenizer(model)
|
||||
|
||||
def generate_text_with_token_count(num_tokens):
|
||||
"""Generate text with precise token count using special tokens."""
|
||||
# Use a token that reliably produces 1 token
|
||||
special_token = "<|im_start|>"
|
||||
# Verify it's a single token
|
||||
test_tokens = tokenizer.encode(special_token, add_special_tokens=False)
|
||||
text = special_token * num_tokens
|
||||
return text
|
||||
|
||||
@@ -1406,7 +1402,7 @@ def run_embeddings_benchmark(
|
||||
json=warmup_data,
|
||||
timeout=aiohttp.ClientTimeout(total=30),
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
pass # Ignore warmup errors
|
||||
|
||||
test_requests = []
|
||||
@@ -1822,7 +1818,7 @@ def run_mulit_request_test(
|
||||
},
|
||||
},
|
||||
)
|
||||
ret = response.json()
|
||||
response.json()
|
||||
|
||||
with ThreadPoolExecutor(2) as executor:
|
||||
list(executor.map(run_one, list(range(4))))
|
||||
|
||||
Reference in New Issue
Block a user