How to do profiling on pytorch data loader worker process?

I use a simple profiling code to profile my training process.

	import cProfile, pstats"main()", "{}.profile".format(__file__))
	s = pstats.Stats("{}.profile".format(__file__))

and got something like this

When I did some reading on {method ‘acquire’ of ‘_thread.lock’ objects}, apparently this just shows what the parent process is calling and not the child process. So is it possible to do profiling on the data loader worker process?


Hello, did you find the solution to your question? I’m having the same problem about pytorch data loader worker process profiling like you.