Skip to content

Commit

Permalink
[skip ci] #0: Prog Examples readme (#12973)
Browse files Browse the repository at this point in the history
#0: Prog Examples readme
  • Loading branch information
mbahnasTT authored Sep 21, 2024
1 parent ec317dc commit 391234c
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In this example, we will build a TT-Metal program that will add two vectors containing integers together, using data movement and compute kernels.

This program can be found in
[tt_metal/programming_examples/add_2_integers_in_compute/add_2_integers_in_compute.cpp](../../../tt_metal/programming_examples/add_2_integers_in_compute/add_2_integers_in_compute.cpp).
[add_2_integers_in_compute.cpp](../../../tt_metal/programming_examples/add_2_integers_in_compute/add_2_integers_in_compute.cpp).

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RISC-V processors 1 and 5 of a Tensix core are used for data movement, yet also have basic computing capabilities. In this example, we will build a TT-Metalium program to add two integers using these processors.

We'll go through this code section by section. Note that we have this exact, full example program in
[tt_metal/programming_examples/add_2_integers_in_riscv/add_2_integers_in_riscv.cpp](../../../tt_metal/programming_examples/add_2_integers_in_riscv/add_2_integers_in_riscv.cpp),
[add_2_integers_in_riscv.cpp](../../../tt_metal/programming_examples/add_2_integers_in_riscv/add_2_integers_in_riscv.cpp),
so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.
Expand Down
2 changes: 1 addition & 1 deletion tech_reports/prog_examples/dram_loopback/dram_loopback.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We will build a program in TT-Metal that will simply copy data from one
DRAM buffer to another, using the compute engine and an intermediate L1
buffer to do so. We call this concept \"loopback\".

We\'ll go through this code section by section. Note that we have this exact, full example program in [tt_metal/programming_examples/loopback/loopback.cpp](../../../tt_metal/programming_examples/loopback/loopback.cpp), so you can follow along.
We\'ll go through this code section by section. Note that we have this exact, full example program in [loopback.cpp](../../../tt_metal/programming_examples/loopback/loopback.cpp), so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

We now build a program that will perform eltwise binary operations on a some equal-sized tensors.

We'll go through any new code section by section. This builds on top of previous examples. Note that we have this exact, full example program in [tt_metal/programming_examples/eltwise_binary/eltwise_binary.cpp](../../../tt_metal/programming_examples/eltwise_binary/eltwise_binary.cpp), so you can follow along.
We'll go through any new code section by section. This builds on top of previous examples. Note that we have this exact, full example program in [eltwise_binary.cpp](../../../tt_metal/programming_examples/eltwise_binary/eltwise_binary.cpp), so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
2 changes: 1 addition & 1 deletion tech_reports/prog_examples/eltwise_sfpu/eltwise_sfpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We now build a program that will perform an eltwise SFPU unary operation on a single tensor.

We'll go through any new code section by section. This builds on top of previous examples. Note that we have this exact, full example program in [tt_metal/programming_examples/eltwise_sfpu/eltwise_sfpu.cpp](../../../tt_metal/programming_examples/eltwise_sfpu/eltwise_sfpu.cpp), so you can follow along.
We'll go through any new code section by section. This builds on top of previous examples. Note that we have this exact, full example program in [eltwise_sfpu.cpp](../../../tt_metal/programming_examples/eltwise_sfpu/eltwise_sfpu.cpp), so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We will build a simple program in TT-Metal that will set up a void compute kernel and place it on a given device, core, and RISC-V processor. In this example, there will be nothing for the kernel to compute; the focus will be on the general setup for a compute kernel.

We'll go through this code section by section. The full example program is at:
[tt_metal/programming_examples/hello_world_compute_kernel/hello_world_compute_kernel.cpp](../../../tt_metal/programming_examples/hello_world_compute_kernel/hello_world_compute_kernel.cpp)
[hello_world_compute_kernel.cpp](../../../tt_metal/programming_examples/hello_world_compute_kernel/hello_world_compute_kernel.cpp)
so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.
Expand Down Expand Up @@ -69,7 +69,7 @@ void MAIN {
}
```

Our kernel function, which is defined in [tt_metal/programming_examples/hello_world_compute_kernel/kernels/compute/void_compute_kernel.cpp](../../../tt_metal/programming_examples/hello_world_compute_kernel/kernels/compute/void_compute_kernel.cpp),
Our kernel function, which is defined in [void_compute_kernel.cpp](../../../tt_metal/programming_examples/hello_world_compute_kernel/kernels/compute/void_compute_kernel.cpp),
contains just a single `DPRINT` statement to indicate that the compute kernel has executed. Note that in order to print from the compute kernel, `DPRINT_MATH()` must be used.

## Configure and execute program on device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example will build a simple program in TT-Metal that will demonstrate how to set up a data movement kernel and place it on a given device, core, and RISC-V processor.

We'll go through this code section by section. Note that we have this exact, full example program in
[tt_metal/programming_examples/hello_world_datamovement_kernel/hello_world_datamovement_kernel.cpp](../../../tt_metal/programming_examples/hello_world_datamovement_kernel/hello_world_datamovement_kernel.cpp),
[hello_world_datamovement_kernel.cpp](../../../tt_metal/programming_examples/hello_world_datamovement_kernel/hello_world_datamovement_kernel.cpp),
so you can follow along.

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.
Expand Down Expand Up @@ -69,7 +69,7 @@ void kernel_main() {
```

The kernel function, defined in
[tt_metal/programming_examples/hello_world_datamovement_kernel/kernels/dataflow/void_dataflow_kernel.cpp](../../../tt_metal/programming_examples/hello_world_datamovement_kernel/kernels/dataflow/void_dataflow_kernel.cpp),
[void_dataflow_kernel.cpp](../../../tt_metal/programming_examples/hello_world_datamovement_kernel/kernels/dataflow/void_dataflow_kernel.cpp),
simply prints two statements from each of the RISC-V processors involved with data movement. This kernel is designed to be basic in order to focus on the data movement kernel setup itself.

## Configure and execute program on device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In terms of API usage, there isn\'t much change. We will discuss the specific ch

All important ways we use the API different are in the new `matmul_multi_core` function.

The full example program is in [tt_metal/programming_examples/matmul_multi_core/matmul_multi_core.cpp](../../../tt_metal/programming_examples/matmul_multi_core/matmul_multi_core.cpp)
The full example program is in [matmul_multi_core.cpp](../../../tt_metal/programming_examples/matmul_multi_core/matmul_multi_core.cpp)

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We'll build a program that will perform matmul operations on two tensors with equal-size inner dimension. We will then go through specific sections of the program.

The full example program is in
[tt_metal/programming_examples/matmul_single_core/matmul_single_core.cpp](../../../tt_metal/programming_examples/matmul_single_core/matmul_single_core.cpp)
[matmul_single_core.cpp](../../../tt_metal/programming_examples/matmul_single_core/matmul_single_core.cpp)

To build and execute, you may use the following commands. Note that we include the necessary environment variables here, but you may possibly need more depending on the most up-to-date installation methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In this example, we will implement a basic TT-Metalium program for padding an in
7. Dispatch program to device for execution.
8. Close device.

The code for this program can be found in [tt_metal/programming_examples/pad/pad_multi_core.cpp](../../../tt_metal/programming_examples/pad/pad_multi_core.cpp).
The code for this program can be found in [pad_multi_core.cpp](../../../tt_metal/programming_examples/pad/pad_multi_core.cpp).

The following commands will build and execute the code for this example. Environment variables may be modified based on the latest specifications.
```bash
Expand Down
2 changes: 1 addition & 1 deletion tech_reports/prog_examples/shard_data_rm/shard_data_rm.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Data Sharding (Multicore)

In this example, we will implement a simple TT-Metalium program to demonstrate how sharding works for untilized data. The code for this program can be found in
[tt_metal/programming_examples/sharding/shard_data_rm.cpp](../../../tt_metal/programming_examples/sharding/shard_data_rm.cpp).
[shard_data_rm.cpp](../../../tt_metal/programming_examples/sharding/shard_data_rm.cpp).

The following commands will build and execute the code for this example.
Environment variables may be modified based on the latest
Expand Down

0 comments on commit 391234c

Please sign in to comment.