home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / benchmar / 1697 < prev    next >
Encoding:
Text File  |  1992-11-15  |  13.0 KB  |  378 lines

  1. Newsgroups: comp.benchmarks
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!nuscc!iti.gov.sg!hblim
  3. From: hblim@iti.gov.sg (Hock-Beng Lim)
  4. Subject: Counting number of MFLOPs
  5. Message-ID: <1992Nov16.033410.11391@iti.gov.sg>
  6. Sender: news@iti.gov.sg (News Admin)
  7. Organization: Information Technology Institute, National Computer Board, Singapore.
  8. Date: Mon, 16 Nov 1992 03:34:10 GMT
  9. Lines: 367
  10.  
  11. Hi !
  12.  
  13. Here are the responses I have received regarding my query on the accepted
  14. ways to count MFLOPs in applications.
  15.  
  16. HB
  17. --------------------------------------------------------------------------
  18. From: schreiber@schreiber.asd.sgi.com (Olivier Schreiber)
  19. Message-Id: <9211111829.AA03875@schreiber.asd.sgi.com>
  20. To: hblim@iti.gov.sg
  21. Subject: Re: Counting number of MFLOPS
  22. Newsgroups: comp.benchmarks
  23. References: <1992Nov11.074519.26172@iti.gov.sg>
  24. Status: RO
  25.  
  26.  
  27. I had posted a similar inquiry a while back. Here's what I got.
  28. Thanks for posting the results of your enquiry.
  29.  
  30. >From: csrdh@manta.jcu.edu.au (Rowan Hughes)
  31. Message-Id: <9205290324.AA04971@manta.jcu.edu.au>
  32. To: schreiber
  33. Subject: Re: How are Floating Point operations counted?
  34. Newsgroups: comp.benchmarks
  35. References: <lc5k6ro@fido.asd.sgi.com>
  36. Status: RO
  37.  
  38. In comp.benchmarks you write:
  39. >Is there an accepted way industry-wide of counting floating point
  40. >operations or a definition of what a floating point operation is
  41. >for FP benchmark purposes?
  42. >How many FPO is x=y*z ?
  43. >or x=sqrt(y)*sin(z)?
  44. >How do most vendors measure MFLOP rates on general user programs?
  45.  
  46. The accepted way (for Crays, etc.) is to count each of *,+,- as one
  47. flop. Generally there should be the same number of *'s as + and -.
  48. If not, you should state that there were few *'s. Division is 
  49. usually not used, since it can usually be eliminated, and turned
  50. into a *. Division time is quoted as a multilple of * time, eg
  51. 4 times longer. Intrinsic functions are not usually counted
  52. (sin cos log etc.). Don't use benchmarks with these in them.
  53. The most useful vector benchmark is the DAXPY (REAL*8)
  54.  
  55.    do i=1,n
  56.    y(i)=a*x(i)+y(i)
  57.    enddo
  58.  
  59. n should be very large (i.e. 5,000,000); much larger than the cache
  60. size.  Each iteration counts as 2 flops, * and + are equal in number.
  61. SAXPY is the real*4 equivalent. The Cray YMP does 289Mflops on one
  62. processor for DAXPY. The memory bandwidth, in Mb/sec, is 12 times this.
  63. number (3500 Mb/sec). Another name for DAXPY is the linked triad.
  64.  
  65. -- 
  66. Rowan Hughes                                James Cook University
  67. Marine Modelling Unit                       Townsville, Australia.
  68. Dept. Civil and Systems Engineering         csrdh@marlin.jcu.edu.au
  69.  
  70.  
  71. >From schreiber  Mon Jun  1 11:07:36 1992
  72. Received: by schreiber.asd.sgi.com (920110.SGI/911001.SGI)
  73.     for schreiber id AA11352; Mon, 1 Jun 92 11:07:36 -0700
  74. Date: Mon, 1 Jun 92 11:07:36 -0700
  75. From: schreiber (Olivier Schreiber)
  76. Message-Id: <9206011807.AA11352@schreiber.asd.sgi.com>
  77. To: schreiber
  78. Subject: flops
  79. Status: RO
  80.  
  81. In article <lc5k6ro@fido.asd.sgi.com> schreiber@schreiber.asd.sgi.com (Olivier Schreiber) writes:
  82. >Is there an accepted way industry-wide of counting floating point
  83. >operations or a definition of what a floating point operation is
  84. >for FP benchmark purposes?
  85.  
  86. No. There are several different "standard" approaches. One is to take the
  87. known number of floating point operations for a given size of the Linpack
  88. benchmark, time the number of seconds it takes to execute on a system,
  89. then divide the first number by the second to get Linpack MFLOPS. This
  90. gives the most commonly reported "MFLOPS" number in the workstation world.
  91. This can be done for single and double precision to produce single and
  92. double precision Linpack MFLOPS numbers.
  93.  
  94. The authors of the Livermore Loops developed a normalizing formula that can
  95. be used on codes that are more complex than Linpack (i.e. that do a lot more
  96. than adds, subtracts and multiplies.)  They count floating point operations
  97. as follows: (taken from page 43 of Hennessy and Patterson)
  98.  
  99. Real FP Operations                Normalized FP operations
  100. ------------------                ------------------------
  101. ADD,SUB,COMPARE,MULT                         1
  102. DIVIDE,SQRT                                  4
  103. EXP,SIN,COS,TAN,....                         8
  104.  
  105.  
  106.  
  107. >
  108. >How many FPO is x=y*z ?
  109. >or x=sqrt(y)*sin(z)?
  110.  
  111. x=y*z is one FLOP.
  112. x=sqrt(y)*sin(z) is 3 FLOPs unnormalized, 13 FLOPs normalized by the Livermore
  113. method shown above.
  114.  
  115. >How do most vendors measure MFLOP rates on general user programs?
  116.  
  117. I don't know that they do.  Certainly there is no "standard" for this; even
  118. in the more controlled world of benchmarking, there is some variation, as
  119. you can see.
  120.  
  121. BTW, based on the Livermore normalizing table above, a MULTIPLY-and-ADD
  122. instruction is 2 FLOPs, which makes sense.  Some posters in the past have
  123. tried to claim that a maultiply and accumulate instruction is only 1 FLOP,
  124. which makes no sense at all, although they claim from memory that that
  125. was the "original" definition of a FLOP back in the Dark Ages (and then
  126. no reference for this claim is ever produced.)
  127.  
  128.  
  129.  
  130. -- 
  131. -----------------------------------------------------------------------------
  132. "It is seldom that any liberty is lost all at once." David Hume
  133. |||  clc5q@virginia.edu (Clark L. Coleman)
  134.  
  135. >From comp.benchmarks Tue Jun  2 13:55:05 1992
  136. Path: fido!odin!sgigate!rutgers!ucla-cs!ucla-ma!euphemia!pmontgom
  137. From: pmontgom@euphemia.math.ucla.edu (Peter Montgomery)
  138. Newsgroups: comp.benchmarks
  139. Subject: Re: How are Floating Point operations counted?
  140. Message-ID: <1992Jun1.203454.4900@math.ucla.edu>
  141. Date: 1 Jun 92 20:34:54 GMT
  142. References: <lc5k6ro@fido.asd.sgi.com> <1992May29.150530.13028@murdoch.acc.Virginia.EDU> <1992Jun1.175743.11513@news.eng.convex.com>
  143. Sender: news@math.ucla.edu
  144. Organization: UCLA Mathematics Department
  145. Lines: 55
  146. Status: RO
  147.  
  148. In article <1992Jun1.175743.11513@news.eng.convex.com> 
  149. patrick@convex.COM (Patrick F. McGehearty) writes:
  150. >In article <1992May29.150530.13028@murdoch.acc.Virginia.EDU> 
  151. >clc5q@hemlock.cs.Virginia.EDU (Clark L. Coleman) writes:
  152.  
  153.      ...
  154.  
  155. >>Real FP Operations                Normalized FP operations
  156. >>------------------                ------------------------
  157. >>ADD,SUB,COMPARE,MULT                         1
  158. >>DIVIDE,SQRT                                  4
  159. >>EXP,SIN,COS,TAN,....                         8
  160. >>
  161. >
  162. >Sounds reasonable to me.  If we (all readers of this note) all agree to use
  163. >this method, does that make it a standard? :-) :-)
  164.  
  165.     I do extensive multiple-precision arithmetic.  I consider
  166. my programs to be "number crunching", but they rate very low
  167. on this scale because the list omits many operations.  We should also count
  168.  
  169.         a)      Conversions: integer to floating,
  170.                 floating to integer, conversion between
  171.                 different floating precisions (perhaps one FP each).
  172.  
  173.         b)      Truncating or rounding floating to integer
  174.                 while retaining floating point form;
  175.                 (FORTRAN AINT and ANINT, for example)
  176.                 (perhaps two FP operations each).
  177.  
  178.         c)      Simple operations like the Fortran
  179.                 ABS, DIM, MAX, MIN, and SIGN functions
  180.                 (perhaps one FP operation each, with two for SIGN).
  181.  
  182.     d)    Integer multiplies not used for subscript
  183.         computations and where neither operand is
  184.         a compile-time constant (one FP each).
  185.  
  186.         e)      Integer division when denominator is
  187.         not a power of 2 or negative thereof
  188.                 should count the same as an FP divide
  189.                 if only one of the quotient, remainder is used;
  190.                 if both are used, count an additional FP.
  191.  
  192. In all cases no FP operations should be counted if all
  193. operands are compile time constants, such as 2.5 * 6.7 + ABS(-7.8).
  194.  
  195.     The list also fails to specify how much operations like X**10
  196. or pow(X, 10.0) (exponentiation) count.  One vendor may compile this using
  197. four multiplies, while another uses logarithm and exponential.
  198. Does it matter if the 10 or 10.0 is an execution-time value rather than
  199. compile-time constant?
  200. --
  201.         Peter L. Montgomery              Internet: pmontgom@math.ucla.edu
  202.         Department of Mathematics, UCLA, Los Angeles, CA  90024-1555  USA
  203.  
  204. -- 
  205. Olivier Schreiber  schreiber@sgi.com (415)390 5353  Fax:(415) 964-8671 MS/9L580
  206. Silicon Graphics Inc.,  2011 North Shoreline Blvd. Mountain View, Ca 94039-7311
  207.  
  208.  
  209. ---------------------------
  210. From: earl@fuji.idtinc.COM (Earl Killian)
  211. Message-Id: <9211111615.AA22511@fuji.qedinc.com>
  212. To: hblim@iti.gov.sg (Hock-Beng Lim)
  213. In-Reply-To: hblim@iti.gov.sg's message of Wed, 11 Nov 1992 07:45:19 GMT
  214. Subject: Counting number of MFLOPS
  215. Status: RO
  216.  
  217. The pixie/pixstats programs on MIPS systems count FLOPs.
  218.  
  219.  
  220. ---------------------------
  221. From: Larry Meadows <lfm@pgroup.com>
  222. Message-Id: <199211120431.AA04770@libby.pgroup.com>
  223. To: hblim@iti.gov.sg
  224. Subject: Re: Counting number of MFLOPS
  225. Newsgroups: comp.benchmarks
  226. In-Reply-To: <1992Nov11.074519.26172@iti.gov.sg>
  227. Organization: The Portland Group, Portland, OR
  228. Cc: 
  229. Status: RO
  230.  
  231.  
  232. pixie on a mips will tell you how many f.p. ops were executed (exactly
  233. I believe).
  234.  
  235. lfm
  236.  
  237. -- 
  238. Larry Meadows        The Portland Group
  239. lfm@pgroup.com
  240.  
  241.  
  242. ---------------------------
  243. From: earl@fuji.idtinc.COM (Earl Killian)
  244. Message-Id: <9211122242.AA23731@fuji.qedinc.com>
  245. To: hblim@iti.gov.sg
  246. In-Reply-To: Hock-Beng Lim's message of Thu, 12 Nov 92 11:36:47 WST <9211120336.AA06744@iti.gov.sg>
  247. Subject: Counting number of MFLOPS
  248. Status: RO
  249.  
  250. Pixie is a object-code instrumentation program.  It adds intructions
  251. to a binary to count basic blocks and optionally to generate
  252. instruction and data address traces.  The non-tracing usage is quite
  253. simple:
  254.  
  255. pixie foo            # reads foo, produces new executable foo.pixie
  256.                 # (also produces foo.Addrs)
  257.                 # (takes 2-3 seconds)
  258. foo.pixie fooargs < fooinput > foooutput
  259.                 # run new executable in the normal way
  260.                 # writes foo.Counts on exit
  261.                 # (takes 2-3x longer than running foo)
  262. pixstats foo > foo.stats    # reads foo, foo.Addrs, and foo.Counts
  263.                 # and generates statistics, including
  264.                 # opcode frequencies
  265.                 # (takes <1 second)
  266.  
  267. >From the SPEC benchmark pixstats outputs I have lying around I
  268. selected the lines that would let you count floating point operations
  269. (to compute FLOPs as the supercomputer folks do, use
  270. fadd+fsub+...+fmul+fdiv*4+fsqrt*8).  The complete outputs are a little
  271. large to mail.
  272.  
  273. 013.spice2g6:
  274.     fmul  330562977    2.10%
  275.     fsub  222139265    1.41%
  276.     fadd  203333823    1.29%
  277.     fdiv   78994140    0.50%
  278.     c.lt   62909949    0.40%
  279.     fabs   52376825    0.33%
  280.     fmov   22202904    0.14%
  281.     c.le   19064771    0.12%
  282.     c.eq   12807281    0.08%
  283.    fcvtd   11471709    0.07%
  284.     fneg   11089840    0.07%
  285.    fcvtw    5138333    0.03%
  286.    c.ole    5138308    0.03%
  287.    c.ult    3325350    0.02%
  288.    fcvts    1977914    0.01%
  289.    c.olt    1555423    0.01%
  290.    c.ule    1555373    0.01%
  291.    fsqrt    1132405    0.01%
  292.     c.un          1    0.00%
  293.  
  294. 015.doduc:
  295.     fmul  122995914   11.86%
  296.     fadd   89962441    8.67%
  297.     fsub   37023197    3.57%
  298.     c.le   28173005    2.72%
  299.     fdiv   23850719    2.30%
  300.    fcvtd   14394593    1.39%
  301.     c.lt   11241927    1.08%
  302.     fmov    8652077    0.83%
  303.    fcvts    3378554    0.33%
  304.     c.eq    3355800    0.32%
  305.     fneg    2796032    0.27%
  306.     fabs    2738844    0.26%
  307.    fcvtw    1279710    0.12%
  308.    c.ole     838950    0.08%
  309.    fsqrt     507377    0.05%
  310.     c.un     456765    0.04%
  311.    c.ult       5514    0.00%
  312.  
  313. 020.nasa7:
  314.     fmul 1027731023   18.52%
  315.     fsub  600896167   10.83%
  316.     fadd  456774097    8.23%
  317.     fmov   44444306    0.80%
  318.     fdiv   19186849    0.35%
  319.    fcvtd    6549652    0.12%
  320.    c.ult    6159939    0.11%
  321.     fabs    4424521    0.08%
  322.     c.lt    2220883    0.04%
  323.    fsqrt    2060200    0.04%
  324.    c.olt    1293562    0.02%
  325.    fcvtw    1030288    0.02%
  326.     fneg     809244    0.01%
  327.     c.le     516000    0.01%
  328.    c.ole     515000    0.01%
  329.    c.ule     263082    0.00%
  330.     c.eq      51010    0.00%
  331.    fcvts      46108    0.00%
  332.  
  333. 030.matrix300:
  334.     fadd  216000300   31.65%
  335.     fmul  216000000   31.65%
  336.     fmov          3    0.00%
  337.     c.eq          3    0.00%
  338.     fabs          2    0.00%
  339.     fsub          1    0.00%
  340.     fdiv          1    0.00%
  341.  
  342. 042.fpppp:
  343.     fmul  306318594   23.42%
  344.     fadd  260531821   19.92%
  345.     fsub    7504774    0.57%
  346.     fmov    3922913    0.30%
  347.     fneg    3677499    0.28%
  348.     c.lt    1685380    0.13%
  349.     fdiv    1303147    0.10%
  350.     fabs    1109268    0.08%
  351.     c.le     682180    0.05%
  352.    fcvtd     495142    0.04%
  353.    fsqrt     377621    0.03%
  354.    fcvts     248187    0.02%
  355.    fcvtw     223627    0.02%
  356.    c.ole     200322    0.02%
  357.     c.eq      61467    0.00%
  358.     c.un      23306    0.00%
  359.  
  360. 047.tomcatv:
  361.     fmul  156167870   17.01%
  362.     fsub  113846282   12.40%
  363.     fadd  110607782   12.04%
  364.     fabs   26010198    2.83%
  365.     c.lt   13005198    1.42%
  366.     fdiv    6502758    0.71%
  367.     fneg    6502500    0.71%
  368.     fmov      47120    0.01%
  369.     c.eq        400    0.00%
  370.    fcvts        257    0.00%
  371.    fcvtd        257    0.00%
  372.  
  373. -- 
  374. -----------------------------------------------------------------------------
  375. Hock-Beng Lim                                   | hblim@csrd.uiuc.edu
  376. Center for Supercomputing R&D, UIUC. (on leave) | hblim@iti.gov.sg 
  377. Information Technology Institute, Singapore.    | tel : (65)772-7205,772-7273
  378.