task_scheduling.resources#
Resource abstractions for the Task Scheduling (TS) framework.
Compile-time abstraction: Pipeline operations (acquire, release, commit, wait) defined here are traced by the DSL at compile time and produce the same mbarrier PTX instructions as hand-coded bare-metal kernels. There is no additional runtime overhead from using these abstractions — the framework is a code generator, not a runtime scheduler.
This module defines the data-flow building blocks that a warp-specialised kernel assembles into a pipeline:
Classes#
- PipelineConfig
Immutable descriptor that selects a pipeline type (TMA, UMMA, CLC, etc.) and captures its parameters (stage count, byte count, cooperative groups, signalling policy). Static factory methods hide the per-type details.
- TileSchedulerConfig
Pairs a
TileSchedulerTypewith the scheduler-specific parameters (static persistent or CLC dynamic persistent) and, for CLC, the SMEM response pointer.- StageInfo
Read-only snapshot passed into every
producer_work/consumer_workcall. Carries the current loop offset, pipeline stage index, mbarrier pointer, per-call index, and the activeWorkTileInfo.- MemoryResource
- Base class for every resource in the dataflow graph. A resource owns:
an optional
PipelineConfig-> materialised pipeline + barriers,per-role variable dicts (
consumer_vars,producer_vars),pipeline state objects (
consumer_state,producer_state).
Subclasses declare public data-flow state as
TaskLocalVariablefields and implement consumer / producer work methods to define the resource’s behaviour at each schedule stage.- WorkQueue (MemoryResource)
Specialised resource that wraps a tile scheduler (
StaticPersistentTileSchedulerorClcDynamicPersistentTileScheduler). It drives the persistent work loop by producing/consumingWorkTileInfotiles.
Typical lifecycle (driven by TaskManager)#
resource.create()allocates SMEM barriers and materialises the pipeline object. Called once per resource fromTaskManager.setup_resources_and_tasks().
resource.initialize_runtime_state_internal()initialises pipeline states, status flags, and task-local storage defaults. Executed once per kernel invocation, outside any dynamic control flow.
resource.create_consumer_variables_internal()/resource.create_producer_variables_internal()populatesconsumer_vars/producer_varsdicts with the user-defined variables that flow between resources.
consumer_work(stage_info)/producer_work(stage_info)runs user-defined per-stage logic invoked by theTaskschedule.
copy_consumer_vars_to(dst_resource)propagates matching consumer variables into a downstream resource’s producer variables. This is automatic and called byTask.
- class cutlass.experimental.task_scheduling.resources.PipelineConfig(
- num_stages: int,
- num_bytes: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- pipeline_type: ~cutlass.experimental.task_scheduling.enums.PipelineType,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- cta_layout_vmnk: cutlass.cute.typing.Layout | tuple | None = None,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_wait_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads | None = None,
- umma_consumer_producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
- advance_on_wait: bool = False,
- advance_on_acquire: bool = False,
- num_bytes_per_warp_per_cta: int | None = None,
- mcast_mode_mn: tuple[int,
- int] = (1,
- 1),
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
- async_producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
Bases:
objectImmutable descriptor for a single pipeline instance.
Captures everything
MemoryResource.create_pipeline()needs to materialise a concrete pipeline object (barrier storage, stage count, transaction bytes, cooperative groups, CTA layout, and signalling policy).Users should not construct
PipelineConfigdirectly. Instead, use one of the static factory methods which fill in the correctPipelineTypeand sensible defaults:create_async_async_pipeline_cfg- generic async-producer + async-consumer pipeline.create_tma_async_pipeline_cfg- TMA-producer + async-consumer pipeline.create_tma_umma_pipeline_cfg- TMA-producer + UMMA-consumer pipeline.create_umma_async_pipeline_cfg- UMMA-producer + async-consumer pipeline.create_async_umma_pipeline_cfg- async-producer + UMMA-consumer pipeline.create_umma_umma_pipeline_cfg- UMMA-producer + UMMA-consumer pipeline.create_clc_fetch_async_pipeline_cfg- CLC tile-fetch + async-consumer pipeline.
- num_stages#
Number of buffering stages (pipeline depth).
- Type:
int
- num_bytes#
Expected transaction byte count per stage (0 when not applicable).
- Type:
int
- producer_group, consumer_group
Cooperative groups that define the producer / consumer agents.
- pipeline_type#
Selects the concrete pipeline implementation.
- Type:
- barrier_ptr#
Pre-allocated SMEM barrier storage (Int64, 2 * num_stages). When None,
MemoryResource.create_pipeline()allocates it.- Type:
cute.Pointer, optional
- cta_layout_vmnk#
Cluster decomposition layout; required for UMMA / CLC pipelines.
- Type:
cute.Layout, optional
- producer_signaling_threads#
Which threads execute producer-side barrier operations (acquire, commit).
CtaLeaderrestricts signalling to CTA 0.- Type:
- consumer_signaling_threads#
Which threads execute consumer-side barrier operations (wait, release). Used for ConsumerRelease (and ConsumerWait when
consumer_wait_signaling_threadsis None).- Type:
- consumer_wait_signaling_threads#
Override for ConsumerTryWait / ConsumerWait signaling threads. When None (default), falls back to
consumer_signaling_threads. Set this when ConsumerWait and ConsumerRelease need different CTA signaling (e.g. split-consumer pattern where one task waits on all CTAs and another releases on leader CTA only).- Type:
SignalingThreads or None
- async_producer_op#
Producer-side barrier operation for
AsyncAsync. Defaults toAsyncThread.AsyncLoadselects cp.async-style producer commits that usecp.async.mbarrier.arriveon local per-CTA full barriers.- Type:
- umma_consumer_producer_op#
Producer-side barrier operation for
AsyncUmma. Defaults toAsyncThread.AsyncLoadselects cp.async-style producer commits and local per-CTA arrivals.- Type:
- num_bytes_per_warp_per_cta#
Declares that each producer CTA routes its TMA completion to the leader-visible full barrier. The value is the per-producer-warp, per-CTA transaction byte count; validation checks that
num_bytescovers every producer warp across the full cluster.- Type:
int, optional
- mcast_mode_mn#
Multicast mode passed to CUTLASS TMA pipeline creation for cluster arrival masks.
- Type:
tuple[int, int]
- advance_on_wait#
Controls when the pipeline stage index is advanced. When False (default), the stage is advanced on
release; when True, the stage is advanced on thewaitcall and a separate pipeline state is used to release the consumer. Disabled by default pending performance measurements.- Type:
bool
- advance_on_acquire#
Producer-side analogue of
advance_on_wait. When True,ProducerAcquireadvancesproducer_stateimmediately.ProducerWorkeither derives the just-acquired state fromproducer_stateor follows the laggingproducer_commit_state.ProducerCommitalways usesproducer_commit_state.- Type:
bool
- interleave_stride#
Stride for interleaved pipeline advancement. When the stride is > 1, N lanes share one pipeline with
num_stagestotal barriers; each lane starts at its lane index and advances by the stride, which must evenly dividenum_stages. A lane may be selected by a task-local warp or by a task’s domain start. A single integer applies the same stride to every role. A 4-tuple assigns role-specific strides interpreted as(producer_acquire, producer_commit, consumer_wait, consumer_release). Splittingproducer_acquirefromproducer_commitrequiresadvance_on_acquire; splittingconsumer_waitfromconsumer_releaserequiresadvance_on_wait.- Type:
int or tuple[int, int, int, int]
- num_stages: int#
- num_bytes: int#
- producer_group: CooperativeGroup#
- consumer_group: CooperativeGroup#
- pipeline_type: PipelineType#
- barrier_ptr: cutlass.cute.typing.Pointer | None = None#
- cta_layout_vmnk: cutlass.cute.typing.Layout | tuple | None = None#
- producer_signaling_threads: SignalingThreads = 1#
- consumer_signaling_threads: SignalingThreads = 1#
- consumer_wait_signaling_threads: SignalingThreads | None = None#
- umma_consumer_producer_op: PipelineOp = 1#
- advance_on_wait: bool = False#
- advance_on_acquire: bool = False#
- num_bytes_per_warp_per_cta: int | None = None#
- mcast_mode_mn: tuple[int, int] = (1, 1)#
- interleave_stride: int | tuple[int, int, int, int] = 1#
- async_producer_op: PipelineOp = 1#
- property interleave_strides: tuple[int, int, int, int]#
Return
(producer_acquire, producer_commit, consumer_wait, consumer_release)strides.
- property producer_acquire_interleave_stride: int#
Stride used when advancing the producer acquire cursor.
- property producer_commit_interleave_stride: int#
Stride used when advancing the producer commit cursor.
- property consumer_wait_interleave_stride: int#
Stride used when
advance_on_waitadvances consumer wait state.
- property consumer_release_interleave_stride: int#
Stride used when advancing consumer release state.
- property max_interleave_stride: int#
Largest role-specific interleave stride.
- property has_interleaved_stride: bool#
Whether any role advances through the pipeline with stride > 1.
- static create_async_async_pipeline_cfg(
- num_stages: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
- advance_on_acquire: bool = False,
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
Create a config for a generic async pipeline.
producer_op=AsyncLoadmatches async global-to-shared producers that signal full barriers withcp.async.mbarrier.arrivewhile their consumers still release through ordinary async-thread mbarriers.- Parameters:
num_stages (int) – Number of buffering stages.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.producer_op (pipeline.PipelineOp, optional) – Async producer operation, normally
AsyncThreadorAsyncLoad.advance_on_acquire (bool, optional) – Advance producer state at acquire time instead of commit time.
interleave_stride (int or tuple[int, int, int, int], optional) – Role-specific pipeline-state stride. Mismatched opening and closing roles require the corresponding advance flag.
- Returns:
Configuration for an
AsyncAsyncpipeline.- Return type:
- static create_tma_async_pipeline_cfg(
- num_stages: int,
- num_bytes: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout | None = None,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
- num_bytes_per_warp_per_cta: int | None = None,
Create a config for a TMA-producer async pipeline.
- Parameters:
num_stages (int) – Number of buffering stages.
num_bytes (int) – TMA transaction byte count for each stage.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout, optional) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.interleave_stride (int or tuple[int, int, int, int], optional) – Role-specific pipeline-state stride. Mismatched opening and closing roles require the corresponding advance flag.
num_bytes_per_warp_per_cta (int, optional) – Per-producer-warp, per-CTA transaction byte count for leader-routed clustered TMA completion validation.
- Returns:
Configuration for a
TmaAsyncpipeline.- Return type:
- static create_tma_umma_pipeline_cfg(
- num_stages: int,
- num_bytes: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- advance_on_wait: bool = False,
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
- mcast_mode_mn: tuple[int,
- int] = (1,
- 1),
- num_bytes_per_warp_per_cta: int | None = None,
Create a config for TMA producer + UMMA consumer async pipeline.
- Parameters:
num_stages (int) – Number of buffering stages.
num_bytes (int) – TMA transaction byte count for each stage.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.advance_on_wait (bool, optional) – Advance consumer state at wait time instead of release time.
interleave_stride (int or tuple[int, int, int, int], optional) – Role-specific pipeline-state stride. Mismatched opening and closing roles require the corresponding advance flag.
mcast_mode_mn (tuple[int, int], optional) – TMA multicast mode in M and N.
num_bytes_per_warp_per_cta (int, optional) – Per-producer-warp, per-CTA transaction byte count for validation.
- Returns:
Configuration for a
TmaUmmapipeline.- Return type:
- static create_umma_async_pipeline_cfg(
- num_stages: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
Create a config for a UMMA-producer async pipeline.
- Parameters:
num_stages (int) – Number of buffering stages.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.interleave_stride (int or tuple[int, int, int, int], optional) – Role-specific pipeline-state stride. Mismatched opening and closing roles require the corresponding advance flag.
- Returns:
Configuration for an
UmmaAsyncpipeline.- Return type:
- static create_async_umma_pipeline_cfg(
- num_stages: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_wait_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads | None = None,
- producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- advance_on_wait: bool = False,
- advance_on_acquire: bool = False,
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
Create a config for an async-producer + UMMA-consumer pipeline.
Used when async producer threads create data and the UMMA warp consumes it.
producer_op=AsyncLoadmatches async global-to-shared producer commits that usecp.async.mbarrier.arriveon local per-CTA full barriers.- Parameters:
num_stages (int) – Number of buffering stages.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_wait_signaling_threads (SignalingThreads, optional) – Override for wait-side signaling when wait and release use different participants.
producer_op (pipeline.PipelineOp, optional) – Async producer operation, normally
AsyncThreadorAsyncLoad.barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.advance_on_wait (bool, optional) – Advance consumer state at wait time instead of release time.
advance_on_acquire (bool, optional) – Advance producer state at acquire time instead of commit time.
interleave_stride (int or tuple[int, int, int, int], optional) – Role-specific pipeline-state stride. Mismatched opening and closing roles require the corresponding advance flag.
- Returns:
Configuration for an
AsyncUmmapipeline.- Return type:
- static create_umma_umma_pipeline_cfg(
- num_stages: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
Create a config for a UMMA producer + UMMA consumer pipeline.
- Parameters:
num_stages (int) – Number of buffering stages.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.
- Returns:
Configuration for an
UmmaUmmapipeline.- Return type:
- static create_clc_fetch_async_pipeline_cfg(
- num_stages: int,
- num_bytes: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- cta_layout_vmnk: cutlass.cute.typing.Layout,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.CtaLeader: 2>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
Create a config for a CLC tile-fetch async pipeline.
- Parameters:
num_stages (int) – Number of buffering stages.
num_bytes (int) – Work-tile fetch transaction byte count for each stage.
producer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
consumer_group (pipeline.CooperativeGroup) – Cooperative groups on the producer and consumer sides.
cta_layout_vmnk (cute.Layout) – CTA cluster layout.
producer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
consumer_signaling_threads (SignalingThreads, optional) – Threads that execute producer- and consumer-side barrier operations.
barrier_ptr (cute.Pointer, optional) – Pre-allocated barrier storage.
Nonelets the allocator place it.
- Returns:
Configuration for a
ClcFetchAsyncpipeline.- Return type:
- __init__(
- num_stages: int,
- num_bytes: int,
- producer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- consumer_group: ~cutlass.pipeline.helpers.CooperativeGroup,
- pipeline_type: ~cutlass.experimental.task_scheduling.enums.PipelineType,
- barrier_ptr: cutlass.cute.typing.Pointer | None = None,
- cta_layout_vmnk: cutlass.cute.typing.Layout | tuple | None = None,
- producer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads = <SignalingThreads.All: 1>,
- consumer_wait_signaling_threads: ~cutlass.experimental.task_scheduling.enums.SignalingThreads | None = None,
- umma_consumer_producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
- advance_on_wait: bool = False,
- advance_on_acquire: bool = False,
- num_bytes_per_warp_per_cta: int | None = None,
- mcast_mode_mn: tuple[int,
- int] = (1,
- 1),
- interleave_stride: int | tuple[int,
- int,
- int,
- int] = 1,
- async_producer_op: ~cutlass.pipeline.helpers.PipelineOp = PipelineOp.AsyncThread,
- class cutlass.experimental.task_scheduling.resources.TileSchedulerConfig(
- tile_scheduler_type: TileSchedulerType,
- tile_scheduler_params: PersistentTileSchedulerParams | ClcDynamicPersistentTileSchedulerParams,
- response_ptr: cutlass.cute.typing.Pointer | None = None,
Bases:
objectImmutable descriptor that pairs a tile-scheduler type with its params.
- tile_scheduler_type#
StaticPersistentorClcDynamicPersistent.- Type:
- tile_scheduler_params#
Scheduler-specific parameters (grid dims, cluster shape, etc.).
- response_ptr#
SMEM response buffer pointer; required only for CLC dynamic mode.
- Type:
cute.Pointer, optional
- tile_scheduler_type: TileSchedulerType#
- tile_scheduler_params: PersistentTileSchedulerParams | ClcDynamicPersistentTileSchedulerParams#
- response_ptr: cutlass.cute.typing.Pointer | None = None#
- static create_static_persistent_tile_scheduler_params(
- tile_scheduler_params: PersistentTileSchedulerParams,
Create a config for the static persistent tile scheduler.
- Parameters:
tile_scheduler_params (PersistentTileSchedulerParams) – CUTLASS static persistent scheduler parameters.
- Returns:
Configuration selecting
TileSchedulerType.StaticPersistent.- Return type:
- static create_clc_dynamic_persistent_tile_scheduler_params(
- tile_scheduler_params: ClcDynamicPersistentTileSchedulerParams,
- response_ptr: cutlass.cute.typing.Pointer,
Create a config for the CLC dynamic persistent tile scheduler.
- Parameters:
tile_scheduler_params (ClcDynamicPersistentTileSchedulerParams) – CUTLASS CLC dynamic scheduler parameters.
response_ptr (cute.Pointer) – SMEM response buffer pointer used by the CLC fetch pipeline.
- Returns:
Configuration selecting
TileSchedulerType.ClcDynamicPersistent.- Return type:
- __init__(
- tile_scheduler_type: TileSchedulerType,
- tile_scheduler_params: PersistentTileSchedulerParams | ClcDynamicPersistentTileSchedulerParams,
- response_ptr: cutlass.cute.typing.Pointer | None = None,
- class cutlass.experimental.task_scheduling.resources.StageInfo(
- loop_offset: int,
- loop_start: int,
- loop_end: int,
- loop_step: int,
- stage_idx: int | None,
- label: object,
- barrier: Array | None,
- work_tile: WorkTileInfo | None,
- num_active_stages: _MockObject = 0,
- context: ResourceContext | None = None,
- task_cache: object | None = None,
Bases:
objectRead-only context passed to
producer_work/consumer_work.- loop_offset#
Current iteration index within the K-tile loop over the computational domain.
- Type:
int
- loop_start, loop_end, loop_step
Bounds and stride of the K-tile loop (
range(loop_start, loop_end, loop_step)).- Type:
int
- stage_idx#
Pipeline stage index for the current operation (
Nonewhen the resource has no pipeline).- Type:
int or None
- label#
User-defined compile-time work label from the schedule entry. Selects a named work hook:
if cutlass.const_expr(stage_info.label == WorkLabel.K_DESC): ... # K descriptor logic elif cutlass.const_expr(stage_info.label == WorkLabel.V_DESC): ... # V descriptor logic
Nonewhen no label is specified (backward-compatible default).- Type:
object or None
- barrier#
Mbarrier pointer for the current pipeline stage (
Nonewhen the resource has no pipeline).- Type:
cutlass.Array or None
- work_tile#
Tile coordinates and validity flag from the tile scheduler.
- Type:
WorkTileInfo or None
- num_active_stages#
Number of producer stages currently in flight for delayed-commit producer schedules. This is 0 for the default immediate-commit schedule.
- Type:
int
- context#
Unified context carrying
smem_base,tmem_ptr_i32, and any future framework-level state.Nonewhen no allocator is in use.- Type:
ResourceContext or None
- task_cache#
Optional task-defined payload returned by
Task.make_task_cache(). This is intended for kernel-specific cached values that hot resource paths want to read without wideningStageInfofield-by-field. The payload shape is task-defined and should remain fixed per task class.- Type:
object or None
- loop_offset: int#
- loop_start: int#
- loop_end: int#
- loop_step: int#
- stage_idx: int | None#
- label: object#
- barrier: Array | None#
- work_tile: WorkTileInfo | None#
- num_active_stages: _MockObject = 0#
- context: ResourceContext | None = None#
- task_cache: object = None#
- __init__(
- loop_offset: int,
- loop_start: int,
- loop_end: int,
- loop_step: int,
- stage_idx: int | None,
- label: object,
- barrier: Array | None,
- work_tile: WorkTileInfo | None,
- num_active_stages: _MockObject = 0,
- context: ResourceContext | None = None,
- task_cache: object | None = None,
- class cutlass.experimental.task_scheduling.resources.TaskLocalVariable(
- dtype: object = <object object>,
- default: object = <object object>,
- default_factory: ~collections.abc.Callable[[],
- object] | None = None,
- docs: str | None = None,
- runtime_slot_name: str | None = None,
Bases:
objectMetadata for one resource-owned variable in captured TS schedules.
A
TaskLocalVariableis the public identity of a logical variable owned by aMemoryResource. In generated code it materializes as task-local register state, with consumer work calls producing new versions of that register value. The current implementation still lowers through string-namedconsumer_vars/producer_varsslots, but schedule code should carryTaskLocalVariableidentities rather than naming those internal dictionaries directly.- dtype#
DSL type of the value stored in the task-local register slot.
- Type:
object
- default#
Sink-safe initial value used before any producer writes and at SSA joins.
- Type:
object
- default_factory#
Factory for the initial value. Mutually exclusive with
default.- Type:
Callable[[], object], optional
- docs#
Short user-facing description rendered by API documentation.
- Type:
str, optional
- runtime_slot_name#
Override for the internal slot name. Most resources use the dataclass field name.
- Type:
str, optional
- dtype: object = <object object>#
- default: object = <object object>#
- default_factory: Callable[[], object] | None = None#
- docs: str | None = None#
- runtime_slot_name: str | None = None#
- static uninitialized() Field#
Declare a dataclass field that backs a
TaskLocalVariableslot.The slot must be assigned a
TaskLocalVariableinstance during__init__or__post_init__of the owning class:item: TaskLocalVariable = TaskLocalVariable.uninitialized() def __post_init__(self) -> None: self.item = TaskLocalVariable(dtype=..., default=...)
Forgetting the assignment surfaces as a clear
ValueErrorthe first time TS walks the resource’s task-local variables (seebind_task_local_variables).The returned
Fieldcarries framework metadata under the"ts"namespace so that@consumer_work(returns=...)can verify that a field reference points at an actual task-local slot rather than an arbitrarydataclasses.Field.- Returns:
Field placeholder to assign a concrete
TaskLocalVariablein the owning resource constructor or__post_init__.- Return type:
dataclasses.Field
- property owner: object | None#
Resource instance that owns this variable, once bound.
- property field_name: str | None#
Stable resource field name used for legacy slot lowering.
- property slot_name: str | None#
Current internal slot name for this variable.
- __init__(
- dtype: object = <object object>,
- default: object = <object object>,
- default_factory: ~collections.abc.Callable[[],
- object] | None = None,
- docs: str | None = None,
- runtime_slot_name: str | None = None,
- cutlass.experimental.task_scheduling.resources.consumer_work(method: ~collections.abc.Callable[[...], ~typing.Any] | None = None, *, work_attrs: ~cutlass.experimental.task_scheduling.enums.WorkAttr = <WorkAttr.NONE: 0>, returns: str | ~dataclasses.Field | tuple[str | ~dataclasses.Field, ...] | list[str | ~dataclasses.Field] | None = None) Callable[[...], Any]#
Register a method as a named consumer work function on a
MemoryResource.Consumer work reads data out of the owning
MemoryResourcefrom the resource’s point of view. The decorator registers the method under its Python name, which is also the rawschedule_listlabel.- Parameters:
method (Callable, optional) – Method being decorated. Omitted when using decorator-factory form.
work_attrs (cutlass.experimental.task_scheduling.enums.WorkAttr, optional) – Verification-visible attributes for the work callback. Use
WorkAttr.AUXILIARYfor helper work that carries no data payload.returns (str or dataclasses.Field or sequence, optional) –
TaskLocalVariableoutput slot or slots updated by this consumer. Field references must point at fields declared withTaskLocalVariable.uninitialized().
- Returns:
Decorated method or decorator factory.
- Return type:
Callable
Notes
Captured schedules pass returned values as data-flow tokens. A typical method declaration is:
item: TaskLocalVariable = TaskLocalVariable.uninitialized() @consumer_work(returns=item) @cute.jit def load(self, stage_info): return self.tensor[stage_info.loop_offset]
When a raw schedule list is used and a resource has multiple named consumer methods, the label is the final tuple element, for example
(smem, ScheduleStage.ConsumerWork, "build_desc_a").
- cutlass.experimental.task_scheduling.resources.producer_work(method: ~collections.abc.Callable[[...], ~typing.Any] | None = None, *, work_attrs: ~cutlass.experimental.task_scheduling.enums.WorkAttr = <WorkAttr.NONE: 0>) Callable[[...], Any]#
Register a method as a named producer work function on a
MemoryResource.Producer work writes data into the owning
MemoryResourcefrom the resource’s point of view. Captured schedules pass consumer tokens into producer keyword parameters by name.- Parameters:
method (Callable, optional) – Method being decorated. Omitted when using decorator-factory form.
work_attrs (cutlass.experimental.task_scheduling.enums.WorkAttr, optional) – Verification-visible attributes for the work callback. Use
WorkAttr.AUXILIARYfor helper work that carries no data payload.
- Returns:
Decorated method or decorator factory.
- Return type:
Callable
Notes
A typical captured producer receives token values as keyword parameters:
@producer_work @cute.jit def store(self, stage_info, *, item): self.tensor[stage_info.loop_offset] = item
When a raw schedule list is used and a resource has multiple named producer methods, the label is the final tuple element, for example
(smem, ScheduleStage.ProducerWork, "tma_load_a").
- class cutlass.experimental.task_scheduling.resources.MemoryResource(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = False,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
Bases:
objectBase class for every resource in the TS dataflow graph.
A
MemoryResourcerepresents a named piece of memory (GMEM, SMEM, TMEM, etc.) together with the pipeline that guards access to it. Subclasses override the hook methods below to define resource-specific behaviour; theTaskscheduler calls them at the appropriate points.Named work functions#
Instead of (or in addition to) overriding the monolithic
consumer_work/producer_work, subclasses can use the@consumer_work/@producer_workdecorators to register multiple named work methods. The schedule-list label selects which method to call at trace time:@consumer_work @cute.jit def k_desc(self, stage_info): ... @consumer_work @cute.jit def v_desc(self, stage_info): ...
In the schedule list, each
ConsumerWorkentry must carry a label when two or more named methods are registered:(smem_kv, ScheduleStage.ConsumerWork, "k_desc")Label validation:
Typos raise
ValueErrorwith a did-you-mean suggestion.Missing labels with ≥2 named methods raise
ValueError.A single named method auto-dispatches without a label.
No named methods → monolithic
consumer_work()is called.
Hook methods (override in subclasses)#
get_smem_requirements() -> list[SmemAllocation]returnsSmemAllocationobjects for data SMEM this resource needs. Default returns[].get_tmem_requirements() -> list[TmemAllocation]returnsTmemAllocationobjects for TMEM columns this resource needs. Default returns[].create_consumer_variables() -> dictreturns a{name: default}dict of consumer variables that the consumer side produces and forwards to downstream resources viacopy_consumer_vars_to.create_producer_variables() -> dictreturns a{name: default}dict of variables consumed by the producer side and populated from an upstream resource’s consumer vars.consumer_aux_work(stage_info)is helper-variable logic executed duringScheduleStage.ConsumerAuxWork.consumer_work(stage_info)is user logic executed duringScheduleStage.ConsumerWork. Overridden by@consumer_workmethods when labels are used.producer_aux_work(stage_info)is helper-variable logic executed duringScheduleStage.ProducerAuxWork.producer_work(stage_info)is user logic executed duringScheduleStage.ProducerWork. Overridden by@producer_workmethods when labels are used.
- name#
Human-readable label (used in debug prints and PTX comments).
- Type:
str
- pipeline_config#
Pipeline descriptor;
Nonefor resources that need no pipeline (e.g. GMEM source/sink).- Type:
PipelineConfig or None
- consumer_vars, producer_vars
Variable dicts populated by
create_consumer/producer_variables.- Type:
dict
- pipeline#
Materialised pipeline object, set by
create().- Type:
object or None
- consumer_state, producer_state
Pipeline state objects (stage index + phase bit). With
advance_on_acquire,producer_stateis the acquire cursor andproducer_commit_stateis the lagging commit cursor. Producer work derives the just-acquired state fromproducer_stateor follows the commit cursor, depending on the work slot.
- consumer_status, producer_status
Boolean flags used by try_wait / try_acquire.
- is_barrier#
Truefor pure signaling resources that carry no data (e.g. sequence barriers, done notifications). Barrier resources get relaxed dependency-backing rules in_verify_resource_deps.- Type:
bool
- dummy#
Keep DSL state live across dynamic control-flow boundaries.
- Type:
bool
- consumer_var_names: ClassVar[Tuple[str, ...] | None] = None#
- name: _MockObject = ''#
- is_barrier: _MockObject = False#
- pipeline_config: _MockObject = None#
- consumer_vars: _MockObject#
- producer_vars: _MockObject#
- pipeline: _MockObject = None#
- consumer_state: Any = None#
- producer_state: Any = None#
- producer_commit_state: Any = None#
- consumer_status: Any = None#
- producer_status: Any = None#
- consumer_release_state: Any = None#
- consumer_work_stage: Any = None#
- consumer_wait_signaling_threads: _MockObject = None#
- pipeline_group: _MockObject = None#
- dummy: _MockObject = False#
- property state_src: MemoryResource#
The object that owns this resource’s consumer pipeline state.
Returns
selfby default. For a member of a MergePipelineGroupthis returns the group itself, so all members share the group’s canonical consumer state (one consumer drives pipeline progression). Fork members and non-group resources use their own state (returnsself).Producer state is NOT redirected. Each producer task independently tracks its own stage via
resource.producer_state. Code on the producer side must useresource.producer_statedirectly, notresource.state_src.producer_state.Pre-resolving the state source as a plain Python attribute access (instead of a
_resolve_dispatchfunction call inside@cute.jitregions) avoids DSL-tracer side effects that would otherwise emit IR dominance errors. The_state_src_ownerfield is set byPipelineGroup.__post_init__for Merge members only.
- create_pipeline(
- pipeline_config: PipelineConfig,
Materialise a pipeline object from the given config.
Allocates SMEM barrier storage (if not pre-supplied in
pipeline_config.barrier_ptr), then dispatches to the correct pipeline constructor based onpipeline_config.pipeline_type.All pipelines are created with
defer_sync=Trueso that barrier initialisation fencing is left to the caller (TaskManager/ kernel).
- get_producer_acquire_state() object#
Return the state used for producer-side empty-barrier waits.
- get_producer_commit_state() object#
Return the state used for producer-side full-barrier commits.
- get_producer_work_state(
- follows_acquire: bool = True,
Return the state used for producer-side data movement.
With
advance_on_acquire, work does not have an independent pipeline cursor. Work that follows acquire derives its stage from the acquire cursor inTask._create_stage_info; work that does not follow acquire uses the lagging commit cursor.
- create() None#
Materialise the pipeline (if configured).
Called once per resource from
TaskManager.setup_resources_and_tasks(). Subclasses that need additional one-time setup (e.g.WorkQueuecreating its tile scheduler) should callsuper().create()first.Members of a
PipelineGroupskip pipeline creation — their barrier ops are routed through the group’s shared pipeline.
- create_consumer_variables_internal(
- captured_schedule: bool = False,
Populate
consumer_varsby calling the user hook (legacy only).
- create_producer_variables_internal(
- captured_schedule: bool = False,
Populate
producer_varsby calling the user hook (legacy only).In captured-schedule mode,
producer_varsis auto-allocated byTask._allocate_slots_from_routingfrom upstreamconsumer_varsbased on captured schedule data-flow tokens, and overridingcreate_producer_variablesis forbidden. This method becomes a no-op (and raises on illegal overrides) — the actual slot allocation runs fromTask.init_variables.
- create_consumer_variables() dict#
Return initial consumer variable dict. Override in subclasses.
- create_producer_variables() dict#
Return initial producer variable dict. Override in subclasses.
- get_smem_requirements() List[SmemAllocation]#
Return SMEM allocations required by this resource.
Override in subclasses that use data SMEM (not barrier SMEM, which is managed by
create_pipeline). The returnedSmemAllocationobjects should be stored as instance attributes so the resource can read their.offsetlater.Default returns an empty list (no data SMEM needed).
- get_tmem_requirements() List[TmemAllocation]#
Return TMEM column allocations required by this resource.
Override in subclasses that use TMEM. The returned
TmemAllocationobjects should be stored as instance attributes so the resource can read their.offsetlater.Default returns an empty list (no TMEM needed).
- get_producer_requirements() list | None#
Return allocations accessed during
ProducerWork.Override in subclasses where the producer only accesses a subset of the resource’s allocations. Return a list containing any mix of
SmemAllocationandTmemAllocationobjects.The exhaustive checker uses this to build a producer-specific alias map so that
prod_workonly conflicts with aliases that overlap these ranges.Default returns
None(all allocations fromget_smem_requirements+get_tmem_requirementsare considered producer-accessible).
- get_consumer_requirements() list | None#
Return allocations accessed during
ConsumerWork.Symmetric counterpart of
get_producer_requirements. Override in subclasses where the consumer only accesses a subset of the resource’s allocations.Default returns
None(all allocations are consumer-accessible).
- initialize_runtime_state_internal(
- context: ResourceContext | None = None,
- captured_schedule: bool = False,
Initialise pipeline state/status and task-local storage defaults.
Always creates
consumer_status/producer_status(Int32) andconsumer_state/producer_state(pipeline state or dummy Int32) so that the DSL tree shape is consistent regardless of whether a pipeline is attached.For CLC pipelines the producer state uses
ProducerConsumermode to support both roles.
- set_consumer_var(
- name: _MockObject,
- value: object,
Save a named consumer variable (called from
consumer_work).
- get_consumer_var(name: str) object#
Read a named consumer variable (called from consumer work).
- get_producer_var(
- name: _MockObject,
Read a named producer variable (called from
producer_work).
- copy_consumer_vars_to(
- dst_resource: MemoryResource,
- var_names: list[str | tuple[str, str]] | None = None,
Forward matching consumer vars into dst_resource’s producer vars.
When var_names is
None(broadcast mode), every key present in bothself.consumer_varsanddst_resource.producer_varsis copied. When var_names is given, only those specific routes are copied. A route may be"name"for same-name copy or("src_name", "dst_name")for explicit remapping.Called automatically by
Task._consumer_workafterconsumer_work(stage_info)returns, for destinations whosedst_stagein the resolved slot routing is aProducer*Workstage.
- copy_consumer_vars_to_consumer_of(
- dst_resource: MemoryResource,
- var_names: list[str | tuple[str, str]] | None = None,
Forward matching consumer vars into dst_resource’s consumer vars.
Counterpart to
copy_consumer_vars_to()for consumer-to-consumer variable flow: the source resource’sconsumer_varsare copied into the destination resource’sconsumer_varsso that a laterconsumer_work*call ondst_resourcecan read them withget_consumer_var.When var_names is
None(broadcast mode), every key present in bothself.consumer_varsanddst_resource.consumer_varsis copied. When var_names is given, only those specific routes are copied. A route may be"name"for same-name copy or("src_name", "dst_name")for explicit remapping.Called automatically by
Task._consumer_work*when the resolved slot routing for this slot targets aConsumerWork*stage ondst_resource(which must therefore be insrc_resources, since consumer vars belong to the consumer side of a resource).
- store_consumer_status(value: Boolean) None#
Store consumer_status via self so the IR pass instruments the write.
Converts the Boolean (i1) from consumer_try_wait to Int32 to avoid IR boolean-ref edge cases (see initialize_runtime_state_internal).
- load_consumer_status() Int32#
Load consumer_status via self so the IR pass instruments the read.
Returns Int32; the pipeline’s consumer_wait already compares with 0 via arith.cmpi so no conversion back to Boolean is needed.
- store_producer_status(value: Boolean) None#
Store producer_status via self so the IR pass instruments the write.
Converts the Boolean (i1) from producer_try_acquire to Int32 to avoid IR boolean-ref edge cases (see initialize_runtime_state_internal).
- load_producer_status() Int32#
Load producer_status via self so the IR pass instruments the read.
Returns Int32; the pipeline’s producer_acquire already compares with 0 via arith.cmpi so no conversion back to Boolean is needed.
- consumer_work(
- stage_info: StageInfo,
Consumer-side user logic.
- Parameters:
stage_info (StageInfo) – Current loop, stage, barrier, work-tile, and resource context.
of (Override in subclasses that use the monolithic work hook instead)
methods. (named @consumer_work)
- consumer_aux_work(
- stage_info: StageInfo,
Helper-variable consumer work that does not model memory access.
- Parameters:
stage_info (StageInfo) – Current loop, stage, barrier, work-tile, and resource context.
- producer_aux_work(
- stage_info: StageInfo,
Helper-variable producer work that does not model memory access.
- Parameters:
stage_info (StageInfo) – Current loop, stage, barrier, work-tile, and resource context.
- producer_work(
- stage_info: StageInfo,
Producer-side user logic.
- Parameters:
stage_info (StageInfo) – Current loop, stage, barrier, work-tile, and resource context.
of (Override in subclasses that use the monolithic work hook instead)
methods. (named @producer_work)
- physical_ranges() list[tuple[str, int, int]]#
Declare physical memory regions this resource occupies.
Returns a list of
(memory_space, start_col, end_col)tuples describing the physical address ranges. Used by the cross-tile aliasing verifier to detect potential data races between resources that share the same physical memory (e.g. TMEM column overlaps).Override in subclasses whose physical storage overlaps with other resources. Default: empty (no declared ranges, no aliasing checks).
- __init__(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = False,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- class cutlass.experimental.task_scheduling.resources.PdlWaitBarrier(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = True,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
Bases:
MemoryResourceWait side of CUDA Programmatic Dependent Launch (PDL).
A barrier-only resource (
is_barrier=True, noPipelineConfig) whose single user-facing method,wait_griddep(), emits agriddepcontrol.waitPTX instruction. The instruction blocks the issuing thread until the direct predecessor grid dependency has completed and made its global-memory results visible.Wiring contract#
Any TS resource whose data is sourced from the predecessor grid (e.g. SMEM-A loaded via TMA, GMEM-A read directly, DSMEM-A copied from a peer CTA) declares the dependency by listing
pdl_waitas one of that resource’s upstreams inTaskManager.resource_dependency_graph, e.g.resource_dependency_graph[smem_a] = [pdl_wait, ...]. BecausePdlWaitBarrierhasis_barrier=True, the verifier interprets the edge as ordering-only: no consumer/producer variable copy plan is set up, but it does require the schedule entry that emits the wait to precede the producer entries of any task that produces the dependent resource.The
wait_griddepentry may sit in any phase (Head, Loop withLoopFirstIter/LoopLastIterguards, Tail, post-WTL).Encouraged pattern#
The encouraged pattern is inline wait: every task that produces a PDL-dependent resource issues its own
pdl_wait.wait_griddep()call.See also
PdlLaunchBarrier,side.- is_barrier: _MockObject = True#
- __init__(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = True,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- class cutlass.experimental.task_scheduling.resources.PdlLaunchBarrier(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = True,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
Bases:
MemoryResourceLaunch-dependents side of CUDA Programmatic Dependent Launch (PDL).
A barrier-only resource (
is_barrier=True, noPipelineConfig) whose single user-facing method,launch_griddep(), emits agriddepcontrol.launch_dependentsPTX instruction. The instruction notifies the successor grid that it may begin launching CTAs.Wiring contract#
A
PdlLaunchBarriercarries no data dependency: it does not appear on the consumer side of any data flow. Therefore it is not expected as a destination inresource_dependency_graph. The verifier treatslaunch_griddepentries as schedule-only emissions that may sit in any task and any phase. The exhaustive interleaving checker still requires every executable launch interleaving to have already executed at least onePdlWaitBarrier.wait_griddep.No global “at least one launch” rule is enforced — a kernel may legitimately omit launch (e.g. when it is the last grid in a pipeline chain or launch is gated by a non-PDL host policy).
See also
- is_barrier: _MockObject = True#
- __init__(
- *,
- name: ~sphinx.ext.autodoc.mock._MockObject = '',
- is_barrier: ~sphinx.ext.autodoc.mock._MockObject = True,
- pipeline_config: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- producer_vars: ~sphinx.ext.autodoc.mock._MockObject = <factory>,
- pipeline: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- consumer_wait_signaling_threads: ~sphinx.ext.autodoc.mock._MockObject | None = None,
- cutlass.experimental.task_scheduling.resources.PDL_BARRIER_TYPES: tuple = (<class 'cutlass.experimental.task_scheduling.resources.PdlWaitBarrier'>, <class 'cutlass.experimental.task_scheduling.resources.PdlLaunchBarrier'>)#
Tuple of all PDL barrier classes for
isinstancechecks.Use this in framework code that needs to recognise any PDL-style barrier regardless of whether it is the wait side (
PdlWaitBarrier) or the launch side (PdlLaunchBarrier).
- class cutlass.experimental.task_scheduling.resources.WorkQueue(
- tile_scheduler_config: TileSchedulerConfig,
- **kwargs: Any,
Bases:
MemoryResourceResource that wraps a persistent tile scheduler.
It participates in the schedule of every task:
Static persistent mode - Number of launched CTAs is exactly to fill 1 wave of SMs. Work-tile indices are assigned statically to each CTA. It needs no dedicated scheduler warp.
get_and_advance_work_tilecallsadvance_to_next_workdirectly.CLC dynamic persistent mode - a dedicated scheduler warp acts as the producer, issuing work-tile fetch requests in
fetch_work_tile. Consumer tasks simply wait on the pipeline.
In both modes, the consumer-side variable
work_tile(WorkTileInfo) carries the tile coordinates and validity flag that other resources read.- tile_scheduler#
Materialised scheduler, set by
create().
- tile_scheduler_config#
Descriptor selecting the scheduler type and parameters.
- Type:
- tile_scheduler: StaticPersistentTileScheduler | ClcDynamicPersistentTileScheduler | None = None#
- __init__(
- tile_scheduler_config: TileSchedulerConfig,
- **kwargs: Any,
- tile_scheduler_config: _MockObject = None#
- work_tile: _MockObject#
- skip_work_tile: _MockObject#
- create_tile_scheduler() StaticPersistentTileScheduler | ClcDynamicPersistentTileScheduler#
Instantiate the concrete tile scheduler from
tile_scheduler_config.
- create() None#
Create the pipeline (from base class) and the tile scheduler.
- initial_work_tile_info() WorkTileInfo#
Return the initial work tile from the underlying scheduler.
- skip_work_tile_if(
- work_tile: WorkTileInfo,
Default skipped-tile predicate used by captured TS schedules.
- init_work_tile(
- stage_info: StageInfo,
Seed the persistent loop state before the first work tile.
- get_and_advance_work_tile(
- stage_info: StageInfo,
Typed-schedule work-tile advance callback.
- fetch_work_tile(
- stage_info: StageInfo,
Typed-schedule work-tile fetch callback.
Takes no routed input: the current work tile is supplied by the persistent-loop machinery through
stage_info, so schedules callwq.fetch_work_tile()directly.
- producer_tail() None#
Drain in-flight pipeline stages after the persistent loop exits.