PTX ISA v9.4

9.7.11.5.8. Fabric Instructions: fabric.try_put.async.tensor

fabric.try_put.async.tensor

Asynchronous copy of tensor data to fabric handle.

Syntax

ptx
// Form 0
fabric.try_put.async.tensor{.multimem}.dim.src{.load_mode}.completion_mechanism0
    {.level::cache_hint}.override::global_address{.override_attribute}
    .sem.sco.b128
    [tensorMap, tensorMapLeId, tensorMapOff,
    attributeOverrideInfo, tensorCoords], [src], sizeBytes, [mbar] {, cache_policy};

// Form 1 (counted::bytes)
fabric.try_put.async.tensor{.multimem}.dim.src{.load_mode}.completion_mechanism1
    {.level::cache_hint}.override::global_address{.override_attribute}
    .sem.sco.b128
    [tensorMap, tensorMapLeId, tensorMapOff, counterOff,
    attributeOverrideInfo, tensorCoords], [src], sizeBytes, [mbar] {, cache_policy};

.dim                    = { .1d, .2d, .3d, .4d, .5d };
.src                    = { .shared::cta };
.load_mode              = { .tiled };
.completion_mechanism0  = { .mbarrier::complete_tx::16B.mbarrier::report::fabric };
.completion_mechanism1  = { .mbarrier::complete_tx::16B.mbarrier::report::fabric.counted::bytes };
.sem.sco                = { .relaxed.sys };
.level::cache_hint      = { .l2::cache_hint };
.override_attribute     = { .override::global_dim, .override::global_dim_stride };

Description

Asynchronously copies data from source memory [src] to the tensor at fabric handle [tensorMapLeId, tensorMapOff], where tensorMapLeId is a 32-bit unsigned value denoting the logical endpoint identifier, and tensorMapOff is a 64-bit unsigned value denoting the base offset of the resource to access within the logical endpoint associated with tensorMapLeId.

The sizeBytes operand is 32 bits and specifies the number of bytes to be copied. It must be a multiple of 16; otherwise, the behavior is undefined. The number of bytes transferred by the instruction is computed using the tensor descriptor operand tensorMap, and it must match sizeBytes; otherwise, the behavior is undefined. The range [src, src + sizeBytes - 1] must be in bounds of the source memory space. The source pointer src and destination handle offset tensorMapOff must be 16-byte aligned.

If the optional .multimem qualifier is specified, then tensorMapLeId must be associated with a multicast logical endpoint and the device that issues the operation must be a member of that endpoint. Also, in the case of .multimem, the copy operation is performed on all member devices of the multicast endpoint. In the absence of the .multimem modifier, tensorMapLeId must be associated with a unicast logical endpoint.

If .src is .shared::cta, then the source of the copy [src] and the barrier [mbar] refer to the local CTA's shared memory.

The mbarrier object mbar must be initialized with .layout::v1 (see Layouts of the mbarrier object). Qualifier .mbarrier::complete_tx::16B specifies that the complete-tx operation is performed on mbar with completion count equal to the number of bytes copied divided by 16; that is, the count is incremented by 1 for every 16 bytes copied. Note that this completion mechanism differs from that for fabric.try_get.async.tensor, in which the complete-tx operation is performed with completion count equal to the number of bytes copied. For any thread to observe completion of fabric operations via an mbarrier object, the issuing thread is required to submit those operations before the barrier phase tracking these operations advances.

If the qualifier .counted::bytes is present, then:

  • tensorMapLeId must be associated with a logical endpoint with counted completion support (Counted completion mechanism), and
  • the counter offset counterOff must be 256-byte aligned, and
  • the range [counterOff, counterOff + 7] is in bounds of the logical endpoint tensorMapLeId on the current device, and must not overlap with the tensorMap being accessed, and
  • this operation provides counter-based completion for destination data using a 256-byte-aligned counter of size 8 bytes specified at [tensorMapLeId, counterOff].

Refer to Fabric Reporting Mechanism for the description of .mbarrier::report::fabric.

The operand tensorMap is the generic address of the opaque tensor-map object which resides in .param space, .const space, or .global space. The operand tensorMap specifies the properties of the tensor copy operation. The tensorMap is accessed in the tensormap proxy. Refer to the CUDA programming guide for creating the tensor-map objects on the host side.

The dimension of the tensor data is specified by the .dim qualifier.

The qualifier .load_mode specifies how the data in the source location is copied to the destination location.

This instruction accesses the data and the counter at the location specified by the handle operands through the fabric-proxy, reads the tensorMap through the tensormap-proxy, reads from the source .shared::cta through the async-proxy, and updates the mbarrier object in .shared::cta through the generic-proxy.

The qualifiers .override::global_address and .override_attribute support value override functionality for various tensor properties present in the tensorMap object. For more details refer to the Overriding tensor property value.

When the optional argument cache_policy is specified, the qualifier .level::cache_hint is required. The 64-bit operand cache_policy specifies the cache eviction policy that may be used during the memory access. cache_policy is a hint to the cache subsystem and may not always be respected. It is treated as a performance hint only and does not change the memory consistency behavior of the program.

The completion of this operation may be observed by waiting at the barrier via CTA-scope operations. Threads must submit fabric operations and wait for their completion before grid exit; otherwise, the behavior is undefined.

This operation has .relaxed.sys memory-order semantics as described in the Memory Consistency Model. Accesses to the source shared memory are with weak memory-order semantics.

PTX ISA Notes

Introduced in PTX ISA version 9.4.

Target ISA Notes

Requires sm_107f or higher in the same family.

Examples

ptx
fabric.try_put.async.tensor.2d.shared::cta.tile.mbarrier::complete_tx::16B.mbarrier::report::fabric.override::global_address.override::global_dim_stride.relaxed.sys.b128
           [tensorDesc, overrideLeId, overrideLeOff, {overrideSize16_0, overrideSize16_1}, {overrideLowerStrd_0}, overrideUpperStrd, {u, v}], [srcSmem], numBytes, [mbar];

fabric.try_put.async.tensor.multimem.5d.shared::cta.tile.mbarrier::complete_tx::16B.mbarrier::report::fabric.override::global_address.override::global_dim_stride.relaxed.sys.L2::cache_hint.b128
           [tensorDesc, overrideLeId, overrideLeOff, {overrideSize_0, overrideSize_1, overrideSize_2, overrideSize_3, overrideSize_4}, {overrideLowerStrd_0, overrideLowerStrd_1, overrideLowerStrd_2, overrideLowerStrd_3}, overrideUpperStrd, {u, v, w, x, y}], [srcSmem], numBytes, [mbar], mdesc;
esc
Type to search across all documentation