Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vllm/inputs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ def dummy_data_for_profiling(
from vllm.multimodal import MultiModalKwargs
from vllm.multimodal.profiling import MultiModalProfiler

if seq_len > model_config.max_model_len:
raise AssertionError(
f"Profiling attempted with sequence length ({seq_len}) "
f"greater than model length ({model_config.max_model_len})")

if mm_registry.has_processor(model_config):
tokenizer = cached_tokenizer_from_config(model_config)
processor = mm_registry.create_processor(model_config,
Expand Down
1 change: 1 addition & 0 deletions vllm/worker/enc_dec_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def profile_run(self) -> None:
for group_id in range(max_num_seqs):
seq_len = (max_num_batched_tokens // max_num_seqs +
(group_id < max_num_batched_tokens % max_num_seqs))
seq_len = min(seq_len, self.model_config.max_model_len)
batch_size += seq_len

decoder_dummy_data = self.input_registry \
Expand Down
1 change: 1 addition & 0 deletions vllm/worker/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ def _dummy_run(self,
for group_id in range(max_num_seqs):
seq_len = (max_num_batched_tokens // max_num_seqs +
(group_id < max_num_batched_tokens % max_num_seqs))
seq_len = min(seq_len, self.model_config.max_model_len)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check other model runners as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not intimately familiar with the other runners, but I've replicated the cap on xpu

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also openvino model runner

batch_size += seq_len

dummy_data = self.input_registry \
Expand Down
1 change: 1 addition & 0 deletions vllm/worker/openvino_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def _prepare_model_input(
seq_len = min(
seq_data.get_len(),
computed_len + seq_group_metadata.token_chunk_size,
self.model_config.max_model_len,
)
if is_prompt:
tokens = seq_data.get_token_ids()[computed_len:seq_len]
Expand Down
1 change: 1 addition & 0 deletions vllm/worker/xpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def profile_run(self) -> None:
for group_id in range(max_num_seqs):
seq_len = (max_num_batched_tokens // max_num_seqs +
(group_id < max_num_batched_tokens % max_num_seqs))
seq_len = min(seq_len, self.model_config.max_model_len)
batch_size += seq_len

dummy_data = self.input_registry \
Expand Down