Skip to content

Commit

Permalink
update the examples for SDK version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leightonw-cerebras committed Dec 10, 2024
1 parent b7edf77 commit 5c26eb7
Show file tree
Hide file tree
Showing 281 changed files with 4,507 additions and 7,677 deletions.
23 changes: 14 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ The sample applications available are:
(GEMM) using the ``collectives`` library.
* ``residual``: Computes the norm of the residual of a matrix-vector
multiplication. Builds on the ``gemv-checkerboard-pattern`` example.
* ``stencil-v2``: A 3D 25-point stencil finite difference code for solving a
* ``25-pt-stencil``: A 3D 25-point stencil finite difference code for solving a
wave equation with a source perturbation.
* ``bandwidthTest``: Benchmarks the bandwidth of data transfers between host
* ``bandwidth-test``: Benchmarks the bandwidth of data transfers between host
and device using the ``memcpy`` framework and the ``SdkRuntime`` host API.
* ``spmv-hypersparse``: Computes a sparse matrix-vector product using a
hypersparse matrix.
* ``stencil-3d-7pts``: Computes a sparse matrix-vector product using a matrix
generated by a 7-point stencil.
* ``powerMethod``: Implements the Power method to compute the eigenvector
* ``7pt-stencil-spmv``: Computes a sparse matrix-vector product using a matrix
generated by a 3D 7-point stencil.
* ``power-method``: Implements the Power method to compute the eigenvector
of the largest eigenvalue of a matrix generated by a 7-point stencil.
* ``conjugateGradient``: Implements the Conjugate Gradient (CG) method to
* ``conjugate-gradient``: Implements the Conjugate Gradient (CG) method to
approximate the solution to a system of linear equations ``A*x = b``,
where ``A`` is a matrix generated by a 7-point stencil.
* ``preconditionedConjugateGradient``: Implements the Preconditioned Conjugate
* ``preconditioned-conjugate-gradient``: Implements the Preconditioned Conjugate
Gradient method (PCG) to approximate the solution to a system of linear
equations ``A*x = b``, where ``A`` is a matrix generated by a 7-point
stencil.
Expand All @@ -89,15 +89,20 @@ The sample applications available are:
* ``FFT``: Implements 1D and 2D Discrete Fourier Transforms (DFT).
* ``single-tile-matvec``: Implements highly optimized ``N x N`` matrix-vector
products, in which each PE performs the same matrix-vector computation.
* ``row-col-broadcast``: Benchmarks the bandwidth of data transfers between
host and device, where data is broadcast across a row or column of PEs,
using ``memcpy_h2d_colbcast`` and ``memcpy_h2d_rowbcast``.
* ``game-of-life``: Implements Conway's Game of Life, where each PE is treated
as a single cell.

Branches
--------

For each release of the SDK, there is a corresponding release tag in this
repository which contains a version of the CSL examples which are compatible
with that SDK release. For example, the tag ``rel-sdk-1.2.0`` in this
with that SDK release. For example, the tag ``rel-sdk-1.3.0`` in this
repository contains a version of the CSL examples which will work (compile and
simulate) with the SDK 1.2.0 release. The ``master`` branch is identical to the
simulate) with the SDK 1.3.0 release. The ``master`` branch is identical to the
newest release.

Full backward compatibility of the SDK is not guaranteed.
Expand Down
13 changes: 13 additions & 0 deletions RELEASE-NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Release Notes
The following are the release notes for the CSL Examples repository,
``csl-examples``.

Version 1.3.0
-------------

- The examples are improved and updated to comply with the SDK version 1.3.0.

- A new example program ``row-col-broadcast`` has been introduced which
benchmarks the bandwidth of data transfers between host and device,
where data is broadcast across a row or column of PEs,
using the new ``memcpy_h2d_colbcast`` and ``memcpy_h2d_rowbcast`` APIs.

- A new example program ``game-of-life`` has been introduced which implements
Conway's Game of Life, where each PE is treated as a single cell.

Version 1.2.0
-------------

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stencil-3d-7pts
===============
3D 7-Point Stencil SpMV
=======================

This example evaluates the performance of 7-point stencil. The kernel records
the ``start`` and ``end`` of ``spmv`` by tsc counter. In addition the tsc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def parse_args():
"-n",
default=1, type=int,
help="number of columns")
parser.add_argument("--simulator", action="store_true",
help="Runs on simulator")
parser.add_argument(
"-k",
default=1, type=int,
Expand Down Expand Up @@ -74,10 +76,9 @@ def parse_args():
parser.add_argument(
"--run-only",
help="Run only", action="store_true")
# arch = wse1 or wse2
parser.add_argument(
"--arch",
help="wse1 or wse2. Default is wse1 when not supplied.")
help="wse2 or wse3. Default is wse2 when not supplied.")
parser.add_argument(
"--width-west-buf",
default=0, type=int,
Expand Down Expand Up @@ -108,4 +109,7 @@ def parse_args():
print(f"create {logs_dir} to store log files")
os.mkdir(logs_dir)

if args.cmaddr is None:
args.simulator = False

return args, logs_dir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

cslc ./layout.csl --arch wse2 --fabric-dims=12,7 --fabric-offsets=4,1 \
cslc ./src/layout.csl --arch wse2 --fabric-dims=12,7 --fabric-offsets=4,1 \
--params=width:5,height:5,MAX_ZDIM:5 --params=BLOCK_SIZE:2 --params=C0_ID:0 \
--params=C1_ID:1 --params=C2_ID:2 --params=C3_ID:3 --params=C4_ID:4 --params=C5_ID:5 \
--params=C6_ID:6 --params=C7_ID:7 --params=C8_ID:8 -o=out \
Expand Down
11 changes: 11 additions & 0 deletions benchmarks/7pt-stencil-spmv/commands_wse3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e

cslc ./src/layout.csl --arch wse3 --fabric-dims=12,7 --fabric-offsets=4,1 \
--params=width:5,height:5,MAX_ZDIM:5 --params=BLOCK_SIZE:2 --params=C0_ID:0 \
--params=C1_ID:1 --params=C2_ID:2 --params=C3_ID:3 --params=C4_ID:4 --params=C5_ID:5 \
--params=C6_ID:6 --params=C7_ID:7 --params=C8_ID:8 -o=out \
--memcpy --channels=1 --width-west-buf=0 --width-east-buf=0
cs_python ./run.py -m=5 -n=5 -k=5 --latestlink out --channels=1 \
--width-west-buf=0 --width-east-buf=0 --zDim=5 --run-only
Loading

0 comments on commit 5c26eb7

Please sign in to comment.