forked from progforperf/progforperf.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.html
More file actions
557 lines (439 loc) · 28.6 KB
/
Copy pathnew.html
File metadata and controls
557 lines (439 loc) · 28.6 KB
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>ETH/CS 263-2300: How to Write Fast Numerical Code, spring 2011</title>
<!-- #BeginHeadLocked "" -->
<link href="style.css" rel="stylesheet" type="text/css" media="all">
<!-- #EndHeadLocked -->
</head>
<body bgcolor="#ffffff">
<table width="100%" border="0" cellspacing="6" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000066" height="109">
<tr>
<td class="padded" align="right">
<div class="blue">
<font color="#000066">
publications</font></div>
</td>
<td align="right"><img src="swami2.jpg" alt="" height="114" width="98" align="left" border="0"></td>
<td class="toppadded" align="left" valign="top" bgcolor="#000066" width="90%"><font color="white"><b>Markus Püschel</b><br>Professor<br>Associate Department Head<br>
Computer Science<br>
ETH Zürich<br>
Switzerland
</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top" height="100%">
<td class="padded" align="right" bgcolor="#000066" height="100%">
<p><img src="../../graphics/tppixel.gif" alt="" height="30" width="1" border="0"></p>
<p><a class="whitelink" href="../../index.html">home</a></p>
<p><a class="whitelink" href="../../publications.html">publications</a></p>
<p><a class="whitelink" href="../../teaching.html">teaching</a></p>
<p><a class="whitelink" href="../../shortcv.html">short CV</a></p>
<p><a class="whitelink" href="../../personal.html">personal</a></p>
<p><a class="whitelink" href="../../thepub.html">the pub</a></p>
</td>
<td width="95%" height="100%"><h1>How to Write Fast Numerical Code</h1>
<h1>263-2300 (ETH, CS)</h1>
<h2></h2>
<h2>Basic Information</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<ul>
<li>Course number: 263-2300, 6 credits
<li>Spring 2012, lectures: M 10:00-12:00, IFW C33; W 13:00-14:00 RZ F21; occasional substitute lectures: F 14:00-16:00 RZ F21
<li><strong>Instructor:</strong> Markus Püschel (RZ H18, pueschel at inf, 2-7303)<br>
<strong>TAs:</strong>
<ul>
<li>Georg Ofenbeck (RZ H1.1, ofgeorg at inf, 2-8414)</li>
<li>Daniele Spampinato (RZ H1.1, daniele.spampinato at inf), 2-8414)<br>
<strong>Admin:</strong> Franziska Mäder (RZ H14, maeder at inf, 2-7311)
</li>
</ul>
<li><strong>Office hours:</strong>
<ul>
<li>Markus Püschel: Tues 14:00-15:00</li>
<li>Daniele Spampinato: Wed 9:00 - 10:00</li>
<li>Georg Ofenbeck: Wed 14:00 - 15:00</li>
</ul>
<li><strong>Maling lists:</strong>
<ul>
<li>Forum to find project partner:
fastcode-forum@lists.inf.ethz.ch
(emails go to all students who have no partner yet and to Georg)</li>
<li>For technical questions: fastcode@lists.inf.ethz.ch (emails to this address go to the lecturerer and all TAs)<br>
</li>
</ul>
</li>
</ul>
<h2>Course Description</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<p>The fast evolution and increasing complexity of computing platforms pose a major challenge for developers of high performance software for engineering, science, and consumer applications: it becomes increasingly harder to harness the available computing power. Straightforward implementations may lose as much as one or two orders of magnitude in performance. On the other hand, creating optimal implementations requires the developer to have an understanding of algorithms, capabilities and limitations of compilers, and the target platform's architecture and microarchitecture.<br>
<br>
This interdisciplinary course aims to give the student an understanding of performance and introduces foundations and state-of-the-art techniques in high performance software development using important functionality such as linear algebra algorithms, transforms, filters, and others as examples. The course will focus on optimizing for the memory hierarchy and special instruction sets, thus complementing courses on parallel programming. Much of the material is based on recent research. <br>
<br>
Further, a general strategy for performance analysis and optimization is introduced that the students will apply in group projects that accompany the course. Finally, the course will introduce the students to the recent field of automatic performance tuning. </p>
<p>Prerequisites: solid C programming skills, matrix algebra, Master student or above</p>
<h4>Topics Covered</h4>
<ul type="disc">
<li><b>Algorithm analysis:</b> Problem versus algorithm, complexity and cost (asymptotic, exact, measured), cost analysis
<li><strong>Computer architecture (a software point of view):</strong> architecture and microarchitecture, memory hierarchy, special instruction sets<li><b>Compilers:</b> strengths, limitations, how to use
<li><b>Performance optimization:</b> guide to benchmarking, finding hotspots, code analysis, performance optimization techniques (for memory hierarchy and vector instruction extensions); these techniques are studied using the examples in the next bullet
<li><b>Numerical functionality studied in detail (complexity, algorithms, how to write highest performance code):</b> linear algebra kernels, transforms, filters, sparse linear algebra, others, your research project
<li><b>State-of-the-art research in Automatic Performance Tuning:</b> ATLAS, LAPACK, BeBOP, FFTW, SPIRAL, others
</ul>
<h4>Goals of this Course</h4>
<ul>
<li>Obtain an understanding of runtime performance and how to reason about it
<li>Learn a guideline how to write fast numerical code and apply it in homeworks and your research project
<li>Understand the connection between algorithms, implementations, and computer architecture
</ul>
<h4>Background Material</h4>
<ul>
<li>Prior versions of this course:
<ul>
<li><a href="../263-2300-ETH-spring11/course.html">spring 2011</a> (ETH)</li>
<li><a href="../18-645-CMU-spring08/course.html">spring 2008</a> (CMU)</li>
<li><a href="../18-799B-CMU-spring05/course.html">spring 2005</a> (CMU)</li>
</ul>
</li>
<li>Chapters 5 and 6 in <a href="http://csapp.cs.cmu.edu/">Computer Systems: A Programmer's Perspective, 2nd edition</a> (available in library)</li>
<li>This small <a href="http://spiral.ece.cmu.edu:8080/pub-spiral/abstract.jsp?id=100">tutorial</a></li>
<li>Research papers, manuals, and other material mentioned in the slides or linked in the table below</li>
</ul>
<h4>Academic Integrity</h4>
<p>All homeworks in this course are single-student homeworks. The work must be all your own. Do not copy any parts of any of the homeworks from anyone including the web. Do not look at other students' code, papers, or exams. Do not make any parts of your homework available to anyone, and make sure noone can read your files. The university policies on academic integrity will be applied rigorously.</p>
<p> We will be using the <a href="http://theory.stanford.edu/%7eaiken/moss/">Moss</a> system to detect software plagiarism. This system is amazingly good, because it understands the programming language in question (C, in our case).</p>
<p> It is not considered cheating to clarify vague points in the assignments or textbook, or to give help or receive help in using the computer systems, compilers, debuggers, profilers, or other facilities.</p>
<h2>Grading</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<ul>
<li><strong>40% research project</strong>
<ul>
<li>Topic: Very fast, ideally adaptive implementation of a numerical problem
<li>Team up in pairs
<li><strong><em>March 7:</em></strong> find a partner, find a problem or I give you one
(tip: look at the prior courses linked above for examples)<li>Show "milestones" during semester
<li>Write 4 page standard conference paper (template will be provided)
<li>Give short presentation end of semester
</ul>
<li><strong>20% midterm</strong>
<ul>
<li>Algorithm/implementation analysis
<li>Memory hierarchy
<li>other
</ul>
<li><strong>40% homework</strong>
<ul>
<li>Exercises on algorithms analysis
<li>Implementation exercises. Purpose: study the effect of program optimizations, compilers, special instructions, etc. Tasks: writing and submitting C code & creating runtime/performance plots
<li>Some templates will be provided
<li>All homeworks are single-student homeworks
</ul>
</ul>
<h4>There is no final Exam.</h4>
<p> </p>
<h2>Research Project</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<p class="redcolor"><strong><em>Deadline for code and paper: Friday, June 8th </em></strong></p>
<ul>
<li>How it works:
<ul>
<li><strong><em>Weeks without homeworks should be used to work on the project </em></strong>
<li>You select a numerical problem and create a correct (verified) implementation in C
<li>You determine the arithmetic cost, measure the runtime and performance<li>You profile the implementation to find the parts in which most the runtime spent
<li>Focussing on these you apply various optimization techniques from this class
<li>You repeat the previous steps to create various versions with (hopefully) continuously better runtime
<li>You write a paper about your work and give a presentation</ul>
<li>Paper:
<ul>
<li><strong>Maximal 6 pages (hard limit)</strong>, conference style, template and instructions below
<li>Everybody reads this: <a href="project/report.pdf">report.pdf</a>
<li>For latex use: <a href="project/report.zip">report.zip</a> (start with reading the README file)
<li>For Word (discouraged) use this: <a href="../263-2300-ETH-spring11/project/report-word.doc">report-word.doc </a>
</ul>
<li>Presentation
<ul>
<li>Last week of classes
(Wed and Fr lecture), each talk is 10 minutes<li>Template and guidelines (ppt is 2007 and later; the use is totally optional): <a href="../263-2300-ETH-spring11/project/presentation-template.pptx">presentation-template.pptx</a> , <a href="../263-2300-ETH-spring11/project/presentation-template.pdf">presentation-template.pdf</a>
<li>The order will be determined randomly right before class
<li>Who talks will be determined randomly right before class
</ul>
<li><strong>Projects (each one has a supervisor shown in brackets):</strong>
<ol>
<li>Marios P. & Amit B.: <strong><em>Optimizing KD-Tree build time for Ray-Tracing</em></strong><em></em> (DS & GO)</li>
<li>Anders M. & Jörn S.:<strong> <em>Fast multipole method</em></strong> (DS & GO)</li>
<li>Martin E. & Thomas B.: <strong><em>Shape from silhouettes</em></strong> (DS & GO)</li>
<li>Oleksiy S. & Mathias D.: <em><strong>Optimal binary search trees </strong></em>(MP)</li><li>Severin K. & Thomas A.:<strong> <em>k-means clustering</em></strong> (DS & GO)</li>
<li>Claudia K. & Changil K.: <em><strong>MLS surfaces from point clouds</strong></em><strong></strong> (DS & GO)</li>
<li>Mattis P.: <em><strong>Variant of LASSO in convex optimization </strong></em>(MP)</li>
<li>Raoul D. & Florian B.:<strong> <em>Lighting coefficients from environment maps</em></strong><em> </em>(MP)</li>
<li>Simon E.: <em><strong>Light graffiti</strong></em> (DS & GO)</li>
<li>Olga D. & Alec J.: <strong><em>Active set solver for quadratic programming</em></strong><em></em><em> </em>(MP)</li>
<li>Lukas B. & Danfeng Q.: <em><strong>Approximated Nearest Neighbor Search by Product Quantization</strong> </em>(MP)</li>
<li>Janosch N.: <em><strong>Jacobian Evaluations in Sparse Non-Linear Least Squares Solvers</strong></em><strong></strong><em> </em>(MP)</li>
<li>Raheem A. & Christian C.: <strong><em>Wavelet-based compression</em></strong><em> </em>(MP)</li>
</ol>
<li>One-on-one meetings, I:
May 2nd and 3rd
<li>One-on-one meetings, II: May 22nd and 23rd</ul>
<h2>Midterm</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<p>April 27th, 14:00 - 16:00. <a href="midterm/solution.pdf">Solution</a>.</p>
<h2>Homework</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0"></h2>
<ul>
<p><a href="homeworks/hw00.pdf">Homework 0</a>: due as soon as possible<br>
<a href="homeworks/hw01.pdf">Homework 1</a>: due March 8th, 17:00. <a href="homeworks/hw01_Solution.pdf">Solutions</a>.<br>
<a href="homeworks/hw02.pdf">Homework 2</a> <a href="homeworks/hw02files/prob2.tar.gz">(code prob2</a>, <a href="homeworks/hw02files/prob3.tar.gz">code prob3</a>): due March 15th, 17:00. <a href="homeworks/hw02_Solution.pdf">Solutions</a>.<br>
<a href="homeworks/hw03.pdf">Homework 3</a>: due March 22nd, 17:00. <a href="homeworks/hw03_Solution.pdf">Solutions</a>.<br>
<a href="homeworks/hw04.pdf">Homework 4 (start project)</a>: check point April 5th, 17:00.<br>
<a href="homeworks/hw05.pdf">Homework 5</a><a href="http://www.inf.ethz.ch/personal/markusp/teaching/263-2300-ETH-spring12/homeworks/hw05files/prob1.zip"> (code prob1)</a>: due April 5th, 17:00. <a href="homeworks/hw05_Solution.pdf">Solutions</a>.<br>
<a href="homeworks/hw06.pdf">Homework 6 (continue project)</a>: check point April 26th, 17:00.<br>
<a href="homeworks/hw07.pdf">Homework 7</a> (<a href="homeworks/hw07files/code.tgz">code</a>): due May
8th, 17:00. <a href="homeworks/hw07files/solution.tgz">Solutions.</a><br>
From now on: Work on project.
</p>
</ul>
<h2>Lectures (including pdfs)</h2>
<h2><img src="../../graphics/bluebar.gif" alt="" height="5" width="401" border="0">
</p>
</h2>
<table class="one" width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<th width="6%" scope="col"><div align="left">Lecture</div></th>
<th width="6%" scope="col"><div align="left">Date</div></th>
<th width="47%" scope="col"><div align="left">Content</div></th>
<th width="5%" scope="col"><div align="left">Slides</div></th>
<th width="5%" scope="col"><div align="left">Notes</div></th>
<th width="31%" scope="col"><div align="left">Other</div></th>
</tr>
<tr>
<td>1</td>
<td>20.02.</td>
<td>Course motivation, overview, organization</td>
<td><a href="slides/class01.pdf">link</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>2</td>
<td>22.02.</td>
<td>Problem, algorithm, asymptotic versus cost analysis</td>
<td><a href="slides/class02.pdf">link</a></td>
<td><a href="../263-2300-ETH-spring11/slides/notes02.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td>3</td>
<td>27.02.</td>
<td>Architecture/microarchitecture, Core 2/Core i7</td>
<td><a href="slides/class03.pdf">link</a></td>
<td><a href="slides/notes03.PDF">link</a></td>
<td><a href="slides/arch.pdf">Core 2/Core i7</a>, <a href="http://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-optimization-manual.pdf">Intel processor info</a></td>
</tr>
<tr>
<td>4</td>
<td>29.02.</td>
<td>Optimizing for instruction level parallelism (ILP)</td>
<td><a href="slides/class04.pdf">link</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>5</td>
<td>05.03.</td>
<td>Benchmarking, compiler limitations</td>
<td><a href="slides/class05.pdf">link</a></td>
<td> </td>
<td><a href="slides/benchmarking.pdf">Benchmarking</a></td>
</tr>
<tr>
<td>6</td>
<td>07.03.</td>
<td>Locality, operational intensity, memory/compute bound</td>
<td><a href="slides/class06.pdf">link</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>7</td>
<td>12.03.</td>
<td>Caches</td>
<td><a href="slides/class07.pdf">link</a></td>
<td><a href="slides/notes07.pdf">link</a></td>
<td> </td>
</tr>
<tr>
<td>8</td>
<td>14.03.</td>
<td>Caches continued, roofline model, memory/compute bound</td>
<td><a href="slides/class08.pdf">link</a></td>
<td><a href="slides/notes08.PDF">link</a></td>
<td><a href="http://dl.acm.org/citation.cfm?id=1498785">Roofline paper</a></td>
</tr>
<tr>
<td>9</td>
<td>19.03</td>
<td>Roofline continued, linear algebra, BLAS, ATLAS: optimizing MMM</td>
<td><a href="slides/class09.pdf">link</a></td>
<td><a href="slides/notes09.pdf">link</a></td>
<td><a href="http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1386657&userType=inst">Model-based ATLAS paper</a></td>
</tr>
<tr>
<td>10</td>
<td>21.03.</td>
<td>Optimizing MMM continued</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>11</td>
<td>26.03.</td>
<td>Optimizing MMM continued, dependencies, register renaming</td>
<td><a href="slides/class11.pdf">link</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>12</td>
<td>28.03</td>
<td>Optimization related to virtual memory, TLBs</td>
<td> </td>
<td><a href="slides/notes12.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td>13</td>
<td>02.04.</td>
<td>Memory bound computation, sparse linear algebra, sparse MVM, OSKI</td>
<td><a href="slides/class13.pdf">link</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>14</td>
<td>04.04.</td>
<td>Sparse MVM, OSKI continued, other optimization ideas</td>
<td> </td>
<td><a href="../263-2300-ETH-spring11/slides/notes16.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td>15</td>
<td>18.04.</td>
<td>SIMD vector extensions, SSE</td>
<td><a href="slides/class15.pdf">link</a></td>
<td> </td>
<td><a href="http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/cpp/lin/index.htm">icc manual</a>, <a href="http://msdn.microsoft.com/de-de/library/26td21ds.aspx">Visual Studio manual</a></td>
</tr>
<tr>
<td>16</td>
<td>20.04.</td>
<td>SSE continued</td>
<td> </td>
<td><a href="../263-2300-ETH-spring11/slides/notes18.PDF"></a></td>
<td> </td>
</tr>
<tr>
<td>17</td>
<td>23.04.</td>
<td>SSE continued, compiler vectorization</td>
<td> </td>
<td><a href="../263-2300-ETH-spring11/slides/notes18.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>27.04.</td>
<td><strong><em>Midterm Exam</em></strong></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>18</td>
<td>30.04.</td>
<td>Linear transform and fast algorithms, DFT and FFT</td>
<td><a href="slides/class18.pdf">link</a></td>
<td><a href="slides/notes18.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>02./03.05</td>
<td><strong><em>One-on-one meetings</em></strong></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>19</td>
<td>07.05.</td>
<td>Cooley-Tukey FFT, DFT complexity</td>
<td><a href="slides/class19.pdf">link</a></td>
<td><a href="../263-2300-ETH-spring11/slides/notes20.PDF">link</a></td>
<td> </td>
</tr>
<tr>
<td>20</td>
<td>14.05.</td>
<td>Adaptive library FFTW, FFTW codelet generator</td>
<td><a href="slides/class20.pdf">link</a></td>
<td><a href="../263-2300-ETH-spring11/slides/notes21.PDF">link</a></td>
<td><a href="www.fftw.org">FFTW website</a></td>
</tr>
<tr>
<td>21</td>
<td>21.05.</td>
<td>Spiral: Program synthesis for linear transforms</td>
<td><a href="slides/class21-spiral.pdf">link</a></td>
<td> </td>
<td><a href="www.spiral.net">Spiral website</a>, <a href="http://spiral.ece.cmu.edu:8080/pub-spiral/abstract.jsp?id=146">Spiral intro</a></td>
</tr>
<tr>
<td> </td>
<td>22./23.05.</td>
<td><strong><em>One-on-one meetings</em></strong></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>30.05.</td>
<td>Project presentations</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>01.06.</td>
<td>Project presentations</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr valign="top" height="100%">
<td class="padded" align="right" bgcolor="#000066" height="100%"> </td>
<td class="padded" height="100%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>