This section documents CSL libraries that are only supported for WSE-3.Documentation Index
Fetch the complete documentation index at: https://sdk.cerebras.ai/llms.txt
Use this file to discover all available pages before exploring further.
<message_passing>
The message_passing library provides functions for point-to-point
communication between PEs on the WSE-3 architecture.
By default, the library uses colors 14, 15, 16, 17, and 18 for message
passing. These colors may not be used for any other purpose while
message passing is enabled.
The library consists of one module, imported into the PE program.
When importing the library an input and output queue ID must be specified.
Additionally, an optional boolean enable_asserts parameter may be set to
true to enable runtime correctness checks on message legnth and destination.
init() initializes the library. This function must be called before
sending or receiving any messages.
send_message launches a microthreaded operation that sends a message of
a fixed length to another PE, and upon completion, either activates or unblocks
a callback local task. It has the following arguments:
dest_col: the column ID of the receiving PE within the program rectangle.dest_row: the row ID of the receiving PE within the program rectangle.buf: pointer to an array with a 16-bit or 32-bit element type, i.e.,i16,u16,@fp16(),i32,u32, orf32.len: number of elements to send.bufmust point to at leastlenelements or the operation is undefined.on_term: a struct of the form.{ .<ACTION> = <ID> }, whereACTIONis anactivateorunblockperformed at the end of the microthreaded send operation, and ID is a task or queue ID to be activated or unblocked. Passing{}indicates no termination behavior is desired.
recv_message launches a microthreaded operation that receives a message
sent from another PE, and upon completion, either activates or unblocks
a callback to a local task. It has the following arguments:
buf: pointer to an array with a 16-bit or 32-bit element type, i.e.,i16,u16,@fp16(),i32,u32, orf32.action: specifies whether to unblock or activate the callback.on_term: a struct of the form.{ .<ACTION> = <ID> }, whereACTIONis anactivateorunblockperformed at the end of the microthreaded receive operation, and ID is a task or queue ID to be activated or unblocked. Passing{}indicates no termination behavior is desired.
buf must point to an array large enough
to store the received message.
A message can also be received using a data_task bound to
mp_input_queue. The last wavelet in a message, which has a control bit set,
will NOT be received by the data_task. If the sender sends a message of
length N, the receiver’s data_task will receive the header, followed
by N-1 elements of the message. Thus, the sender must pad the sent
message with one additional wavelet at the end in this case.
<tile_config>
The tile_config library contains APIs related to the hardware configuration
of a PE. This section documents the submodules of the tile_config library
that are only supported for WSE-3. For more information about the
tile_config library in general see <tile_config>.
queue_flush
This submodule of tile_config contains APIs that allow us to read and
modify the queue flush status register. This register can tell us whether
the @queue_flush (see @queue_flush) builtin
operation has been executed and the respective queue has been flushed (i.e.,
it is now empty).

