ninetoothed.build#

ninetoothed.build(premake, configs, *, meta_parameters=None, caller=None, kernel_name=None, output_dir=None, lazy=False)#

Build a kernel from a premake function and configs.

Parameters:
  • premake – A callable that returns the arrangement, application, and tensors for a given configuration.

  • configs – An iterable of configurations where each configuration is a tuple of (args, kwargs, compilation_configs). args and kwargs are passed to premake, and compilation_configs contains compilation configurations for ninetoothed.make (e.g., num_warps and num_stages).

  • meta_parameters – An iterable of meta-parameters that should be auto-tuned.

  • caller – Who will call the compute kernel.

  • kernel_name – The name for the generated kernel.

  • output_dir – The directory to store the generated files.

  • lazy – If True, defer the actual build until the returned kernel is first called. Use this when build is invoked at module import time and its ProcessPoolExecutor would otherwise deadlock on the Python import lock.