Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid divisors cannot be integer #264

Open
stijnh opened this issue Jun 10, 2024 · 0 comments
Open

Grid divisors cannot be integer #264

stijnh opened this issue Jun 10, 2024 · 0 comments
Labels

Comments

@stijnh
Copy link
Member

stijnh commented Jun 10, 2024

Currently, grid divisors (grid_div_x,y,z) must be either a string or a lambda. Using an integer results in the following exception:

  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/interface.py", line 676, in tune_kernel
    results = strategy.tune(searchspace, runner, tuning_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/strategies/brute_force.py", line 10, in tune
    return runner.run(searchspace.sorted_list(), tuning_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/runners/sequential.py", line 87, in run
    self.dev.compile_and_benchmark(self.kernel_source, self.gpu_args, params, self.kernel_options, tuning_options)
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/core.py", line 539, in compile_and_benchmark
    instance = self.create_kernel_instance(kernel_source, kernel_options, params, verbose)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/core.py", line 664, in create_kernel_instance
    threads, grid = util.setup_block_and_grid(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 781, in setup_block_and_grid
    grid = get_grid_dimensions(current_problem_size, params, grid_div, block_size_names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 427, in get_grid_dimensions
    divisors = [
               ^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 428, in <listcomp>
    get_dimension_divisor(d, block_size_names[i], params)
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 424, in get_dimension_divisor
    [int(eval(replace_param_occurrences(s, params))) for s in divisor_list]
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 424, in <listcomp>
    [int(eval(replace_param_occurrences(s, params))) for s in divisor_list]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/site-packages/kernel_tuner/util.py", line 768, in replace_param_occurrences
    for part in re.split("([a-zA-Z0-9_]+)", string):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sheldens/miniconda3/lib/python3.11/re/__init__.py", line 206, in split
    return _compile(pattern, flags).split(string, maxsplit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants