scalene icon indicating copy to clipboard operation
scalene copied to clipboard

Is hybrid call stack supported?

Open oleotiger opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I want to catch the call stack from pytorch to C++ backend. For example, which function is called in C++ by torch.nn.softmax?

I wirte a case: test.py

import torch
x = torch.tensor([[1.0, 2.0, 3.0],
                  [4.0, 5.0, 6.0]])
softmax = torch.nn.Softmax(dim=1)
output = softmax(x)

and by scalene --stacks --json --no-browser test.py, there is no inforation about call stack into backend:

Describe the solution you'd like I want a call stack (something like flamegraph?) which could tell me which C++ function is called by the operator.

Describe alternatives you've considered No found yet.

oleotiger avatar Dec 05 '23 12:12 oleotiger

I'm think I'm looking for the same thing: maybe this works for you?

https://github.com/joerick/pyinstrument

FergusFettes avatar Jan 29 '24 05:01 FergusFettes