Skip to content

Commit 2946d82

Browse files
committed
doc: iteration overview and base
1 parent c4112b5 commit 2946d82

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

docs_sphinx/chapters/assembly.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
Assembly
22
========
33

4+
Before we begin implementing the individual components of the project, we will start with a brief review of assembly language.
5+
This short chapter is intended as a refresher on the basic knowledge required for the project.
6+
47
Hello Assembly
58
--------------
69

10+
First, we will look at a simple assembly function, compile it, and examine the generated assembly code.
11+
712
1. Compile
813
^^^^^^^^^^
914

1015
**Task**: Use the GCC and Clang compilers to compile the function and generate assembly code.
1116

17+
The following commands will generate assembly code for the file ``hello_assembly.c``:
18+
1219
- gcc: ``gcc -S hello_assembly.c -o hello_assembly.s``
1320
- clang: ``clang -S hello_assembly.c -o hello_assembly_clang.s``
1421

@@ -134,6 +141,23 @@ Hello Assembly
134141

135142
**Task**: Write a C++ driver that calls the ``hello_assembly`` function and test your implementation.
136143

144+
The driver code can be found in the file ``hello_assembly.cpp``:
145+
146+
.. code-block:: cpp
147+
148+
extern "C"
149+
{
150+
void hello_assembly();
151+
}
152+
153+
int main()
154+
{
155+
hello_assembly();
156+
return 0;
157+
}
158+
159+
Commands to generate an executable and run it:
160+
137161
- ``gcc -c hello_assembly.c -o hello_assembly.o``
138162
- ``g++ -o hello_assembly.exe hello_assembly.cpp hello_assembly.o``
139163
- .. image:: ../_static/images/report_25_04_17/hello_assembly_example.png
@@ -143,6 +167,8 @@ Hello Assembly
143167
Assembly Function
144168
-----------------
145169

170+
Next we have a look at the assembly file ``add_values.s`` which contains a function that adds two values together.
171+
146172
1. Assemble
147173
^^^^^^^^^^^
148174

@@ -208,6 +234,8 @@ Size of ``.text``: 0x20 byte or equal 32 bytes. ``.text`` corresponds to the siz
208234

209235
**Task**: Write a C++ driver that calls the ``add_values`` function and illustrate it with an example.
210236

237+
The driver code can be found in the file ``add_values.cpp``:
238+
211239
- ``g++ -o add_values.exe add_values.cpp add_values.o``
212240
- .. image:: ../_static/images/report_25_04_17/add_values_example.png
213241
:align: center

docs_sphinx/chapters/overview.rst

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
Overview
22
========
33

4-
This documentation provides an overview of the Machine Learning Compilers project, which aims to develop a highly effective just-in-time (JIT) compiler for machine learning applications.
4+
In this project, we will develop a domain-specific compiler for tensor expressions from scratch. Tensor compilers are used to translate
5+
high-level tensor operations into efficient, low-level code that can be executed on various hardware platforms.
6+
7+
Tensor expressions are mathematical representations of operations on multi-dimensional arrays (tensors). They are widely used in machine
8+
learning, scientific computing, and data analysis. The goal of this project is to create a compiler that efficiently translates these
9+
expressions into machine code, enabling high-performance execution on modern hardware.
10+
11+
The compiler developed in this project is designed with the following goals in mind:
12+
13+
- **High Throughput**: Efficient execution of repeated evaluations of the same expression.
14+
- **Low Latency**: Fast response time for single expression evaluations.
15+
- **Short Compile Times**: Rapid compilation from expression to executable code.
16+
- **Flexibility**: Support for a wide range of tensor expressions.
17+
18+
To meet these goals, the compiler will be primitive-based, meaning that complex tensor operations are built from a set of manually tuned
19+
low-level primitives. These primitives are handcrafted during development and enable just-in-time (*JIT*) compilation of tensor
20+
expressions to machine code. In this project, the primitives are optimized for the **ARM64** architecture.
21+
22+
Documentation
23+
-------------
24+
25+
This overview chapter will guide you through the key components of the project. The documentation is structured into several chapters,
26+
each focusing on a specific aspect of the project.
27+
28+
Assembly
29+
--------
30+
31+
In the first chapter, :doc:`assembly`, we revisit the basics of assembly language as an essential requirement before diving into implementing
32+
the compiler. This chapter is intended as a refresher and is not directly part of the project's goal.

0 commit comments

Comments
 (0)