Skip to content
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
23 changes: 8 additions & 15 deletions vllm/v1/engine/async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import warnings
from collections.abc import AsyncGenerator, Iterable, Mapping
from copy import copy
from typing import Any

import torch
from typing import Any, Optional

import vllm.envs as envs
from vllm import TokensPrompt
Expand All @@ -34,6 +32,7 @@
from vllm.multimodal import MULTIMODAL_REGISTRY, MultiModalRegistry
from vllm.outputs import STREAM_FINISHED, PoolingRequestOutput, RequestOutput
from vllm.pooling_params import PoolingParams
from vllm.profiler.wrapper import TorchProfilerWrapper
from vllm.renderers import renderer_from_config
from vllm.renderers.inputs.preprocess import extract_prompt_components
from vllm.sampling_params import RequestOutputKind, SamplingParams
Expand Down Expand Up @@ -92,6 +91,7 @@ def __init__(
client_addresses: dict[str, Any] | None = None,
client_count: int = 1,
client_index: int = 0,
profiler: Optional[TorchProfilerWrapper] = None, # type: ignore # noqa
) -> None:
"""
Create an AsyncLLM.
Expand Down Expand Up @@ -195,19 +195,12 @@ def __init__(
profiler_dir,
)
worker_name = f"{socket.gethostname()}_{os.getpid()}.async_llm"
self.profiler = torch.profiler.profile(
activities=[
torch.profiler.ProfilerActivity.CPU,
],
with_stack=vllm_config.profiler_config.torch_profiler_with_stack,
on_trace_ready=torch.profiler.tensorboard_trace_handler(
profiler_dir,
worker_name=worker_name,
use_gzip=vllm_config.profiler_config.torch_profiler_use_gzip,
),
self.profiler = TorchProfilerWrapper(
vllm_config.profiler_config,
worker_name=worker_name,
local_rank=0,
activities=["CPU"],
)
else:
self.profiler = None

@classmethod
def from_vllm_config(
Expand Down
Loading