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

[SW-196453] Move finish_measurements to DTOR #181

Closed
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
3 changes: 0 additions & 3 deletions vllm/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,6 @@ def _process_model_outputs(
request_outputs.append(request_output)
return request_outputs

def finish_measurements(self):
self.model_executor.finish_measurements()

def step(self) -> List[Union[RequestOutput, EmbeddingRequestOutput]]:
"""Performs one decoding iteration and returns newly generated results.

Expand Down
3 changes: 0 additions & 3 deletions vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ def set_tokenizer(
self.llm_engine.tokenizer.tokenizer = get_cached_tokenizer(
tokenizer)

def finish_measurements(self):
self.llm_engine.finish_measurements()

@overload # LEGACY: single (prompt + optional token ids)
def generate(
self,
Expand Down
3 changes: 0 additions & 3 deletions vllm/executor/habana_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ def initialize_cache(self, num_gpu_blocks: int, num_cpu_blocks) -> None:
msg = f"init_cache_engine took {cache_init_m.get_summary_string()}"
logger.info(msg)

def finish_measurements(self):
self.driver_worker.finish_measurements()

def execute_model(
self,
execute_model_req: ExecuteModelRequest) -> List[SamplerOutput]:
Expand Down
3 changes: 0 additions & 3 deletions vllm/executor/ray_habana_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ def _driver_execute_model(
return self.driver_worker.execute_method("execute_model",
execute_model_req)

def finish_measurements(self):
self._run_workers("finish_measurements")

def execute_model(
self,
execute_model_req: ExecuteModelRequest) -> List[SamplerOutput]:
Expand Down
1 change: 1 addition & 0 deletions vllm/worker/habana_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,4 +1503,5 @@ def shutdown_inc(self):
print('inc shutdown')

def __del__(self):
self.finish_measurements()
Copy link
Author

Choose a reason for hiding this comment

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

@MrGeva
I see the in HabanaModelRunner the finalize_clibration (== self.finish_measurements) is called at shutdown_inc (above method)
Why then did we need to move finish_measurements to the DTOR?

self.shutdown_inc()
3 changes: 0 additions & 3 deletions vllm/worker/habana_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ def _warm_up_model(self) -> None:
# the model initialization and profiling.
set_random_seed(self.model_config.seed)

def finish_measurements(self):
self.model_runner.finish_measurements()

@property
def do_metadata_broadcast(self) -> bool:
return self.parallel_config.tensor_parallel_size > 1
Expand Down