jax.experimental.pallas.fuser.fuse

Contents

jax.experimental.pallas.fuser.fuse#

jax.experimental.pallas.fuser.fuse(f=None, *, resolve_fusion_dtypes=True, debug=False, strict_mode=True, static_argnums=None, static_argnames=None)[source]#

Fuses a function into a single fusible.

There should be a single call to a fusible inside the body of f. fuse returns a transformed function that will fuse the surrounding computation into the fusible and invoke it. The fused function cannot take jax.ref.Ref objects as arguments (it must close over Refs instead).

Parameters:
  • f – The function to fuse.

  • resolve_fusion_dtypes (bool) – (experimental) whether or not to resolve fusion dtypes (which don’t correspond to physical dtypes)

  • debug (bool) – Whether to print debug information.

  • strict_mode (bool) – Whether to verify block index map equality in collisions during block spec propagations in output fusions.

  • static_argnums (int | Sequence[int] | None) – An optional int or collection of ints that specify which positional arguments to treat as static (compile-time constant).

  • static_argnames (str | Iterable[str] | None) – An optional string or collection of strings specifying which named arguments to treat as static (compile-time constant).

Returns:

A fused version of f, or a decorator if f is None.