jax.experimental.pallas.fuser.pull_block_spec#
- jax.experimental.pallas.fuser.pull_block_spec(f, out_block_specs, *, scalar_prefetch_handler=None, grid_len=None, strict_mode=True)[source]#
Pulls output
BlockSpecsbackward throughfto derive inputBlockSpecs.- Parameters:
f (Callable) – The fusion function to propagate block specs backward through.
out_block_specs (pallas_core.BlockSpec | tuple[pallas_core.BlockSpec, ...]) – A
BlockSpecor PyTree ofBlockSpecsmatching the output structure off.scalar_prefetch_handler (Any | None) – Optional getter created by
make_scalar_prefetch_handlerthat selects this fusion’s scalar prefetch values from the kernel’s scalar prefetch inputs.grid_len (int | None) – Optional number of grid dimensions in the enclosing kernel (required if any block index depends on scalar prefetch values).
strict_mode (bool) – If
True, converging paths to the same value must have equivalent block index transforms; ifFalse, only block shapes must match.
- Returns:
A function taking example
(*args, **kwargs)(or their abstract types) and returning(kernel_fn, in_block_arg_specs, in_block_kwarg_specs)for evaluatingfon a single block inside a Pallas kernel.