jax.experimental.pallas.fuser module

jax.experimental.pallas.fuser module#

Public API for fuser.

This module is an alias of jax.pallas.fuser, which is the preferred import path.

Classes#

BlockIndexTransform(block_shape[, ...])

Represents a block shape and index transform during block spec propagation.

Fusion(func, in_type, out_type[, strict_mode])

Wraps a fused computation together with its input and output types.

Functions#

custom_fusion(fun)

Wraps a pure JAX function as a primitive with user-defined fuser rules.

evaluate(f, *[, allow_transpose])

Re-binds f's traced jaxpr equation-by-equation under fuser constraints.

fuse([f, resolve_fusion_dtypes, debug, ...])

Fuses a function into a single fusible.

fusible([f, output_fusion_prefix])

Decorator that marks a kernel wrapper function as a fusible for fuse.

Block specs#

block_spec_with_prefetch(block_specs, ...)

Appends scalar prefetch refs to index maps of block specs in a PyTree.

filter_no_block_specs(values, block_specs)

Filters out values and block specs that have no_block_spec by replacing them with None.

make_scalar_prefetch_handler(*args)

Creates a handler function that extracts a fusion's scalar prefetch values.

pull_block_spec(f, out_block_specs, *[, ...])

Pulls output BlockSpecs backward through f to derive input BlockSpecs.

push_block_spec(f, *in_spec_args[, ...])

Pushes input BlockSpecs forward through f to get output BlockSpecs.

push_pull_block_spec(f, *block_specs[, ...])

Pushes BlockSpecs forward through an output fusion, then pulls them back.

Fusion values#

get_fusion_values(fusion, *args, **kwargs)

Extracts closed-over regular and scalar prefetch values from a fusion.

get_stateful_input_fusion_values(fusion, ...)

Extracts values from a read-only input fusion that may close over Refs.

get_stateful_output_fusion_values(fusion, ...)

Extracts values and aliases from an output fusion that may write Refs.