kups.core.effects.handlers
¶
default_shard_map_handler(interpreter, ctx, eqn, invals, *, declare_ctx_in_specs=None, declare_ctx_out_specs=None, reduce_ctx=None)
¶
Reinterpret a shard_map equation through interpreter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interpreter
|
Interpreter[Context]
|
The interpreter walking the surrounding jaxpr. |
required |
ctx
|
Context
|
Input context (lives outside the manual axis scope, typically replicated across all shards). |
required |
eqn
|
JaxprEqn
|
The |
required |
invals
|
list[TracerValue]
|
User-data inputs to the equation. |
required |
declare_ctx_in_specs
|
Callable[[Context], Context | PartitionSpec] | None
|
Optional. Map the input context tree to the
|
None
|
declare_ctx_out_specs
|
Callable[[Context], Context | PartitionSpec] | None
|
Optional. Map the post-body context tree to
the |
None
|
reduce_ctx
|
Callable[[Context], Context] | None
|
Optional. Transform applied to the per-shard post-body
context inside the |
None
|