mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-26 01:24:26 +08:00
[Misc] refactor neuron_multimodal and profiling (#19397)
Signed-off-by: reidliu41 <reid201711@gmail.com> Co-authored-by: reidliu41 <reid201711@gmail.com>
This commit is contained in:
parent
a3f66e75d1
commit
6b1391ca7e
@ -64,7 +64,7 @@ def print_outputs(outputs):
|
|||||||
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
assert (
|
assert (
|
||||||
len(PROMPTS) == len(IMAGES) == len(SAMPLING_PARAMS)
|
len(PROMPTS) == len(IMAGES) == len(SAMPLING_PARAMS)
|
||||||
), f"""Text, image prompts and sampling parameters should have the
|
), f"""Text, image prompts and sampling parameters should have the
|
||||||
@ -104,3 +104,7 @@ if __name__ == "__main__":
|
|||||||
# test batch-size = 4
|
# test batch-size = 4
|
||||||
outputs = llm.generate(batched_inputs, batched_sample_params)
|
outputs = llm.generate(batched_inputs, batched_sample_params)
|
||||||
print_outputs(outputs)
|
print_outputs(outputs)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
@ -70,7 +70,7 @@ def main(args: argparse.Namespace):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def parse_args():
|
||||||
parser = FlexibleArgumentParser(
|
parser = FlexibleArgumentParser(
|
||||||
description="Benchmark the latency of processing a single batch of "
|
description="Benchmark the latency of processing a single batch of "
|
||||||
"requests till completion."
|
"requests till completion."
|
||||||
@ -102,5 +102,9 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
|
|
||||||
parser = EngineArgs.add_cli_args(parser)
|
parser = EngineArgs.add_cli_args(parser)
|
||||||
args = parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
args = parse_args()
|
||||||
main(args)
|
main(args)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user