jax.experimental.pallas.fuser.fusible#
- jax.experimental.pallas.fuser.fusible(f=None, *, output_fusion_prefix=True)[source]#
Decorator that marks a kernel wrapper function as a fusible for
fuse.The decorated function
fis invoked asf(*in_fusions, output_fusions, **kwargs), where each positional argument inin_fusionspreserves the PyTree structure of the corresponding input in*argswith array leaves wrapped inFusionobjects, andoutput_fusionsis a PyTree matching the structure ofoutput_fusion_prefixwhose leaves areFusionobjects orNonewhen no output fusion is present. Keyword arguments are bound tofas static values. When called outsidefuse, each input array leaf is wrapped in a trivialFusionthat returns it and alloutput_fusionsleaves areNone.- Parameters:
f – The fusible kernel function to decorate. If
None, returns a decorator.output_fusion_prefix (Any) – A PyTree prefix mask whose PyTree structure specifies how the outputs of
fare grouped into separate output fusions (with the defaultTrue, all outputs are grouped into a singleFusion | None). Multiple output fusion groups are not supported when the output fusion writes toRefs.
- Returns:
A wrapped function that binds a
Fusibleprimitive when called, or a decorator iffisNone.