Continuous Batching¶
Sohu runs inference in batches. Generally LLMs run inference in batches already. They’ll load up the weights one time and run a forward pass on as many sequences as it possibly can. There’s generally a few ways this is done: static batching and continuous batching.
In static batching, we’ll process say 4 sequences at a time.
The obvious problem here is that sequences don’t all end at the same time. S_2 finished significantly faster than S_4, so we’re wasting compute.
But with continuous batching, as soon as one sequence finishes processing, a new sequence will take its place. Let’s watch it happen in real time:
# Don't forget to run this cell!! It might take a while
!pip install https://storage.googleapis.com/etched-blitz/etched_blitz-0.0.1-cp310-cp310-manylinux1_x86_64.whl
!pip install aiofiles
from vllm import LLMEngine, EngineArgs
from vllm.utils import random_uuid
engine = LLMEngine.from_engine_args(EngineArgs(
model="microsoft/Phi-3-mini-4k-instruct",
dtype="half",
max_num_batched_tokens=9,
max_num_seqs=8,
disable_sliding_window=True,
enable_chunked_prefill=True,
disable_log_stats=True,
enable_log_batch_visualization=True))
WARNING 07-03 18:44:17 config.py:1286] Casting torch.bfloat16 to torch.float16.
INFO 07-03 18:44:17 config.py:727] Chunked prefill is enabled (EXPERIMENTAL).
INFO 07-03 18:44:17 llm_engine.py:166] Initializing an LLM engine (v0.0.1) with config: model='microsoft/Phi-3-mini-4k-instruct', speculative_config=None, tokenizer='microsoft/Phi-3-mini-4k-instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, rope_scaling=None, rope_theta=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=2047, download_dir=None, load_format=LoadFormat.AUTO, tensor_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, kv_cache_dtype=auto, quantization_param_path=None, device_config=cuda, decoding_config=DecodingConfig(guided_decoding_backend='outlines'), observability_config=ObservabilityConfig(otlp_traces_endpoint=None), seed=0, served_model_name=microsoft/Phi-3-mini-4k-instruct)
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
INFO 07-03 18:44:21 weight_utils.py:218] Using model weights format ['*.safetensors']
INFO 07-03 18:44:23 model_runner.py:225] Loading model weights took 7.1183 GB
INFO 07-03 18:44:23 gpu_executor.py:83] # GPU blocks: 2162, # CPU blocks: 682
INFO 07-03 18:44:25 model_runner.py:840] Capturing the model for CUDA graphs. This may lead to unexpected consequences if the model is not static. To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI.
INFO 07-03 18:44:25 model_runner.py:844] CUDA graphs can take additional 1~3 GiB memory per GPU. If you are running out of memory, consider decreasing `gpu_memory_utilization` or enforcing eager mode. You can also reduce the `max_num_seqs` as needed to decrease memory usage.
INFO 07-03 18:44:26 model_runner.py:916] Graph capturing finished in 1 secs.
import time
from IPython.display import clear_output
from vllm import SamplingParams
prompts = [
"Hello my name is",
"The president's",
"water boils at",
"The capital of France",
"Cats really like",
"The sun rises",
"Humans are a",
"The largest planet is",
"Snow is very very",
"Birds use their",
"Fish swim in"
]
sampling_params = SamplingParams(temperature=0, top_p=0.95, max_tokens=4)
all_requests = []
for prompt in prompts:
all_requests.append((random_uuid(), prompt, sampling_params))
while True:
if all_requests:
req_id, prompt, sp = all_requests.pop(0)
engine.add_request(req_id, prompt, sp)
clear_output(wait=True)
outputs = engine.step()
formatted_outputs = []
for output in outputs:
print(f"{output.prompt}: {output.outputs[0].text}")
time.sleep(2)
if not engine.has_unfinished_requests():
break
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐ │ Hello │ └──────────────┘ ┌──────────────┐ │ my │ └──────────────┘ ┌──────────────┐ │ name │ └──────────────┘ ┌──────────────┐ │ is │ └──────────────┘ Hello my name is: John
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐ │ Hello ││ The │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ my ││ president │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ name ││ ' │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ is ││ s │ └──────────────┘└──────────────┘ ┌──────────────┐ │ John │ └──────────────┘ The president's: role Hello my name is: John and
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ John ││ and │ └──────────────┘└──────────────┘ ┌──────────────┐ │ role │ └──────────────┘ water boils at: Hello my name is: John and I The president's: role in
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water ││ The │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo ││ capital │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils ││ of │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at ││ France │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ role ││ in │ └──────────────┘└──────────────┘ ┌──────────────┐ │ │ └──────────────┘ The capital of France: is Hello my name is: John and I am The president's: role in the water boils at: 1
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water ││ The ││ C │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo ││ capital ││ ats │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils ││ of ││ really │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at ││ France ││ like │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ ││ is │ └──────────────┘└──────────────┘ Cats really like: to The president's: role in the legisl water boils at: 10 The capital of France: is Paris
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water ││ The ││ C ││ The │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo ││ capital ││ ats ││ sun │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils ││ of ││ really ││ r │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at ││ France ││ like ││ ises │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I ││ the ││ 0 │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 ││ Paris │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to │ └──────────────┘└──────────────┘└──────────────┘ The sun rises: in water boils at: 100 The capital of France: is Paris. Cats really like: to be
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water ││ The ││ C ││ The ││ Hum │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo ││ capital ││ ats ││ sun ││ ans │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils ││ of ││ really ││ r ││ are │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at ││ France ││ like ││ ises ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I ││ the ││ 0 ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 ││ Paris ││ be │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to ││ in │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ Humans are a: part The capital of France: is Paris. Cats really like: to be p The sun rises: in the
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hello ││ The ││ water ││ The ││ C ││ The ││ Hum ││ The │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ my ││ president ││ bo ││ capital ││ ats ││ sun ││ ans ││ largest │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ name ││ ' ││ ils ││ of ││ really ││ r ││ are ││ planet │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ s ││ at ││ France ││ like ││ ises ││ a ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I ││ the ││ 0 ││ . ││ p │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 ││ Paris ││ be ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to ││ in ││ part │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ The largest planet is: Jup Cats really like: to be pett The sun rises: in the east Humans are a: part of
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ The ││ water ││ The ││ C ││ The ││ Hum ││ The ││ Snow │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ president ││ bo ││ capital ││ ats ││ sun ││ ans ││ largest ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ' ││ ils ││ of ││ really ││ r ││ are ││ planet ││ very │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ s ││ at ││ France ││ like ││ ises ││ a ││ is ││ very │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ John ││ and ││ I ││ the ││ 0 ││ . ││ p ││ east │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 ││ Paris ││ be ││ the ││ of │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to ││ in ││ part ││ Jup │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Snow is very very: cold The sun rises: in the east and Humans are a: part of the The largest planet is: Jupiter
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ water ││ The ││ C ││ The ││ Hum ││ The ││ Snow ││ Bird │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ bo ││ capital ││ ats ││ sun ││ ans ││ largest ││ is ││ s │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ils ││ of ││ really ││ r ││ are ││ planet ││ very ││ use │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ at ││ France ││ like ││ ises ││ a ││ is ││ very ││ their │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ and ││ I ││ the ││ 0 ││ . ││ p ││ east ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ role ││ in ││ 1 ││ Paris ││ be ││ the ││ of ││ iter │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to ││ in ││ part ││ Jup ││ cold │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Birds use their: be Humans are a: part of the natural The largest planet is: Jupiter. Snow is very very: cold.
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ The ││ C ││ The ││ Hum ││ The ││ Snow ││ Bird ││ Fish │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ capital ││ ats ││ sun ││ ans ││ largest ││ is ││ s ││ sw │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ of ││ really ││ r ││ are ││ planet ││ very ││ use ││ im │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ France ││ like ││ ises ││ a ││ is ││ very ││ their ││ in │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ I ││ the ││ 0 ││ . ││ p ││ east ││ the ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ 1 ││ Paris ││ be ││ the ││ of ││ iter ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ is ││ to ││ in ││ part ││ Jup ││ cold ││ be │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Fish swim in: a The largest planet is: Jupiter. Snow is very very: cold. Birds use their: beaks
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ C ││ The ││ Hum ││ The ││ Snow ││ Bird ││ Fish ││ \n │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ats ││ sun ││ ans ││ largest ││ is ││ s ││ sw ││ aks │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ really ││ r ││ are ││ planet ││ very ││ use ││ im ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ like ││ ises ││ a ││ is ││ very ││ their ││ in │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ the ││ 0 ││ . ││ p ││ east ││ the ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ 1 ││ Paris ││ be ││ the ││ of ││ iter ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ to ││ in ││ part ││ Jup ││ cold ││ be │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Snow is very very: cold. Birds use their: beaks to Fish swim in: a pattern
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ The ││ Hum ││ The ││ Snow ││ Bird ││ Fish ││ \n ││ to │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ sun ││ ans ││ largest ││ is ││ s ││ sw ││ aks ││ pattern │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ r ││ are ││ planet ││ very ││ use ││ im ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ises ││ a ││ is ││ very ││ their ││ in │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ 0 ││ . ││ p ││ east ││ the ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Paris ││ be ││ the ││ of ││ iter ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ to ││ in ││ part ││ Jup ││ cold ││ be │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Birds use their: beaks to pe Fish swim in: a pattern that
Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hum ││ The ││ Snow ││ Bird ││ Fish ││ \n ││ to ││ that │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ans ││ largest ││ is ││ s ││ sw ││ aks ││ pattern │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ are ││ planet ││ very ││ use ││ im ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ a ││ is ││ very ││ their ││ in │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ p ││ east ││ the ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ be ││ the ││ of ││ iter ││ . │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ part ││ Jup ││ cold ││ be │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ Fish swim in: a pattern that doubles
What’s happening here is that on every step (forward pass) the engine takes, we are adding another sequence for it to process. Each sequence is getting batched together with previously running sequences. For example, “The largest planet it” is getting prefilled, while the other tokens in the batch are all begin decoded.
You might be wondering, isn’t this going to make all decodes slow? Normally, yes. On a GPU, running prefills and decodes in the same batch would slow down every single batch, and thus inter-token latency (ITL), since prefills take so much longer than a decode. However, Sohu is able to perform the entire prefill in ~6ms. Thus, we’re able to get state-of-the-art time to first token (TTFT) while not trading off any ITL speed.
OpenAI compatible server¶
Let’s see this behavior deployed to an OpenAI compatible server, something you might be using in production
# Free model from memory
import gc
import torch
from vllm.distributed.parallel_state import destroy_model_parallel
destroy_model_parallel()
del engine.model_executor.driver_worker
del engine
gc.collect()
torch.cuda.empty_cache()
Start an OpenAI server running on http://localhost:8000
%%bash
nohup python3 -m vllm.entrypoints.openai.api_server \
--model microsoft/Phi-3-mini-4k-instruct \
--enable-chunked-prefill \
--disable-sliding-window \
--max-num-batched-tokens=12 \
--max-num-seqs=12 \
--dtype=half \
--enable-log-batch-visualization \
> server_output.log 2>&1 &
# Store the PID of the background process
SERVER_PID=$!
echo "vLLM server starting with PID: $SERVER_PID"
echo $SERVER_PID > .vllm_server_pid.txt
# Function to check if the server is ready
check_server() {
curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/v1/models
}
# Wait for the server to be ready
echo "Waiting for the server to be ready..."
while true; do
HTTP_STATUS=$(check_server)
if [ "$HTTP_STATUS" -eq 200 ]; then
echo "Server is ready!"
break
fi
echo "Server not ready yet. Retrying in 5 seconds..."
sleep 5
done
echo "vLLM server is up and running!"
vLLM server starting with PID: 11169
Waiting for the server to be ready...
Server not ready yet. Retrying in 5 seconds...
Server not ready yet. Retrying in 5 seconds...
Server not ready yet. Retrying in 5 seconds...
Server is ready!
vLLM server is up and running!
Here we instantiate an AsyncOpenAI server and send in three messages. Watch how Blitz chooses to batch together the tokens:
import asyncio
import time
from openai import AsyncOpenAI
from IPython.display import clear_output
# Set OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"
client = AsyncOpenAI(
api_key=openai_api_key,
base_url=openai_api_base,
)
async def process_message(message):
response = await client.chat.completions.create(
model="microsoft/Phi-3-mini-4k-instruct",
messages=[{"role": "user", "content": message}],
max_tokens=24,
temperature=0.7
)
return response.choices[0].message.content
def get_next_batch(file_path, line_to_start_at):
try:
with open(file_path, 'rb') as file:
file.seek(0, 2) # Go to the end of the file
file_size = file.tell()
if line_to_start_at >= file_size:
return None, line_to_start_at # No new content
file.seek(line_to_start_at)
content = file.read()
lines = content.split(b'\n')
batch_start = None
for i, line in enumerate(lines):
if b'Batch' in line:
batch_start = i
break
if batch_start is not None:
batch_lines = []
for j in range(batch_start, len(lines)):
if b'INFO' in lines[j] or (b'Batch' in lines[j] and j > batch_start):
break
batch_lines.append(lines[j])
if batch_lines:
next_batch = b'\n'.join(batch_lines).decode('utf-8', errors='replace')
new_line_to_start_at = line_to_start_at + sum(len(line) + 1 for line in lines[:j])
return next_batch, new_line_to_start_at
return None, file_size # No batch found, return the current file size as the new starting point
except Exception as e:
print(f"Error reading log file: {str(e)}")
return None, line_to_start_at
def print_batches(log_file_path):
last_processed_line = 0
while True:
batch, last_processed_line = get_next_batch(log_file_path, last_processed_line)
if batch:
clear_output(wait=True)
print(f"Batch:\n{batch}\n")
time.sleep(1) # 1 second delay between batch prints
else:
break
async def main():
messages = [
"Tell me a joke about programming.",
"Explain quantum computing in simple terms.",
"What are the main features of Python?"
]
# Process messages concurrently
responses = await asyncio.gather(*[process_message(msg) for msg in messages])
# Print batches
print_batches('server_output.log')
# Print final results
clear_output(wait=True)
print("Final results:")
for i, (message, response) in enumerate(zip(messages, responses)):
print(f"\nMessage {i+1}: {message}")
print(f"Response: {response}")
loop = asyncio.get_running_loop()
await loop.create_task(main())
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐ │ <|user|> │ └──────────────┘ ┌──────────────┐ │ Exp │ └──────────────┘ ┌──────────────┐ │ lain │ └──────────────┘ ┌──────────────┐ │ quantum │ └──────────────┘ ┌──────────────┐ │ computing │ └──────────────┘ ┌──────────────┐ │ in │ └──────────────┘ ┌──────────────┐ │ simple │ └──────────────┘ ┌──────────────┐ │ terms │ └──────────────┘ ┌──────────────┐ │ . │ └──────────────┘ ┌──────────────┐ │ <|end|> │ └──────────────┘ ┌──────────────┐ │ <|assistan.. │ └──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Exp ││ Tell │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ lain ││ me │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ quantum ││ a │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ computing ││ jo │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ in ││ ke │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ simple ││ about │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ terms ││ programming │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ . ││ . │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. │ └──────────────┘└──────────────┘ ┌──────────────┐ │ Quant │ └──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> ││ <|assistan.. │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What ││ computing │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are ││ do │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> ││ <|assistan.. ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What ││ computing ││ program │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are ││ do ││ Python │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> ││ <|assistan.. ││ is ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What ││ computing ││ program ││ mers │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are ││ do ││ Python ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> ││ <|assistan.. ││ is ││ a ││ type │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What ││ computing ││ program ││ mers ││ always │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are ││ do ││ Python ││ is ││ a │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|user|> ││ <|assistan.. ││ is ││ a ││ type ││ of │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Exp ││ Tell ││ What ││ computing ││ program ││ mers ││ always ││ mix │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ lain ││ me ││ are ││ do ││ Python ││ is ││ a ││ high │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ a ││ the │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ jo ││ main │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ in ││ ke ││ features │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ simple ││ about ││ of │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ terms ││ programming ││ Python │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ . ││ . ││ ? │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ <|assistan.. ││ um │ └──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|user|> ││ <|assistan.. ││ is ││ a ││ type ││ of ││ computing │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Tell ││ What ││ computing ││ program ││ mers ││ always ││ mix ││ up │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ me ││ are ││ do ││ Python ││ is ││ a ││ high ││ - │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ a ││ the │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ jo ││ main │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ ke ││ features │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ about ││ of │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ programming ││ Python │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ . ││ ? │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ <|end|> ││ <|end|> │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ <|assistan.. ││ um │ └──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐ │ Quant ││ Why │ └──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|user|> ││ <|assistan.. ││ is ││ a ││ type ││ of ││ computing ││ that │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ What ││ computing ││ program ││ mers ││ always ││ mix ││ up ││ Hall │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ are ││ do ││ Python ││ is ││ a ││ high ││ - ││ level │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐ │ the │ └──────────────┘ ┌──────────────┐ │ main │ └──────────────┘ ┌──────────────┐ │ features │ └──────────────┘ ┌──────────────┐ │ of │ └──────────────┘ ┌──────────────┐ │ Python │ └──────────────┘ ┌──────────────┐ │ ? │ └──────────────┘ ┌──────────────┐ │ <|end|> │ └──────────────┘ ┌──────────────┐ │ um │ └──────────────┘ ┌──────────────┐ │ Why │ └──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ <|assistan.. ││ is ││ a ││ type ││ of ││ computing ││ that ││ uses │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ program ││ mers ││ always ││ mix ││ up ││ Hall ││ owe │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ do ││ Python ││ is ││ a ││ high ││ - ││ level ││ , │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ a ││ type ││ of ││ computing ││ that ││ uses ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ program ││ mers ││ always ││ mix ││ up ││ Hall ││ owe ││ en │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Python ││ is ││ a ││ high ││ - ││ level ││ , ││ interpreted │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ a ││ type ││ of ││ computing ││ that ││ uses ││ the ││ principles │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ mers ││ always ││ mix ││ up ││ Hall ││ owe ││ en ││ and │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ is ││ a ││ high ││ - ││ level ││ , ││ interpreted ││ programming │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ type ││ of ││ computing ││ that ││ uses ││ the ││ principles ││ of │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ always ││ mix ││ up ││ Hall ││ owe ││ en ││ and ││ Christmas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ a ││ high ││ - ││ level ││ , ││ interpreted ││ programming ││ language │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ of ││ computing ││ that ││ uses ││ the ││ principles ││ of ││ quantum │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ mix ││ up ││ Hall ││ owe ││ en ││ and ││ Christmas ││ ? │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ high ││ - ││ level ││ , ││ interpreted ││ programming ││ language ││ with │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ computing ││ that ││ uses ││ the ││ principles ││ of ││ quantum ││ mechan │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ up ││ Hall ││ owe ││ en ││ and ││ Christmas ││ ? ││ \n │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ - ││ level ││ , ││ interpreted ││ programming ││ language ││ with ││ dynamic │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ that ││ uses ││ the ││ principles ││ of ││ quantum ││ mechan ││ ics │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Hall ││ owe ││ en ││ and ││ Christmas ││ ? ││ \n ││ \n │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ level ││ , ││ interpreted ││ programming ││ language ││ with ││ dynamic ││ typing │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ uses ││ the ││ principles ││ of ││ quantum ││ mechan ││ ics ││ , │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ owe ││ en ││ and ││ Christmas ││ ? ││ \n ││ \n ││ \n │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ , ││ interpreted ││ programming ││ language ││ with ││ dynamic ││ typing ││ , │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ the ││ principles ││ of ││ quantum ││ mechan ││ ics ││ , ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ en ││ and ││ Christmas ││ ? ││ \n ││ \n ││ \n ││ B │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ interpreted ││ programming ││ language ││ with ││ dynamic ││ typing ││ , ││ clear │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ principles ││ of ││ quantum ││ mechan ││ ics ││ , ││ the ││ science │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ and ││ Christmas ││ ? ││ \n ││ \n ││ \n ││ B ││ ecause │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ programming ││ language ││ with ││ dynamic ││ typing ││ , ││ clear ││ syntax │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ of ││ quantum ││ mechan ││ ics ││ , ││ the ││ science ││ of │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Christmas ││ ? ││ \n ││ \n ││ \n ││ B ││ ecause ││ Oct │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ language ││ with ││ dynamic ││ typing ││ , ││ clear ││ syntax ││ , │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ quantum ││ mechan ││ ics ││ , ││ the ││ science ││ of ││ the │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ? ││ \n ││ \n ││ \n ││ B ││ ecause ││ Oct ││ │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ with ││ dynamic ││ typing ││ , ││ clear ││ syntax ││ , ││ and │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ mechan ││ ics ││ , ││ the ││ science ││ of ││ the ││ very │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ \n ││ \n ││ \n ││ B ││ ecause ││ Oct ││ ││ 3 │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ dynamic ││ typing ││ , ││ clear ││ syntax ││ , ││ and ││ an │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ics ││ , ││ the ││ science ││ of ││ the ││ very ││ small │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ \n ││ \n ││ B ││ ecause ││ Oct ││ ││ 3 ││ 1 │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ typing ││ , ││ clear ││ syntax ││ , ││ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ , ││ the ││ science ││ of ││ the ││ very ││ small ││ equals │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ \n ││ B ││ ecause ││ Oct ││ ││ 3 ││ 1 ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ , ││ clear ││ syntax ││ , ││ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ the ││ science ││ of ││ the ││ very ││ small ││ equals ││ on │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ B ││ ecause ││ Oct ││ ││ 3 ││ 1 ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ clear ││ syntax ││ , ││ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ science ││ of ││ the ││ very ││ small ││ equals ││ on ││ read │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ecause ││ Oct ││ ││ 3 ││ 1 ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ syntax ││ , ││ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ of ││ the ││ very ││ small ││ equals ││ on ││ read │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ Oct ││ ││ 3 ││ 1 ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ , ││ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘
Batch: Batch 1 Batch 2 Batch 3 Batch 4 Batch 5 Batch 6 Batch 7 Batch 8 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ the ││ very ││ small ││ equals ││ on ││ read │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐ │ ││ 3 ││ 1 ││ is │ └──────────────┘└──────────────┘└──────────────┘└──────────────┘ ┌──────────────┐┌──────────────┐┌──────────────┐ │ and ││ an ││ emphas │ └──────────────┘└──────────────┘└──────────────┘
Final results:
Message 1: Tell me a joke about programming.
Response: Why do programmers always mix up Halloween and Christmas?
Because Oct 31 equals Dec
Message 2: Explain quantum computing in simple terms.
Response: Quantum computing is a type of computing that uses the principles of quantum mechanics, the science of the very small,
Message 3: What are the main features of Python?
Response: Python is a high-level, interpreted programming language with dynamic typing, clear syntax, and an emphasis on readability
# To kill the server if you want to try some other configuration
import os
import signal
def kill_vllm_server():
try:
with open('.vllm_server_pid.txt', 'r') as f:
pid = int(f.read().strip())
os.kill(pid, signal.SIGTERM)
print(f"SIGTERM signal sent to process {pid}")
# Wait a bit and check if the process is still running
import time
time.sleep(2)
try:
os.kill(pid, 0) # This will raise an OSError if the process is not running
print(f"Process {pid} is still running. Sending SIGKILL...")
os.kill(pid, signal.SIGKILL)
print(f"SIGKILL signal sent to process {pid}")
except OSError:
print(f"Process {pid} has been terminated successfully")
# Clean up the PID file
os.remove('.vllm_server_pid.txt')
except FileNotFoundError:
print("PID file not found. Server might not be running.")
except ProcessLookupError:
print(f"Process {pid} not found. It may have already terminated.")
except Exception as e:
print(f"An error occurred: {e}")
kill_vllm_server()
SIGTERM signal sent to process 11169
Process 11169 has been terminated successfully