-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] add an option to log every function call to for debugging hang…
…/crash in distributed inference (#4079) Co-authored-by: Simon Mo <[email protected]>
- Loading branch information
1 parent
8f9c28f
commit 8a7a3e4
Showing
7 changed files
with
120 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import sys | ||
import tempfile | ||
|
||
from vllm.logger import enable_trace_function_call | ||
|
||
|
||
def f1(x): | ||
return f2(x) | ||
|
||
|
||
def f2(x): | ||
return x | ||
|
||
|
||
def test_trace_function_call(): | ||
fd, path = tempfile.mkstemp() | ||
cur_dir = os.path.dirname(__file__) | ||
enable_trace_function_call(path, cur_dir) | ||
f1(1) | ||
with open(path, 'r') as f: | ||
content = f.read() | ||
|
||
assert "f1" in content | ||
assert "f2" in content | ||
sys.settrace(None) | ||
os.remove(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters