Lines Matching full:strategy

40 # Gemm strategy
41 Strategy = Enum("Strategy", ["Native", "ReshapedOnlyRHS", "Reshaped"]) variable
61 # Gemm configuration for strategy Native
76 # Gemm configuration for strategy Reshaped Only RHS
102 # Gemm configuration for strategy Reshaped
196 strategy: Strategy
218 gemm_param, strategy, gemm_config, measurement = benchmark_result
220 self._strategies.add(strategy)
230 """ Get the best GEMMConfig set per GEMMParam per Strategy
233 Tuple[GEMMParam, Strategy], List[Tuple[GEMMConfig, Measurement]]
235 for gemm_param, strategy, gemm_config, measurement in self.get_record():
236 best_gc_set = best_gc_sets.setdefault((gemm_param, strategy), [])
251 best_gc_sets[(gemm_param, strategy)] = best_gc_set_new
256 … """ Get the best GEMMConfig set per GEMMParam per Strategy, and flatten the result into a sequence
260 (gemm_param, strategy),
265 gemm_param, strategy, best_gemm_config, best_measurement
269 """ Return GEMMConfigDistribution for each strategy
271 gemm_config_distributions: Dict[Strategy, GEMMConfigDistribution] = defaultdict(
275 _, strategy, _, _ = benchmark_result
276 gemm_config_distributions[strategy].add(benchmark_result)
283 all_results: Dict[GEMMParam, List[Tuple[Strategy, Measurement]]] = defaultdict(
287 best_strategies: Dict[GEMMParam, Strategy] = {}
289 for gemm_param, strategy, gemm_config, measurement in self.get_record():
290 all_results[gemm_param].append((strategy, measurement))
297 # Select best Strategy
305 The directory is organized such that each strategy gets its own JSON file.
306 The directory also includes a JSON file to define the best strategy per GEMM Param.
321 for strategy in self._strategies:
323 out_dir, ("gemm_config_" + strategy.name.lower() + ".json")
333 if res.strategy == strategy:
352 for gemm_param, strategy in self.get_best_gemm_configs().keys():
353 gemm_params_per_strategy[strategy].append(gemm_param)
360 [Per strategy]
363 for strategy in gemm_params_per_strategy:
365 Strategy {strategy.name}:
367 Number of: {len(gemm_params_per_strategy[strategy])}
371 Content: {gemm_params_per_strategy[strategy]}
425 # Produces a GEMMConfig type specific to a Strategy
427 Strategy.Native: NativeGEMMConfig,
428 Strategy.ReshapedOnlyRHS: ReshapedOnlyRHSGEMMConfig,
429 Strategy.Reshaped: ReshapedGEMMConfig,
432 # Mapping from example binary name to Strategy
435 "benchmark_cl_gemm_native": Strategy.Native,
436 "benchmark_cl_gemm_reshaped_rhs_only": Strategy.ReshapedOnlyRHS,
437 "benchmark_cl_gemm_reshaped": Strategy.Reshaped,
441 # Produces a Gemm_Example_Args type specific to a Strategy
449 # Note that the test strategy_name == strategy.name is in place to avoid unwanted enum aliases
452 strategy: namedtuple(
454 GEMMParam._fields[:-1] + GEMM_CONFIG_FACTORY[strategy]._fields,
456 for strategy_name, strategy in Strategy.__members__.items()
457 if strategy_name == strategy.name
493 Strategy,
507 # Get strategy
508 strategy = EXAMPLE_FILE_2_STRATEGY[example_fn]
512 Gemm_Example_Args_T = GEMM_EXAMPLE_ARGS_FACTORY[strategy]
521 GEMMConfig = GEMM_CONFIG_FACTORY[strategy]
555 yield BenchmarkResult(gemm_param, strategy, gemm_config, measurement)
617 # Get GEMM configuration distributions for each strategy
621 for strategy, config_dist in all_config_dists.items():
622 logging.info("Strategy: {}".format(strategy.name))
661 …"Path to directory that holds output JSON files. One for strategy selection and one per strategy f…