Scaling Torch profiling to longer computations

I have a numerical scheme that takes quite some time to execute (14 seconds for one scenario, but it can take way longer). It’s using both pytorch and scipy operations. I want to profile this code to find out how long these operations take and how they scale in relation to each other. I tried to use the the pytorch profiler but quickly get OOM-errors when scaling to longer computations. I can only scale it to an computation that takes around 8 seconds. Is there a way to restrict the resolution/profiled modules in order to slim it down? Maybe compress it in some way?