This is when the JIT does its optimizations.
Typically, the first pass is an unoptimized profiling pass where the JIT collects tensor shape and layout information (and profiling means that, not something with timing). Then before the second pass, the JIT specializes the graph for the observed shapes and compiles fusion kernels etc. This is likely the delay you are seeing (though 10s seems a lot). After the second run (unless shapes change), you’ll be hitting the cached optimized path.
(That it is one profiling pass before the optimization kicks in is a configurable parameter.)
Some more details can be found e.g. on my blog posts on JIT optimization 2 and the JIT runtime 1.
Best regards
Thomas