Restored reductions tuning
This commit is contained in:
@@ -5,6 +5,11 @@ devices = 0
|
|||||||
precision = single, double
|
precision = single, double
|
||||||
size = 5000000
|
size = 5000000
|
||||||
|
|
||||||
|
[reduction]
|
||||||
|
devices = 0
|
||||||
|
precision = single, double
|
||||||
|
size = 5000000
|
||||||
|
|
||||||
[matrix-axpy]
|
[matrix-axpy]
|
||||||
devices = 0
|
devices = 0
|
||||||
precision = single, double
|
precision = single, double
|
||||||
@@ -18,6 +23,6 @@ size = 2560, 2560
|
|||||||
|
|
||||||
[matrix-product]
|
[matrix-product]
|
||||||
devices = 0
|
devices = 0
|
||||||
precision = single
|
precision = single, double
|
||||||
layout = NN,NT,TN,TT
|
layout = NN,NT,TN,TT
|
||||||
size = 1536, 1536, 1536
|
size = 1536, 1536, 1536
|
||||||
|
@@ -33,7 +33,7 @@ TYPES = { 'vector-axpy': {'template':vcl.atidlas.VectorAxpyTemplate,
|
|||||||
'perf-measure':'GB/s'},
|
'perf-measure':'GB/s'},
|
||||||
|
|
||||||
'reduction': {'template':vcl.atidlas.ReductionTemplate,
|
'reduction': {'template':vcl.atidlas.ReductionTemplate,
|
||||||
'perf-index':lambda x: 2*x[0]*x[1][0]*x[1][1]/x[2]*1e-9,
|
'perf-index':lambda x: 2*x[0]*x[1][0]/x[2]*1e-9,
|
||||||
'perf-measure':'GB/s'},
|
'perf-measure':'GB/s'},
|
||||||
|
|
||||||
'row-wise-reduction': {'template':vcl.atidlas.RowWiseReductionTemplate,
|
'row-wise-reduction': {'template':vcl.atidlas.RowWiseReductionTemplate,
|
||||||
@@ -48,7 +48,7 @@ def do_tuning(config_fname, spec_fname, viennacl_root):
|
|||||||
config = ConfigObj(config_fname, configspec=spec_fname)
|
config = ConfigObj(config_fname, configspec=spec_fname)
|
||||||
def map_to_list(T, x):
|
def map_to_list(T, x):
|
||||||
return list(map(T, x if isinstance(x, list) else [x]))
|
return list(map(T, x if isinstance(x, list) else [x]))
|
||||||
for operation in ['vector-axpy', 'matrix-axpy', 'row-wise-reduction', 'matrix-product']:
|
for operation in ['vector-axpy', 'matrix-axpy', 'reduction', 'row-wise-reduction', 'matrix-product']:
|
||||||
if operation in config:
|
if operation in config:
|
||||||
p = config[operation]
|
p = config[operation]
|
||||||
confdevices = p['devices']
|
confdevices = p['devices']
|
||||||
@@ -97,6 +97,14 @@ def do_tuning(config_fname, spec_fname, viennacl_root):
|
|||||||
z = vcl.Vector(sizes[0], context=ctx, dtype=datatype)
|
z = vcl.Vector(sizes[0], context=ctx, dtype=datatype)
|
||||||
return execute(device, vcl.Assign(z, vcl.ElementProd(vcl.exp(x + y),vcl.cos(x + y))), (), sizes, fname, parameters)
|
return execute(device, vcl.Assign(z, vcl.ElementProd(vcl.exp(x + y),vcl.cos(x + y))), (), sizes, fname, parameters)
|
||||||
tune(execution_handler, 50, 10000, lambda : 64*np.random.randint(low=10, high=100000, size=1), ())
|
tune(execution_handler, 50, 10000, lambda : 64*np.random.randint(low=10, high=100000, size=1), ())
|
||||||
|
#Reduction
|
||||||
|
if operation=='reduction':
|
||||||
|
def execution_handler(sizes, fname=os.devnull, parameters=None):
|
||||||
|
x = vcl.Vector(sizes[0], context=ctx, dtype=datatype)
|
||||||
|
y = vcl.Vector(sizes[0], context=ctx, dtype=datatype)
|
||||||
|
s = vcl.Scalar(0, context=ctx, dtype=datatype)
|
||||||
|
return execute(device, vcl.Assign(s, vcl.Dot(x,y)), (), sizes, fname, parameters)
|
||||||
|
tune(execution_handler, 50, 10000, lambda : 64*np.random.randint(low=10, high=100000, size=1), ())
|
||||||
#Matrix AXPY
|
#Matrix AXPY
|
||||||
if operation=='matrix-axpy':
|
if operation=='matrix-axpy':
|
||||||
def execution_handler(sizes, fname=os.devnull, parameters=None):
|
def execution_handler(sizes, fname=os.devnull, parameters=None):
|
||||||
|
@@ -44,6 +44,7 @@ class GeneticOperators(object):
|
|||||||
|
|
||||||
self.genome_info = {
|
self.genome_info = {
|
||||||
vcl.atidlas.VectorAxpyTemplate: [3,4,4,vcl.atidlas.FetchingPolicy],
|
vcl.atidlas.VectorAxpyTemplate: [3,4,4,vcl.atidlas.FetchingPolicy],
|
||||||
|
vcl.atidlas.ReductionTemplate: [3,4,4,vcl.atidlas.FetchingPolicy],
|
||||||
vcl.atidlas.MatrixAxpyTemplate: [3,3,3,3,3,vcl.atidlas.FetchingPolicy],
|
vcl.atidlas.MatrixAxpyTemplate: [3,3,3,3,3,vcl.atidlas.FetchingPolicy],
|
||||||
vcl.atidlas.RowWiseReductionTemplate: [3,3,3,4,vcl.atidlas.FetchingPolicy],
|
vcl.atidlas.RowWiseReductionTemplate: [3,3,3,4,vcl.atidlas.FetchingPolicy],
|
||||||
vcl.atidlas.MatrixProductTemplate: [3,3,3,3,3,3,3,vcl.atidlas.FetchingPolicy,vcl.atidlas.FetchingPolicy,3]
|
vcl.atidlas.MatrixProductTemplate: [3,3,3,3,3,3,3,vcl.atidlas.FetchingPolicy,vcl.atidlas.FetchingPolicy,3]
|
||||||
|
Reference in New Issue
Block a user