Torch profiler

942 views
Skip to first unread message

KING CHUNG HO

unread,
Sep 23, 2015, 12:19:34 PM9/23/15
to torch7
Is there a performance (e.g., speed) profiler in torch, similar to the one in Cuda (nvprof)?

Andreas Köpf

unread,
Sep 23, 2015, 12:58:32 PM9/23/15
to torch7
Is there a performance (e.g., speed) profiler in torch, similar to the one in Cuda (nvprof)?

You might try one listed here: http://lua-users.org/wiki/ProfilingLuaCode

And there seems also to be a basic profiler in xlua (which is loaded by th by default).

KING CHUNG HO

unread,
Sep 23, 2015, 1:03:44 PM9/23/15
to torch7
Thanks. Interesting, Lua Profilor seems work. So there is no particular profiler provided by Torch?

Andreas Köpf

unread,
Sep 23, 2015, 4:34:58 PM9/23/15
to torch7
Probably obvious, but you can of course use nvprof to look at the GPU aspects of your torch code.
Torch is using luajit, so every lua profiler based on the lua-debug api would work. If you installed torch with the
ezinstall method it comes with luarocks and installing e.g. 'luaprofiler' can be done by executing 'luarocks install luaprofiler'.

KING CHUNG HO

unread,
Sep 23, 2015, 4:49:46 PM9/23/15
to torch7
Great, thanks!

Andreas Köpf

unread,
Sep 23, 2015, 4:58:02 PM9/23/15
to torch7
Sry, there is indeed a simple 'built-in' profiler that comes with luajit available with the -jp cmd line arg, see http://agentzh.org/misc/code/luajit2/jit/p.lua.html

KING CHUNG HO

unread,
Sep 23, 2015, 6:02:24 PM9/23/15
to torch7
Sweet! Thanks.

Eugenio Culurciello

unread,
Sep 23, 2015, 7:26:01 PM9/23/15
to torch7
We use this one:
To profile all kind of network and performance

Adam Erickson

unread,
Jul 18, 2016, 11:20:56 AM7/18/16
to torch7
Thank you, Eugenio! This is a very nice tool. Are there any other very important tools like this that Torch users should have?

Cheers,

Adam

Martin Delgado

unread,
Aug 25, 2016, 4:22:35 AM8/25/16
to torch7
Hi, may I ask a naive question.
How do you install it? Simply download to
~/torch/install
and you're ready to go?
Or do you need to use
luarocks make or luarocks build?

Thanks!

Jonghoon Jin

unread,
Aug 25, 2016, 5:22:28 AM8/25/16
to torch7 on behalf of Martin Delgado
you dont need to install it. just run

git clone https://github.com/e-lab/Torch7-profiling.git .
th profile-model.lua --model models/alexnetowt.lua --res 1x3x231x231

--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+unsubscribe@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at https://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.

Martin Delgado

unread,
Aug 25, 2016, 7:16:45 AM8/25/16
to torch7
@Jonghoon Jin

Thanks a lot for the clarification!



On Thursday, August 25, 2016 at 10:22:28 AM UTC+1, Jonghoon Jin wrote:
you dont need to install it. just run

git clone https://github.com/e-lab/Torch7-profiling.git .
th profile-model.lua --model models/alexnetowt.lua --res 1x3x231x231
On Thu, Aug 25, 2016 at 1:22 AM, Martin Delgado via torch7 wrote:
Hi, may I ask a naive question.
How do you install it? Simply download to
~/torch/install
and you're ready to go?
Or do you need to use
luarocks make or luarocks build?

Thanks!


On Thursday, September 24, 2015 at 12:26:01 AM UTC+1, Eugenio Culurciello wrote:
We use this one:
To profile all kind of network and performance

On Wednesday, September 23, 2015 at 12:19:34 PM UTC-4, KING CHUNG HO wrote:
Is there a performance (e.g., speed) profiler in torch, similar to the one in Cuda (nvprof)?

--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.

Martin Delgado

unread,
Aug 25, 2016, 7:35:29 AM8/25/16
to torch7

@Jonghoon Jin

When I run it the way you suggested I get the following error
torch/install/share/lua/5.1/trepl/init.lua:384: module 'opts' not found:No LuaRocks module found for opts
no field package.preload['opts']
Searching for
luarocks search opts
didn't return anything
Am I missing some package?

Sitao Huang

unread,
Jun 7, 2017, 1:33:31 PM6/7/17
to torch7
Hi, 

What's the final conclusion? I tried the Lua Profiler, but it fails on some system calls, such as "print" and "new" functions. 

The torch code uses both CPU and GPU (cuTorch, cudnn). I wonder if there is such a profiler that supports such code. 

Thanks! 
Reply all
Reply to author
Forward
0 new messages