[vsipl++] [patch] Serial Expression Profiling

Don McCoy don at codesourcery.com
Sat Aug 19 23:09:39 UTC 2006


Jules Bergmann wrote:
> Don,
> 
> This patch looks good.  There are 2 things I would like to change:
> 
>  - First, I would like to move the profiling code from the evaluator
>    class specializations into the Dispatch_assign class.  This requires
>    some changes to the Evaluator framework, and some help from the
>    evaluators themselves, but not much.
> 
>    Doing this will reduce the amount of duplication, making it easier
>    to add a new evaluator.  It will also give us visibility into
>    distributed expressions before they are reduced.
> 
>  - Second, the expression name generator is pretty cool, but the
>    psuedo-postfix notation seems unintuitive.  Since the framework you
>    have is fairly general, it should not be too hard to generate a
>    name with proper prefix or infix notation.
> 

This new patch addresses both of the above, building on Jules' changes 
to the framework.  Now any time we add a new serial expression evaluator 
we are obligated to provided the char const* name() function for the 
profiler/coverage code to use.  Overall it is much more nicely organized 
this way.

With regards to the second item, the names are now generated using 
standard prefix notation.  This was chosen over infix notation as it is 
only slightly harder to read, but provides a uniform way of describing 
both operators and functions.  It is much more readable than before and 
should eliminate any ambiguity when profiling expressions.  Each tag 
includes

   - The type of evaluator (copy, dense, loop, simd_loop, etc...)
   - Number of dimensions
   - The expression in prefix notation with
     - Views denoted with S/D/C/Z
     - Scalar values denoted with s/d/c/z
     - Parentheses used to show evaluation order.
   - View size

There is work left to do defining estimates for operation counts for a 
few operators.

Some examples of the type of profiler output now available:

# mode: pm_accum
# timer: x86_64_tsc_time
# clocks_per_sec: 3591375104
#
# tag : total ticks : num calls : op count : mops
Expr_Copy 1D S 2048 : 23319 : 1 : 0 : 0
Expr_Dense 2D *(S,S) 64x64 : 1095120 : 1 : 4096 : 13.4326
Expr_Dense 3D *(S,S) 64x64x64 : 67102560 : 1 : 262144 : 14.0301
Expr_Loop 1D *(C,sin(C)) 262144 : 740760129 : 1 : 4718592 : 22.8768
Expr_Loop 1D *(S,C) 2048 : 2346777 : 1 : 4096 : 6.26829
Expr_Loop 1D *(S,S) 262144 : 67018662 : 1 : 262144 : 14.0477
Expr_Loop 1D *(S,S) 4096 : 1050210 : 1 : 4096 : 14.007
Expr_Loop 1D *(am(S,C,C),s) 1024 : 2693421 : 1 : 9216 : 12.2885
Expr_Loop 1D *(am(S,S,S),s) 1024 : 627255 : 1 : 3072 : 17.5889
Expr_Loop 1D +(*(S,s),/(S,S)) 2048 : 1516950 : 1 : 6144 : 14.5459
Expr_Loop 1D +(/(-(*(S,s),S),S),S) 2048 : 1950273 : 1 : 8192 : 15.0853
Expr_Loop 1D +(S,*(S,S)) 2048 : 893754 : 1 : 4096 : 16.459
Expr_Loop 1D /(+(*(S,s),S),S) 2048 : 1471230 : 1 : 6144 : 14.9979
Expr_Loop 2D *(S,S) 128x128 : 10240929 : 1 : 16384 : 5.74568
Expr_Loop 3D *(S,S) 32x32x32 : 40336200 : 1 : 32768 : 2.91753
Expr_Trans 2D S 2048x2048 : 230791311 : 3 : 0 : 0


Although not shown, it also identifies expressions dispatched to IPP or
SAL.  The full documentation for all possible tags and their meanings
is still being put together.

Things to note:  The file expr_ops_per_point.hpp was renamed 
expr_ops_info.hpp.  The changes to fns_elementwise.hpp are numerous 
because of a change in the macro parameter 'name' to 'fname' to avoid 
colliding with the new function named, er... 'name'.  This only had to 
be done in a few places, but I wanted the file to be consistent, so I 
changed it throughout.

Regards,

-- 
Don McCoy
don (at) CodeSourcery
(888) 776-0262 / (650) 331-3385, x712

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: se2.changes
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20060819/9f018057/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: se2.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20060819/9f018057/attachment-0001.ksh>


More information about the vsipl++ mailing list