-Minfo=intensity does not report intensity

I have a very simple 3-level nested loop in Fortran code. By simple I mean that there are no dependencies, in fact it is an initialization loop, so the right hand side does not access any arrays at all. I instrument this with !$acc kernels, and it works fine, which I see in the nvprof output. However, when I compile I specify -Minfo=all,intensity, but I see no report of the compute intensity. I see a lot of other output about the loop, but intensity is not reported. What am I missing?

Hi gjt,

Hmm, I’m not sure, it seems to work fine for me. It does require opt level 2 or above (-O2) but this is implied if you’re using the “-acc” flag so should be enabled if you’re using OpenACC.

Are you getting no output at all or are you seeing things like the following?

 85, Intensity = 0.0
 90, Intensity = [symbolic], and not printable, try the -Mpfi -Mpfo options
153, Intensity = (((y_max+2)-y_min)*(((x_max+2)-(x_min-1))*38))/((((y_max+2)-y_min)*((x_max+2)-(x_min-1)))+(((y_max+2)-y_min)+(((x_max+2)-(x_min-1))+(((y_max+2)-y_min)+(((y_max+2)-y_min)+(((y_max+2)-y_min)+(((y_max+2)-y_min)*((x_max+2)-(x_min-1)))))))))
155, Intensity = 12.67
214, Intensity = (((y_max+2)-(y_min-1))*(((x_max+2)-x_min)*38))/((((x_max+2)-x_min)*((y_max+2)-(y_min-1)))+(((x_max+2)-x_min)+(((y_max+2)-(y_min-1))+(((x_max+2)-x_min)+(((x_max+2)-x_min)+(((x_max+2)-x_min)+(((x_max+2)-x_min)*((y_max+2)-(y_min-1)))))))))

Unfortunately there’s only so much the compiler can determine statically. Hence it often needs print out the intensity in equations since it doesn’t know the values of these variables are compile time. It was much better when using in conjunction with profile guided optimizations (i.e. -Mpfi/-Mpfo), but we stopped supporting PGO some time ago.

-Mat

Hi Mat,

Many thanks! The -O2 was what I was missing. I was using -g -acc -Minfo=all,intensity before, and I did see all the other OpenACC loop analysis output, but not Intensity. I have done a few tests, and this is what I find:

-acc (Intensity output - assume defaulting to -O2 as per your comment)
-acc -g (no Intensity output - what I was doing)
-acc -O (Intensity output)
-acc -01 (no Intensity output)
-acc -02 (Intensity output)
-acc -g -O (Intensity output)

Nice to have this figured out!

-Gerhard

Ah, yes, “-g” will lower the default opt level since it’s difficult to debug full optimized code. Though you can use “-gopt” which adds the DWARF info without lowering the opt level.

Mat, good to know about -gopt. Thanks.

One more questions. I was trying to find out the unit of the reported Intensity. Is it in FLOP/byte, and so. os FLOP single or double precision. Or is it per double (i.e. 8bytes) moved? I haven’t been able to find this documented anywhere… which I am sure I must have missed. Thank you!

-Gerhard

Intensity is defined in the glossary: HPC Compilers User's Guide Version 22.3 for ARM, OpenPower, x86

Compute intensity

for a given loop, region, or program unit, the ratio of the number of arithmetic operations performed on computed data divided by the number of memory transfers required to move that data between two levels of a memory hierarchy.

Note that low compute intensity doesn’t necessarily lower performance on a GPU, just that it’s more likely to be memory bound. I