@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 20cf2f553c
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 08:15 UTC

[Misc] small fixes to function tracing file path (#9543)

Signed-off-by: Shawn Du <shawnd200@outlook.com> Signed-off-by: youkaichao <youkaichao@gmail.com> Co-authored-by: youkaichao <youkaichao@gmail.com>

Shawn Du committed Nov 11, 2024 at 07:21 UTC 20cf2f553c223792ad3f65236b267586fa9bed6c
3 files changed +8 -4
docs/source/index.rst
+2 -2
@@ -161,11 +161,11 @@ Documentation
161 design/multimodal/multimodal_index
162 design/huggingface_integration
163
164 -.. Contributing: contributing to the vLLM project
164 +.. For Developers: contributing to the vLLM project
165
166 .. toctree::
167 :maxdepth: 2
168 - :caption: Contributing
168 + :caption: For Developers
169
170 contributing/overview
171 contributing/profiling/profiling_index
vllm/logger.py
+3 -2
@@ -117,13 +117,14 @@ def _trace_calls(log_path, root_dir, frame, event, arg=None):
117 last_lineno = 0
118 last_func_name = ""
119 with open(log_path, 'a') as f:
120 + ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")
121 if event == 'call':
121 - f.write(f"{datetime.datetime.now()} Call to"
122 + f.write(f"{ts} Call to"
123 f" {func_name} in {filename}:{lineno}"
124 f" from {last_func_name} in {last_filename}:"
125 f"{last_lineno}\n")
126 else:
126 - f.write(f"{datetime.datetime.now()} Return from"
127 + f.write(f"{ts} Return from"
128 f" {func_name} in {filename}:{lineno}"
129 f" to {last_func_name} in {last_filename}:"
130 f"{last_lineno}\n")
vllm/utils.py
+3
@@ -4,6 +4,7 @@ import contextlib
4 import datetime
5 import enum
6 import gc
7 +import getpass
8 import inspect
9 import ipaddress
10 import os
@@ -967,6 +968,8 @@ def enable_trace_function_call_for_thread() -> None:
968
969 if envs.VLLM_TRACE_FUNCTION:
970 tmp_dir = tempfile.gettempdir()
971 + # add username to tmp_dir to avoid permission issues
972 + tmp_dir = os.path.join(tmp_dir, getpass.getuser())
973 filename = (f"VLLM_TRACE_FUNCTION_for_process_{os.getpid()}"
974 f"_thread_{threading.get_ident()}_"
975 f"at_{datetime.datetime.now()}.log").replace(" ", "_")