Skip to content

Instantly share code, notes, and snippets.

View danikhan632's full-sized avatar

Daniyal khan danikhan632

View GitHub Profile
@danikhan632
danikhan632 / CSL_LANGUAGE_REFERENCE.md
Created April 13, 2026 18:35
CSL Language Reference

CSL (Cerebras Streaming Language) - In-Depth Language Reference

1. Overview

CSL (Cerebras Streaming Language) is a domain-specific programming language designed for programming Cerebras Wafer-Scale Engine (WSE) processors. Its syntax is derived from Zig, but its purpose and compiler implementation are entirely different. CSL targets a massively parallel architecture consisting of hundreds of thousands of Processing Elements (PEs) arranged in a 2D grid, each with its own compute engine (CE), router, and local memory.

A complete CSL program consists of:

  1. Layout code (layout.csl) -- defines the spatial arrangement of PEs and their routing/communication configuration.
  2. PE programs (pe_program.csl, etc.) -- define the computation running on individual PEs.