Skip to content

Commit d2951a7

Browse files
committed
Merge branch 'master' into refactor_interface
2 parents d845b33 + e71b8f6 commit d2951a7

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

README.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Or both:
3434

3535
More information about how to install Kernel Tuner and its
3636
dependencies can be found in the `installation guide
37-
<http://kerneltuner.github.io/kernel_tuner/stable/install.html>`__
37+
<http://kerneltuner.github.io/kernel_tuner/stable/install.html>`__.
3838

3939
Example usage
4040
-------------
@@ -97,16 +97,17 @@ Search strategies for tuning
9797
Kernel Tuner supports many optimization algorithms to accelerate the auto-tuning process. Currently
9898
implemented search algorithms are: Brute Force (default), Nelder-Mead, Powell, CG, BFGS, L-BFGS-B, TNC,
9999
COBYLA, SLSQP, Random Search, Basinhopping, Differential Evolution, a Genetic Algorithm, Particle Swarm
100-
Optimization, the Firefly Algorithm, and Simulated Annealing.
100+
Optimization, the Firefly Algorithm, Simulated Annealing, Dual Annealing, Iterative Local Search,
101+
Multi-start Local Search, and Bayesian Optimization.
101102

102103
.. image:: doc/gemm-amd-summary.png
103104
:width: 100%
104105
:align: center
105106

106107
Using a search strategy is easy, you only need to specify to ``tune_kernel`` which strategy and method
107108
you would like to use, for example ``strategy="genetic_algorithm"`` or ``strategy="basinhopping"``.
108-
For a full overview of the supported search strategies and methods please see the `user
109-
api documentation <http://kerneltuner.github.io/kernel_tuner/stable/user-api.html>`__.
109+
For a full overview of the supported search strategies and methods please see the
110+
Kernel Tuner documentation on `Optimization Strategies <https://kerneltuner.github.io/kernel_tuner/stable/optimization.html>`__.
110111

111112
Tuning host and kernel code
112113
---------------------------

kernel_tuner/file_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,14 @@ def get_device_query(target):
155155
nvidia_smi_out = subprocess.run(["nvidia-smi", "--query", "-x"],
156156
capture_output=True)
157157
nvidia_smi = xmltodict.parse(nvidia_smi_out.stdout)
158-
del nvidia_smi["nvidia_smi_log"]["gpu"]["processes"]
158+
gpu_info = nvidia_smi["nvidia_smi_log"]["gpu"]
159+
del_key = "processes"
160+
# on multi-GPU systems gpu_info is a list
161+
if isinstance(gpu_info, list):
162+
for gpu in gpu_info:
163+
del gpu[del_key]
164+
elif isinstance(gpu_info, dict) and del_key in gpu_info:
165+
del gpu_info[del_key]
159166
return nvidia_smi
160167
elif target == "amd":
161168
rocm_smi_out = subprocess.run(["rocm-smi", "--showallinfo", "--json"],

kernel_tuner/runners/sequential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def run(self, parameter_space, tuning_options):
9595
params.update(result)
9696

9797
# only compute metrics on configs that have not errored
98-
if isinstance(result[tuning_options.objective], ErrorConfig):
98+
if tuning_options.objective in result and isinstance(result[tuning_options.objective], ErrorConfig):
9999
logging.debug('kernel configuration was skipped silently due to compile or runtime failure')
100100
elif tuning_options.metrics:
101101
params = process_metrics(params, tuning_options.metrics)

kernel_tuner/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ def process_cache(cache, kernel_options, tuning_options, runner):
758758
c["problem_size"] = kernel_options.problem_size if not callable(kernel_options.problem_size) else "callable"
759759
c["tune_params_keys"] = list(tuning_options.tune_params.keys())
760760
c["tune_params"] = tuning_options.tune_params
761+
c["objective"] = tuning_options.objective
761762
c["cache"] = {}
762763

763764
contents = json.dumps(c, cls=NpEncoder, indent="")[:-3] # except the last "}\n}"

test/test_runners.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def test_runner(env):
261261
platform = 0
262262
iterations = 7
263263
verbose = False
264-
objective = "time"
264+
objective = "GFLOP/s"
265+
metrics = OrderedDict({objective: lambda p: 1})
265266
opts = locals()
266267
kernel_options = Options([(k, opts.get(k, None))
267268
for k in _kernel_options.keys()])

test/test_util_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def assert_open_cachefile_is_correctly_parsed(cache):
550550
delete_temp_file(cache)
551551

552552
kernel_options = Options(kernel_name="test_kernel", problem_size=(1, 2))
553-
tuning_options = Options(cache=cache, tune_params=Options(x=[1, 2, 3, 4]), simulation_mode=False)
553+
tuning_options = Options(cache=cache, tune_params=Options(x=[1, 2, 3, 4]), simulation_mode=False, objective="time")
554554
runner = Options(dev=Options(name="test_device"), simulation_mode=False)
555555

556556
try:

0 commit comments

Comments
 (0)