TensorRT-LLMs/tests/llmapi/run_llm_exit.py
石晓伟 8f91cff22e
TensorRT-LLM Release 0.15.0 (#2529)
Co-authored-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
2024-12-04 13:44:56 +08:00

30 lines
706 B
Python

import os
import subprocess
import sys
import click
@click.command()
@click.option("--model_dir", type=str, required=True)
@click.option("--tp_size", type=int, required=True)
def main(model_dir: str, tp_size: int):
run_cmd = [
sys.executable,
os.path.join(os.path.dirname(__file__), "run_llm.py"),
"--model_dir",
model_dir,
"--tp_size",
str(tp_size),
"--prompt",
"This is an over-long prompt that intentionlly trigger failure. " *
1000,
]
# Will raise TimeoutExpired exception if timeout
res = subprocess.run(run_cmd, check=False, timeout=600)
assert res.returncode != 0
if __name__ == '__main__':
main()