Rate this Page

helion.kernel#

helion.kernel(fn=None, *, config=None, configs=None, key=None, **settings)[source]#

Decorator to create a Kernel object from a Python function.

Parameters:
  • fn (Optional[Callable[..., TypeVar(_R)]]) – The function to be wrapped by the Kernel. If None, a decorator is returned.

  • config (Config | dict[str, object] | None) – A single configuration to use for the kernel. Refer to the helion.Config class for details.

  • configs (list[Config | dict[str, object]] | None) – A list of configurations to use for the kernel. Can only specify one of config or configs. Refer to the helion.Config class for details.

  • key (Optional[Callable[..., Hashable]]) – Optional callable returning a hashable that augments the specialization key.

  • settings (object) – Keyword arguments representing settings for the Kernel. Can also use settings=Settings(…) to pass a Settings object directly. Refer to the helion.Settings class for available options.

Returns:

A Kernel object or a decorator that returns a Kernel object.

Return type:

object

See also

  • Settings: Controls compilation behavior and debugging options

  • Config: Controls GPU execution parameters and optimization strategies