jax.experimental.pallas.fuser.push_block_spec#
- jax.experimental.pallas.fuser.push_block_spec(f, *in_spec_args, scalar_prefetch_handler=None, grid_len=None, strict_mode=True, return_out_type=False, **in_spec_kwargs)[source]#
Pushes input
BlockSpecsforward throughfto get outputBlockSpecs.- Parameters:
f (Callable) – The function to propagate block specs forward through.
*in_spec_args – Positional input
BlockSpecs(or PyTrees ofBlockSpecs) matching the positional arguments 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. When set, the input
BlockSpecindex maps are expected to takegrid_lengrid indices followed by the scalar prefetch refs, and the returned outputBlockSpecindex maps follow the same convention.strict_mode (bool) – If
True, converging paths to the same operation must have identical block index maps. IfFalse, only block shapes, memory spaces, and pipeline modes must match.return_out_type (bool) – If
True, also return a PyTree ofShapeDtypeStructsdescribing the output types off.**in_spec_kwargs – Keyword input
BlockSpecs(or PyTrees ofBlockSpecs) matching the keyword arguments off.
- Returns:
A function taking example
(*args, **kwargs)(or their abstract types) and returning the outputBlockSpecPyTree, or a tuple(out_block_specs, out_type)whenreturn_out_type=True.