forked from tensor-compiler/tensor-compiler.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.html
224 lines (217 loc) · 13.2 KB
/
codegen.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<html>
<head>
<!-- Title -->
<title>Try online - TACO: The Tensor Algebra Compiler</title>
<!-- CSS and JavaScript -->
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-red.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
<link rel="stylesheet" href="stylesheets/style.css">
<link rel="stylesheet" href="stylesheets/getmdl-select.min.css">
<link rel="stylesheet" href="stylesheets/bootstrap-dropdown.css">
<link rel="stylesheet" href="stylesheets/dropdown.css">
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">
</script>
<script src="javascripts/getmdl-select.min.js"></script>
<script src="javascripts/jquery.ui.touch-punch.min.js"></script>
<script src="javascripts/FileSaver.min.js"></script>
<script src="javascripts/parser.js"></script>
<script src="javascripts/parser-indices.js"></script>
<script src="javascripts/default-schedules.js"></script>
<script src="javascripts/demo.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<!-- Always shows a header, even in smaller screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<a class="menu-title" href="index.html"> <span class="mdl-layout-title">TACO: The Tensor Algebra Compiler</span> </a>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation -->
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="docs/index.html">Docs</a>
<a class="mdl-navigation__link" href="publications.html">Publications</a>
<a class="mdl-navigation__link" href="codegen.html">Web Tool</a>
<a class="mdl-navigation__link" href="https://github.com/tensor-compiler/taco">GitHub</a>
</nav>
</div>
</header>
<main class="mdl-layout__content">
<div class="page-content">
<div class="mdl-grid">
<div class="mdl-layout-spacer"></div>
<div class="mdl-cell mdl-cell--9-col">
<p style="line-height: 100%; font-size: 12px; margin-top:18px" align="justify">This is an alpha implementation of the tensor algebra compiler theory and contains known bugs, which are documented <a style="font-size:12px" href="https://github.com/tensor-compiler/taco/issues">here</a>. If you find additional issues, please consider submitting a bug report.</p>
<h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expression in index notation to generate code that computes it:</h6>
<table style="width: 100%">
<tr>
<td>
<div class="mdl-textfield mdl-js-textfield" style="width: 100%">
<input id="txtExpr" class="mdl-textfield__input" value="y(i) = A(i,j) * x(j)" style="font-family: monospace" spellcheck="false" autocomplete="false" autocorrect="false" autocapitalize="false">
<span id="lblError" class="mdl-textfield__error" style="font-size: 14px"></span>
</div>
</td>
<td style="width: 32px">
<div style="position:relative">
<button id="btnExamples" class="mdl-button mdl-js-button mdl-button--icon" style="width: 100%">
<i class="material-icons">more_vert</i>
</button>
<ul id="listExamples" class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="btnExamples"></ul>
</div>
</td>
<td style="width:150px; padding-right:15px">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"
style="width:100%">
<input id="prefix" class="mdl-textfield__input" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
<label class="mdl-textfield__label">(Optional) Prefix</label>
</div>
</td>
<td style="width: 200px">
<button id="btnGetKernel" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn">Generate Kernel</button>
</td>
</tr>
</table>
</div>
<div class="mdl-layout-spacer"></div>
</div>
<div id="tblFormats" class="mdl-grid" style="padding-top: 0px; padding-bottom: 0px">
<div class="mdl-layout-spacer"></div>
<div class="mdl-cell mdl-cell--9-col">
<table class="mdl-data-table mdl-js-data-table" style="width: 100%; margin-bottom: 8px">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric" width="100">
<div align="center" style="position:relative"><big>Tensor</big></div></th>
<th class="mdl-data-table__cell--non-numeric" width="175px"
style="padding-left: 0px">
<div style="display:inline"><big>Format </big></div>
</th>
<th class="mdl-data-table__cell--non-numeric" style="padding-left: 7px">
<div style="display:inline"><big>Level Formats </big></div>
<div style="display:inline; margin-right:10px">(reorder dimensions by dragging the drop-down menus)</div>
<div style="display:inline; vertical-align: middle">
<button id="btnHelp" class="help-btn mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons" style="font-size:20px">help_outline</i>
</button>
<div id="helpMenu" class="help-menu mdl-menu mdl-js-menu mdl-js-ripple-effect" for="btnHelp">
<p>
<strong>Dense</strong> levels store the size of the dimension $(N)$ and encode the coordinates in the interval $[0, N)$.
<img src="images/dense-arrays.jpg" class="centered-img" style="height: 25px; padding-top:10px">
</p>
<p>
<strong>Sparse</strong> levels store coordinates in a segment of the $\texttt{crd}$ array, with segment bounds stored in the $\texttt{pos}$ array.
<img src="images/compressed-arrays.jpg" class="centered-img" style="height: 50px; padding-top:10px">
</p>
<p>
<strong>Singleton</strong> levels store individual coordinates (with no siblings) in the $\texttt{crd}$ array.
<img src="images/singleton-arrays.jpg" class="centered-img" style="height: 25px; padding-top:10px">
</p>
<p>
A level is <strong>unique (U)</strong> if no collection of coordinates that share the same ancestors contains duplicates, and it is <strong>not unique (¬U)</strong> otherwise.
</p>
<p style="margin-bottom: 0"> More info on taco's tensor formats can be found <a href="http://tensor-compiler.org/chou-oopsla18-taco-formats.pdf">here</a>.</p>
</div>
</div>
</th>
</tr>
</thead>
<tbody id="listTensors">
</tbody>
</table>
</div>
<div class="mdl-layout-spacer"></div>
</div>
<div class="mdl-grid" style="padding-top: 6px">
<div class="mdl-layout-spacer"></div>
<div class="mdl-cell mdl-cell--9-col">
<div>
<button id="btnSchedule" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn" style="margin-bottom: 10px; width: 30%">
Add Scheduling Command
</button>
<span style="font-size: 12px; margin-left: 30px">Documentation on the scheduling language can be found <a href="http://tensor-compiler.org/docs/scheduling/index.html">here</a>.</span>
<div style="float: right">
<button id="btnDefault" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn" style="margin-right: 10px; width: inherit">
Get Schedule
</button>
</div>
</div>
<table class="mdl-data-table mdl-js-data-table" style="width: 100%; margin-bottom: 8px">
<tbody id="tblSchedule">
</tbody>
</table>
</div>
<div class="mdl-layout-spacer"></div>
</div>
<div class="mdl-grid" style="padding-top: 6px">
<div class="mdl-layout-spacer"></div>
<div class="mdl-cell mdl-cell--9-col">
<div id="panelKernels" class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<table style="width: 100%">
<tr>
<td>
<div class="mdl-tabs__tab-bar" style="justify-content: flex-start">
<a href="#compute-panel" class="mdl-tabs__tab is-active">Compute Loops</a>
<a href="#assembly-panel" class="mdl-tabs__tab">Assembly Loops</a>
<a href="#full-panel" class="mdl-tabs__tab">Complete Code</a>
</div>
</td>
<td style="width: 200px" align="right">
<!--<div class="mdl-tabs__tab-bar" style="justify-content: flex-end">
<a href="" class="mdl-tabs__tab">Download</a>
</div>-->
<button id="btnDownload" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn">Download</button>
</td>
</tr>
</table>
<div class="mdl-tabs__panel is-active" id="compute-panel">
<pre style="margin-top: 0px">
<code id="txtComputeLoops" class="lang-cpp">/* The generated compute loops will appear here */</code>
</pre>
</div>
<div class="mdl-tabs__panel" id="assembly-panel">
<pre style="margin-top: 0px">
<code id="txtAssemblyLoops" class="lang-cpp">/* The generated assembly loops will appear here */</code>
</pre>
</div>
<div class="mdl-tabs__panel" id="full-panel">
<pre style="margin-top: 0px">
<code id="txtFullCode" class="lang-cpp">/* The complete generated code will appear here */</code>
</pre>
</div>
</div>
<p style="line-height: 100%; font-size: 12px" align="justify">The generated code is provided "as is" without warranty of any kind. To help us improve taco, we keep a record of all tensor algebra expressions submitted to the taco online server.</p>
</div>
<div class="mdl-layout-spacer"></div>
</div>
<script>demo()</script>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__right-section">
<div>Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-93058524-1', 'auto');
ga('send', 'pageview');
</script>
</footer>
</div>
</main>
</div>
</body>
</html>