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

Memory Profiling #15866

Merged
merged 21 commits into from
Jun 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
use traceback.extract_stack(limit=2)[0]
Looks walk_stack() use an incorrect current frame
madsbk committed Jun 17, 2024

Verified

This commit was signed with the committer’s verified signature.
d2iq-dispatch D2iQ Dispatch
commit a4e4fc68ecfd09deb16a4d6b0e39c4cfd7c01d2c
11 changes: 3 additions & 8 deletions python/cudf/cudf/utils/utils.py
Original file line number Diff line number Diff line change
@@ -159,14 +159,9 @@ def _external_only_api(func, alternative=""):
@functools.wraps(func)
def wrapper(*args, **kwargs):
# Check the immediately preceding frame to see if it's in cudf.
tb = traceback.walk_stack(None)
frame, lineno = next(tb)
fn = frame.f_code.co_filename
if "performance_tracking.py" in fn:
# Go one frame further back if the caller is wrapper in a
# _performance_tracking decorator
frame, lineno = next(tb)
fn = frame.f_code.co_filename
pre_frame = traceback.extract_stack(limit=2)[0]
fn = pre_frame.filename
lineno = pre_frame.lineno
if _cudf_root in fn and _tests_root not in fn:
raise RuntimeError(
f"External-only API called in {fn} at line {lineno}. "