jax.experimental.pallas.Buffered#
- class jax.experimental.pallas.Buffered(buffer_count, use_lookahead=False, revisit=None, prefetched_count=0)[source]#
Specifies how a block should be buffered for a pipeline.
- Parameters:
- buffer_count#
The number of buffers to use for multiple buffering. For input_output buffers, an int
nmeans(n, 1):n-deep input prefetch with synchronous output writeback; pass an(in_buffer_count, out_buffer_count)pair to also buffer outputs (allocatingin + out - 1slots). Only emit_pipeline input_output BufferedRefs accept a pair.
- use_lookahead#
optional bool, indicates whether to use lookahead on the buffer. Enabling lookahead allows the pipeline to begin fetching the next changed block as soon as a slot is available, no matter how many iterations ahead that block is.
- Type:
- revisit#
optional RevisitMode, determines how revisiting the same output block at different iterations is handled. RevisitMode.IMMEDIATE is the default for outputs. In this mode, the same block can only be revisited in subsequent kernel invocations. Once another block is visited, the old one should not be visited again. RevisitMode.ANY relaxes this restriction, at a cost of addition DMAs. Input blocks ignore this field and can be visited at any iteration, as they read the state from memory in any case.
- Type:
RevisitMode | None
- prefetched_count#
optional int, the number of slots in the window buffer that have been pre-populated before entering the pipeline. If > 0, the pipeline expects the pre-populated buffer to be passed in via allocations and will skip internal allocation.
- Type:
- __init__(buffer_count, use_lookahead=False, revisit=None, prefetched_count=0)#
Methods
__init__(buffer_count[, use_lookahead, ...])Attributes