scalable silicon compute - github pages...scalable silicon compute nips 2017 workshop on deep...

22
1 NIPS 2017 [email protected] Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale

Upload: others

Post on 12-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

1NIPS 2017 [email protected]

Scalable Silicon ComputeNIPS 2017 Workshop on Deep Learning at Supercomputer Scale

Page 2: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

2NIPS 2017

Our comprehension and mechanization of intelligence is nascent• best models and algorithms change every year• increasingly heterogeneous composition of models• huge appetite for more compute throughput

At least until we understand intelligence better, we need machines which...• exploit massive parallelism• are agnostic to model structure• have a simple programming abstraction• are efficient for both learning and inference

Page 3: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

3NIPS 2017ResNet-50

training batch=4

Graphs can represent arbitrary model structure and expose compute parallelism.

We need to expose a lot of parallelism...O(1000) work items/processor

x O(1000) processors/chipx O(1000) chips/system

In a parallel computer, communication is part of the computation. It’s attractive to compile “communication kernels”, as well as compute kernels.

Page 4: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

4NIPS 2017

smaller larger

Types of Parallelism

• kernel partitioning• pipelining• parallel paths• model clones sharing parameters, different data• model clones with different parameters/cost functions/hyper-params, shared data• multiple models of different structure• ...

Page 5: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

5NIPS 2017

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

0.001 0.1 10 10000%

50%

100%

150%

200%

250%

0.01 0.1 1 10 100

MatMul Gflop Convolution Gflop

float32(>100% by transforms)

float16.32(tensor cores)

float32

float16.32(tensor cores)

Volta V100 fmac utilization on DeepBenchhttps://github.com/baidu-research/DeepBench

half of test cases

half of test cases

Kernel partitioning exhausted?

Page 6: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

6NIPS 2017

Gflop in layer

Layer count (sorted)

Inception-v4

ResNet-50

Page 7: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

7NIPS 2017

Challenges for the Age of Parallel Processors

• Power• Memory• Abstraction

As parallelism goes up, local resources per processor go down.

Page 8: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

8NIPS 2017

Post-Dennard Silicon Scaling

• Transistors / chip ~30% / year• Compute / Watt ~15% / year

65nWoodcrest X5160 2cConroe X3085 2c

45nLynnfield X3470 4cNehalem X7550 8c

32nWestmere E7-8870 10cSandyBridge E5-2690 8c

22nIvyBridge E7-2890v2 15cHaswell E7-8890v3 18c

14nBroadwell E7-8894v4 24cSkylake 8180P 28c

65n 45n 32n 22n 14n

~2.5 years/node

SRAM bitcells/um2

logic T/um2

(10.mmp.cpp/T)

core cycles/Joule

Big Xeon exemplars:

~ √2x per node

~ 2x per nodelog

Page 9: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

9NIPS 2017

Silicon efficiency is the full use of available power

• Keep data local• Serialise communication and compute• Re-compute what you can’t remember

Proximity of memory is defined by energy, more than latency.

Page 10: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

10NIPS 2017

0.8pJ/flop 0.25mm2

256kB fast memory

0.8pJ/B 0.33mm2

200Gflop16.32/s processor

eg. 4 flop/B=> 0.2pJ/flop

(rough metrics for 16nm)

Page 11: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

11NIPS 2017

All logic chips are power limited

Largest manufacturable die ~825mm2

500Tflop16.32

500WNOK

250Tflop16.32

225MB250W

125Tflop16.32

337MB125W

Page 12: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

12NIPS 2017

16GB @ 900GB/s 600MB @ 90TB/s

DRAM on interposer180W GPU + 60W HBM2

Processor + memory systems @ 240W (for 300W card)

Distributed SRAM on chip120W IPU x2

Page 13: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

13NIPS 2017

“Colossus” IPU(in honour of Tommy Flowers)

• All-new pure distributed multi-processor for MI.• Mostly memory, for “model on chip”.• A cluster of IPUs acts like a bigger IPU.• Bulk Synchronous Parallel (BSP) execution.• Stepwise-compiled deterministic communication.• Programmed using standard frameworks (TensorFlow, ...)

over Poplar™ native graph abstraction.

Page 14: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

14NIPS 2017

2432 processor tiles >200Tflop ~600MB

host I/OPCIe-4

all-to-all exchange spines each ~8TBpslink + host bandwidth 384GBps/chip

card-to-cardlinks

card-to-cardlinks

host I/OPCIe-4

card-to-cardlinks

card-to-cardlinks

Colossus pair on a PCIe card

Page 15: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

15NIPS 2017

host

I/O

host

I/O

inter-chip sync

sync

sync

sync

sync

sync

sync (1 tile abstains)

inter-chip sync

Bulk Synchronous Parallel

chip.1

chip.2

compute phase

exchange phase

Massive parallelism with no concurrency hazards

Communication patterns are compiled, but dynamically selected.

Page 16: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

16NIPS 2017

BSP Execution Trace

COMPUTE EXCHANGE WAITINGFORSYNC SYNC

time

tiles(sorted)

superstep

when some Tiles are quiet, clock can increase

Page 17: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

17NIPS 2017

BSP Trace: ResNet-50 training, batch=4

COMPUTE EXCHANGE WAITINGFORSYNC SYNC

Page 18: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

18NIPS 2017

Managing Memory

IPU has smaller memory than GPU, but greater effective compute:• Use small batches per IPU.• Trade compute for memory.• Use memory-efficient algorithms/models

An efficient gradient learner will converge in a minimum number of parameter updates ...so smaller batches should learn faster, as well as generalizing better.Efficient small batch machines allow learning to parallelise over more machines.

Page 19: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

19NIPS 2017

Re-compute what you can’t remember

DenseNet-201 training, batch=16.

Naive strategy: memorize activations only at input of each residue block, recompute all others in backward pass. ~1/5 memory

~1.25x compute

MiBallocated

Time (#allocations normalised)

TensorFlow

less greedy

recomputedExecuting on CPU, recording total memory allocated for weights + activations. Float16 weights and activations, single weight copy.

Page 20: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

20NIPS 2017

Reversible Nets

F G

F G

2 sets of activations, layer N

2 sets of activations, layer N+1

2 sets of activations, layer N

2 sets of activations, layer N+1

No need to save any activations, except for layers which lose information (pool, stride).

arxiv.org/abs/1707.04585

Page 21: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

21NIPS 2017

Some preliminary IPU benchmarks...

• ResNet-50 training at 2,250 images/s on 1 card with batch=816,000 image/s over 8 cards with batch=64

• DeepBench LSTM inference (per layer, 1536 hidden units, 50 steps)60,000 iteration/s on 1 card at 7ms latency

• 600 full WaveNet voice generators on 1 card at 16k sample/s(MOS 3.35, 20 layers, 64 residual channels, 128 skip channels)

More at www.graphcore.ai

Page 22: Scalable Silicon Compute - GitHub Pages...Scalable Silicon Compute NIPS 2017 Workshop on Deep Learning at Supercomputer Scale NIPS 2017 2 Our comprehension and mechanization of intelligence

22NIPS 2017

Thank [email protected]