Add CNN slide

This commit is contained in:
2024-04-06 10:01:24 +02:00
parent b38406a36f
commit 1e5256dc99
12 changed files with 7104 additions and 8977 deletions

8632
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,10 +10,8 @@
"dependencies": { "dependencies": {
"@slidev/cli": "^0.48.8", "@slidev/cli": "^0.48.8",
"@slidev/theme-default": "latest", "@slidev/theme-default": "latest",
"@slidev/theme-seriph": "latest",
"slidev-addon-citations": "^0.0.9", "slidev-addon-citations": "^0.0.9",
"slidev-theme-academic": "^1.3.0", "slidev-theme-academic": "^1.3.0",
"slidev-theme-geist": "^0.8.1",
"vue": "^3.4.21" "vue": "^3.4.21"
}, },
"devDependencies": { "devDependencies": {

98
public/cnn_filter.svg Normal file
View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
width="121.5"
height="83"
viewBox="-0.5 -0.5 121.5 83"
id="svg90"
sodipodi:docname="Unbenanntes Diagramm.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<sodipodi:namedview
id="namedview90"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1" />
<defs
id="defs1" />
<g
id="g31">
<rect
x="1"
y="42"
width="39"
height="38"
fill="none"
stroke="none"
pointer-events="all"
id="rect30" />
<path
d="m 1,42 m 39,0 m 0,38 M 1,80"
fill="none"
stroke="#6c8ebf"
stroke-linecap="square"
stroke-miterlimit="10"
pointer-events="all"
id="path30" />
</g>
<g
id="g87">
<rect
x="1"
y="1"
width="80"
height="80"
rx="12"
ry="12"
fill-opacity="0.4"
fill="#f8cecc"
stroke="#b85450"
stroke-width="3"
pointer-events="all"
id="rect86" />
</g>
<g
id="g89">
<g
transform="translate(-0.5,-0.5)"
id="g88">
<switch
id="switch87">
<foreignObject
style="overflow: visible; text-align: left;"
pointer-events="none"
width="100%"
height="100%"
requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
<xhtml:div
style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 41px; margin-left: 2px;">
<xhtml:div
style="box-sizing: border-box; font-size: 0px; text-align: center;"
data-drawio-colors="color: rgb(0, 0, 0); ">
<xhtml:div
style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<xhtml:font
color="#b75450">Filter</xhtml:font>
</xhtml:div>
</xhtml:div>
</xhtml:div>
</foreignObject>
<text
x="41"
y="45"
fill="#000000"
font-family="Helvetica"
font-size="12px"
text-anchor="middle"
id="text87">Filter</text>
</switch>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

1433
public/cnn_input.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -4,11 +4,33 @@
<svg <svg
version="1.1" version="1.1"
id="svg1" id="svg1"
width="444.51791" width="516.50708"
height="242.46431" height="281.73114"
viewBox="0 0 444.51792 242.46431" viewBox="0 0 516.50709 281.73114"
sodipodi:docname="gemv.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"> xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.409392"
inkscape:cx="75.564498"
inkscape:cy="150.41947"
inkscape:window-width="2194"
inkscape:window-height="1158"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<defs <defs
id="defs1"> id="defs1">
<clipPath <clipPath
@@ -2252,7 +2274,7 @@
</defs> </defs>
<g <g
id="g1" id="g1"
transform="translate(-174.61336,-188.18254)"> transform="matrix(1.1619488,0,0,1.1619488,-202.89178,-218.65849)">
<g <g
id="g485"> id="g485">
<g <g

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View File

@@ -4,11 +4,33 @@
<svg <svg
version="1.1" version="1.1"
id="svg1" id="svg1"
width="444.5152" width="518.98743"
height="194.4754" height="227.05699"
viewBox="0 0 444.5152 194.4754" viewBox="0 0 518.98743 227.05699"
sodipodi:docname="pu.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"> xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.9931935"
inkscape:cx="209.46286"
inkscape:cy="125.92857"
inkscape:window-width="2194"
inkscape:window-height="1158"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<defs <defs
id="defs1"> id="defs1">
<clipPath <clipPath
@@ -590,7 +612,7 @@
</defs> </defs>
<g <g
id="g1" id="g1"
transform="translate(-174.61337,-112.25229)"> transform="matrix(1.1675358,0,0,1.1675358,-203.86735,-131.05857)">
<g <g
id="g112"> id="g112">
<g <g

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 95 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -46,7 +46,3 @@ layout: end
# Thank you for your attention # Thank you for your attention
<hr/> <hr/>
---
src: ./slides/appendix.md
---

View File

@@ -21,7 +21,7 @@ figureCaption: Data structures for instructions and register files
<br> <br>
<br> <br>
- Software support library written in Rust - Software support library
- Provides data structures for PIM-HBM - Provides data structures for PIM-HBM
- Adhering special memory layout requirements - Adhering special memory layout requirements
- Executes programmed microkernels - Executes programmed microkernels
@@ -45,13 +45,17 @@ figureUrl: /bare_metal.svg
--- ---
## Virtual Prototype
### Platform
<hr/> <hr/>
<br> <br>
<br>
GEMV Microkernel
```asm{none|1-8|9,10|11|all}{lines:true} <div class="grid grid-cols-2 gap-4">
<div>
DRAM-side
```asm{all|1-8|9,10|11|12|all}{lines:true,at:1}
MOV GRF_A #0, BANK MOV GRF_A #0, BANK
MOV GRF_A #1, BANK MOV GRF_A #1, BANK
MOV GRF_A #2, BANK MOV GRF_A #2, BANK
@@ -66,3 +70,52 @@ FILL BANK, GRF_B #0
EXIT EXIT
``` ```
</div>
<div>
<style>
code {
font-size: 8px
}
</style>
Host-side
```rust {all|7-10|12-17|19-28|30-31|all}{lines:true,maxHeight:'15em',at:1}
pub fn execute<const X16R: usize, const X16C: usize, const R: usize>(
matrix: &Matrix<X16R, X16C>,
input_vector: &Vector<X16C>,
output_partial_sum_vector: &mut SVector<F16x16, R>,
dummy: &impl PimOperand,
) {
// Load input vector into GRF-A registers
for chunk in input_vector.0.iter() {
chunk.execute_read();
}
// Execute the MAC instructions without memory barriers
for sub_matrix in matrix.0.iter() {
for column_block in sub_matrix.fixed_rows::<1>(0).iter() {
column_block.execute_read_async();
}
}
// Verify all memory accesses have finished
barrier::dsb(barrier::SY);
// Copy the partial sums into the bank
for chunk in output_partial_sum_vector
.fixed_rows_with_step_mut::<X16R>(0, 16)
.iter_mut()
{
chunk.execute_write();
}
// Execute the EXIT instruction
dummy.execute_read();
}
```
</div>
</div>
<!-- </Transform> -->

View File

@@ -15,6 +15,49 @@ figureFootnoteNumber: 1
</Footnote> </Footnote>
</Footnotes> </Footnotes>
<!--
- Workload must be memory-bound
- memory-bound:
- fully-connected layers
- layers of recurrent neural networks (RNNs)
- not memory-bound:
- convolutional layers
- data reuse
-->
---
preload: false
clicks: 1
---
## Processing-in-Memory
### Applicable Workloads
<hr/>
<br>
- Convolutional layers have excessive data reuse
- Small filter matrix fits onto on-chip cache
<br>
<Transform :scale="1.4">
<div class="absolute left-175px top-1px">
<img src="/cnn_input.svg">
</div>
<div v-if="$slidev.nav.clicks === 0" class="absolute left-175px">
<img src="/cnn_filter.svg">
</div>
<div v-if="$slidev.nav.clicks === 1"
v-motion
:initial="{ x: 175, y: 0}"
:enter="{ x: 335, y: 0, transition: { duration: 5000 }}">
<img src="/cnn_filter.svg">
</div>
</Transform>
--- ---
## Processing-in-Memory ## Processing-in-Memory

5176
yarn.lock Normal file

File diff suppressed because it is too large Load Diff