Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run with HPU graphs even when warmup was skipped #320

Merged
merged 2 commits into from
Sep 23, 2024
Merged
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
7 changes: 6 additions & 1 deletion vllm/worker/habana_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ def _set_gc_threshold(self) -> None:
self.multi_modal_input_mapper = MULTIMODAL_REGISTRY \
.create_input_mapper(self.model_config)

self.skip_warmup = os.environ.get('VLLM_SKIP_WARMUP',
'false').lower() == 'true'

def load_model(self) -> None:
import habana_frameworks.torch.core as htcore
if self.model_config.quantization == 'inc':
Expand Down Expand Up @@ -647,6 +650,8 @@ def load_model(self) -> None:
def _use_graphs(self, batch_size, seq_len, is_prompt):
if self.enforce_eager:
return False
if self.skip_warmup:
return True
return (batch_size, seq_len, is_prompt) in self.graphed_buckets

def _is_valid_bucket(self, bucket):
Expand Down Expand Up @@ -1501,7 +1506,7 @@ def warmup_model(self, kv_caches: List[torch.Tensor]) -> None:
self.warmup_scenario(int(bs), int(seq_len), is_prompt, kv_caches,
True)
raise AssertionError("Finished profiling")
if os.environ.get('VLLM_SKIP_WARMUP', 'false').lower() == 'true':
if self.skip_warmup:
logger.info("Skipping warmup...")
return
self.profiler.start('internal', 'warmup')
Expand Down
Loading