Be Beyond Poly
- lyhedral Analysis of
- f OpenStream Programs
Nun uno Mi Migu guel l Nob
- bre nunomiguel.nobre@manchester.ac.uk
Join
- int work
- rk wi
Be Beyond Poly olyhedral Analysis of of OpenStream Programs Nun - - PowerPoint PPT Presentation
Be Beyond Poly olyhedral Analysis of of OpenStream Programs Nun uno Mi Migu guel l Nob obre nunomiguel.nobre@manchester.ac.uk Join oint work ork wi with: Andi Drebes, Graham Riley and Antoniu Pop IMPACT 2019: January 23, 2019 |
2 / 15
▪ Hide latency
▪ Task, data and pipeline
2 / 15
▪ Hide latency
▪ Task, data and pipeline
▪ Challenging dependency specification ▪ Hard debugging ▪ What’s the right granularity?
2 / 15
▪ Hide latency
▪ Task, data and pipeline
▪ Challenging dependency specification ▪ Hard debugging ▪ What’s the right granularity?
3 / 15
4 / 15
5 / 15
c1 p1 p2 task task task … … ? ? ? ? stream
5 / 15
c1 p1 p2 task task task … … ? ? ? ? stream
5 / 15
c1 p1 p2 task task task … … ? ? ? a stream
5 / 15
c1 p1 p2 task task task … … a b c d stream
5 / 15
c1 p1 p2 task task task … … a b c d stream c2 task
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
6 / 15
for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) phi[j] = (phi[j - 1] + phi[j + 1]) / 2;
stream_array S[N]; for (i = 0; i < I; ++i) for (j = 1; j < N - 1; ++j) task { read once from S[j]; // phi[j] (discarded) peek once from S[j - 1]; // phi[j - 1] peek once from S[j + 1]; // phi[j + 1] write once into S[j]; // phi[j] // work function: // phi[j] = (phi[j - 1] + phi[j + 1]) / 2; }
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector j i
1/ 2
+
1/ 2
7 / 15
Loop tile/ Pluto-tiled task Flow dependence distance vector between tiles Loop iteration/ fine-grained task j i
7 / 15
Loop tile/ Pluto-tiled task Flow dependence distance vector between tiles Loop iteration/ fine-grained task j i
Spatially tiled task Flow dependence distance vector between tiles Loop iteration/ fine-grained task j i
8 / 15
9 / 15
j k i
Previous iteration Current iteration Current grid point Not yet computed Flow dependence distance vector
10 / 15
j k i
10 / 15
j k i
j k i
11 / 15
12 / 15
▪ e.g. parametric tiling
12 / 15
▪ e.g. parametric tiling
▪
Albert Cohen, Alain Darte, and Paul Feautrier. 2016. Static Analysis of OpenStream Programs
12 / 15
▪ e.g. parametric tiling
▪
Albert Cohen, Alain Darte, and Paul Feautrier. 2016. Static Analysis of OpenStream Programs
▪
Paul Feautrier and Albert Cohen. 2018. On Polynomial Code Generation
13 / 15
c1 p1 p2 task task task … … a b c d stream p1 c1 p2
13 / 15
c1 p1 p2 task task task … … a b c d stream p1 c1 p2
p1 c1 p2
13 / 15
c1 p1 p2 task task task … … a b c d stream p1 c1 p2
p1 c1 p2
14 / 15
t1 t3 t2 t1 t0 t2
14 / 15
t1 t3 t2 t1 t0 t2 t1 t0 + t3 t2
14 / 15
t1 t3 t2 t1 t0 t2 t1 t0 + t3 t2
t3 t0 t1 + t2
14 / 15
t1 t3 t2 t1 t0 t2 t1 t0 + t3 t2
t3 t0 t1 + t2
15 / 15