From: Alen Stojanov <astojanov@inf.ethz.ch>
To: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: Some troubles with perf and measuring flops
Date: Thu, 6 Mar 2014 02:53:03 +0100 [thread overview]
Message-ID: <5317D4FF.1030302@inf.ethz.ch> (raw)
In-Reply-To: <alpine.DEB.2.10.1403052036580.22262@vincent-weaver-1.um.maine.edu>
On 06/03/14 02:40, Vince Weaver wrote:
> On Thu, 6 Mar 2014, Alen Stojanov wrote:
>
>> However, whenever I try to run matrices of bigger size, the reported flops are
>> not even close to the flops that I am supposed to obtain (anticipated results:
>> 600 * 600 * 600 * 2 = 432'000'000):
>>
>> perf stat -e r538010 ./mmmtest 600
>>
>> Performance counter stats for './mmmtest 600':
>>
>> 2,348,148,851 r538010
>>
>> 0.955511968 seconds time elapsed
>>
> ...
>> CPU: Intel(R) Xeon(R) CPU E5-2643 0 @ 3.30GHz, 8 cores
>> Linux Kernel: 3.11.0-12-generic
>> GCC Version: gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8)
>> Monitored events: FP_COMP_OPS_EXE:SSE_SCALAR_DOUBLE - Raw event: 0x538010
>> (converted using libpfm4)
> ...
>> Do you know why does this happens ? How can I instruct perf to obtain accurate
>> results ?
> one thing you might want to do is put :u on your event name so you are
> only measuring user space accesses not kernel too.
Well, even if the perf is measuring kernel events, I really doubt that
the kernel is doing any double precision floating point operations.
Nevertheless, I tried the :u option, and this does not change anything:
perf stat -e r538010:u ./mmmtest 100
Performance counter stats for './mmmtest 100':
2,079,002 r538010:u
0.003887873 seconds time elapsed
perf stat -e r538010:u ./mmmtest 600
Performance counter stats for './mmmtest 600':
2,349,426,507 r538010:u
0.956538237 seconds time elapsed
>
> floating point events are notoriously unreliable on modern intel
> processors.
>
> The event might also be counting speculative events or uops and it gets
> more complicated with AVX in the mix. What does the intel documentation
> say for the event for your architecture?
I agree on this. However, if you would look at the .s file, you can see
that it does not have any AVX instructions inside. And if I would
monitor any other event on the CPU that counts any flop operations, I
get 0s. It seems that the FP_COMP_OPS_EXE:SSE_SCALAR_DOUBLE is the only
one that occurs. I don't think that FP_COMP_OPS_EXE:SSE_SCALAR_DOUBLE
counts speculative events.
>
> Vince
next prev parent reply other threads:[~2014-03-06 1:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 0:55 Some troubles with perf and measuring flops Alen Stojanov
2014-03-06 1:40 ` Vince Weaver
2014-03-06 1:53 ` Alen Stojanov [this message]
2014-03-06 18:25 ` Vince Weaver
2014-03-06 19:41 ` Alen Stojanov
2014-03-11 23:53 ` Alen Stojanov
2014-03-13 20:17 ` Vince Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5317D4FF.1030302@inf.ethz.ch \
--to=astojanov@inf.ethz.ch \
--cc=linux-perf-users@vger.kernel.org \
--cc=vincent.weaver@maine.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.