jax_sn.operators.multi_group_operator.composed_multi_group_strategies module¶
Multi-group strategies
Just composed for now; fused kernel is supported but not implemented.
- class MultiGroupChainGatherStrategy(single_group_chain_strategy: SingleGroupChainStrategy, single_group_gather_scatter_strategy: SingleGroupGatherScatterStrategy)[source]¶
Bases:
MultiGroupStrategyUses a chain and a gather-scatter that fully define the action of a single group, mapping in some way over all the groups.
- single_group_chain_strategy: SingleGroupChainStrategy¶
- single_group_gather_scatter_strategy: SingleGroupGatherScatterStrategy¶
- forward(operator_data: OperatorData, x)[source]¶
- transpose(operator_data: OperatorData, x)[source]¶
- accepts(non_differentiable_data: NonDifferentiableData)[source]¶
Whether it can accept this non-differentiable data.
- Return type:
bool
- class MultiGroupChainGatherScanStrategy(single_group_chain_strategy: SingleGroupChainStrategy, single_group_gather_scatter_strategy: SingleGroupGatherScatterStrategy, checkpoint: bool = False)[source]¶
Bases:
_ScanLift,MultiGroupChainGatherStrategyLift the per-group body by a serialising scan. Optionally checkpoint for reduced memory usage
- class MultiGroupChainGatherVmapStrategy(single_group_chain_strategy: SingleGroupChainStrategy, single_group_gather_scatter_strategy: SingleGroupGatherScatterStrategy)[source]¶
Bases:
_VmapLift,MultiGroupChainGatherStrategyLift by batching the entire vmap. Naturally most parallelizable but significantly increases memory (use on small problems only)
- class ComposedMultiGroupChainStrategy(single_group_chain_strategy: SingleGroupChainStrategy)[source]¶
Bases:
MultiGroupChainStrategyApplies a
SingleGroupChainStrategyindependently over every group. Used to precondition a per-group right-hand side with the same group-lift (scan/vmap, checkpoint) as the operator it accompanies; seefrom_composed().- single_group_chain_strategy: SingleGroupChainStrategy¶
- forward(operator_data: OperatorData, x)[source]¶
- transpose(operator_data: OperatorData, x)[source]¶
- classmethod from_composed(composed: MultiGroupChainGatherStrategy)[source]¶
The chain alone, lifted the same way (scan/vmap, checkpoint) as
composed.- Return type:
- accepts(non_differentiable_data: NonDifferentiableData)[source]¶
Whether it can accept this non-differentiable data.
- Return type:
bool
- class MultiGroupChainScanStrategy(single_group_chain_strategy: SingleGroupChainStrategy, checkpoint: bool = False)[source]¶
Bases:
_ScanLift,ComposedMultiGroupChainStrategyLift the chain by a serialising scan. Optionally checkpoint for reduced memory usage
- class MultiGroupChainVmapStrategy(single_group_chain_strategy: SingleGroupChainStrategy)[source]¶
Bases:
_VmapLift,ComposedMultiGroupChainStrategyLift the chain by batching the entire vmap.