Docsity

PyMTL and Pydgin: Python Frameworks for Highly Productive ..., Lecture notes of Computer Networks

Partial preview of the text

Download PyMTL and Pydgin: Python Frameworks for Highly Productive ... and more Lecture notes Computer Networks in PDF only on Docsity!

PyMTL and Pydgin: Python Frameworks for

Highly Productive Computer Architecture

Research

Christopher Batten

Computer Systems Laboratory

School of Electrical and Computer Engineering

Cornell University

Spring 2016

- Research Overview • PyMTL Framework Pydgin Framework PyMTL/Pydgin in Practice

Motivating Trends in Computer Architecture

Transistors (Thousands)

Frequency (MHz)

Typical Power (W)

MIPS R2K

Intel P DEC Alpha 21264

Data collected by M. Horowitz, F. Labonte, O. Shacham, K. Olukotun, L. Hammond, C. Batten

1975 1980 1985 1990 1995 2000 2005 2010 2015

10

0

10 1

10

2

10

3

10 4

10

5

10

6

SPECint Performance

10 7

Number of Cores

Intel 48-Core Prototype AMD 4-Core Opteron

Data-Parallelism via GPGPUs and Vector

Hardware Specialization

Fine-Grain Task- Level Parallelism Instruction Set Specialization Subgraph Specialization Application-Specific Accelerators Domain-Specific Accelerators Coarse-Grain Reconfig Arrays Field-Programmable Gate Arrays

- Research Overview • PyMTL Framework Pydgin Framework PyMTL/Pydgin in Practice

Vertically Integrated Research Methodology

Our research involves reconsidering all aspects of the computing stack
including applications, programming frameworks, compiler optimizations,
runtime systems, instruction set design, microarchitecture design, VLSI
implementation, and hardware design methodologies

Cross Compiler

Functional Simulator

Binary

Applications

Functional-Level Model

Cycle-Level Simulator

Cycle-Level Model

Layout

Register-Transfer-Level Model

RTL Simulator

Gate-Level Model

Gate-Level Simulator

Switching Activity

Power Analysis

Synthesis Place&Route

Key Metrics: Cycle Count, Cycle Time, Area, Energy

Experimenting with full-chip
layout, FPGA prototypes, and
test chips is a key part of our
research methodology

- Research Overview • PyMTL Framework Pydgin Framework PyMTL/Pydgin in Practice

Projects Within the Batten Research Group

PL

ISA

uArch

RTL

VLSI

Circuits

Tech

Compiler

Apps

Algos

GPGPU Architecture [ISCA'13] (AFOSR)

[MICRO'14a]

Integrated Voltage Regulation [MICRO'14b] [ISCA'16]

XLOOPS Explicit Loop Specialization [MICRO'14c] (DARPA,NSF)

Polymorphic Hardware Specialization

(NSF)

[DAC'16]

Accelerating Dynamic Prog Langs (NSF)

PyMTL/Pydgin Frameworks [MICRO'14d]

(NSF)

[ISPASS'16]

[ISPASS'15]

PyMTL/Pydgin Frameworks [MICRO'14d]

(NSF)

[ISPASS'16]

[ISPASS'15]

Computer Architecture Research Methodologies

Applications
Transistors
Algorithms
Compilers
Instruction Set Architecture
Microarchitecture
VLSI
Cycle-Level Modeling
  • Behavior
  • Cycle-Approximate
  • Analytical Area, Energy, Timing
Functional-Level Modeling
  • Behavior
Register-Transfer-Level Modeling
  • Behavior
  • Cycle-Accurate Timing
  • Gate-Level Area, Energy, Timing

Computer Architecture Research Methodologies

Cycle-Level Modeling
Functional-Level Modeling
Register-Transfer-Level Modeling
  • Algorithm/ISA Development
  • MATLAB/Python, C++ ISA Sim
  • Design-Space Exploration
  • C++ Simulation Framework
  • gem5, SESC, McPAT
  • Prototyping & AET Validation
  • Verilog, VHDL Languages
  • HW-Focused Concurrent Structural
  • SW-Focused Object-Oriented
  • EDA Toolflow
Computer Architecture
Research Methodology Gap
FL, CL, RTL modeling
use very different
languages, patterns,
tools, and methodologies
Our Approch:
Modeling Towards Layout
Unified Python-based
framework for
FL, CL, and RTL modeling

Great Ideas From Prior Work

Great(Ideas(From(Prior(Work(

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research' 10'/'100''

  • ConcurrentVStructural'Modeling '
(Liberty,'Cascade,'SystemC)!
  • Unified'Modeling'Languages'
(SystemC)'
  • Hardware'Genera8on'Languages'
(Chisel,'Genesis2,'BlueSpec,'MyHDL)'
  • HDLVIntegrated'Simula8on'Frameworks'
(Cascade)!
  • LatencyVInsensi8ve'Interfaces'
(Liberty,'BlueSpec) '

Consistent'interfaces'across'abstracGons' ' ' Unified'design'environment'for'FL,'CL,'RTL' ' ' ProducGve'RTL'design'space'exploraGon' ' ' ProducGve'RTL'validaGon'and'cosimulaGon' ' ' Component'and'test'bench'reuse'

What is PyMTL?

What(is(PyMTL?(

12'/'39'

'

  • A'Python'DSEL'for'concurrentFstructural'hardware'modeling'
  • A'Python'API'for'analyzing'models'described'in'the'PyMTL'DSEL'
  • A'Python'tool'for'simulaGng'PyMTL'FL,'CL,'and'RTL'models'
  • A'Python'tool'for'translaGng'PyMTL'RTL'models'into'Verilog'
  • A'Python'tesGng'framework'for'model'validaGon'

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

API'

SimulaGon' Tool'

TranslaGon' Tool'

Model'DSEL'

TesGng'Framework'

What Does PyMTL Enable?

What(Does(PyMTL(Enable?(

15'/'39'

  • Incremental'refinement'from'algorithm'to'accelerator'implementaGon'
  • Automated'tesGng'and'integraGon'of'PyMTLFgenerated'Verilog'
  • MulGFlevel'coFsimulaGon'of'FL,'CL,'and'RTL'models'

FL' Model'

CL' Model'

RTL' Model'

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

What Does PyMTL Enable?

What(Does(PyMTL(Enable?(

16'/'39'

  • Incremental'refinement'from'algorithm'to'accelerator'implementaGon'
  • Automated'tesGng'and'integraGon'of'PyMTLFgenerated'Verilog'
  • MulGFlevel'coFsimulaGon'of'FL,'CL,'and'RTL'models'
  • ConstrucGon'of'highlyFparameterized'RTL'chip'generators'

Verilog' RTL' Model'

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

The PyMTL DSEL: FL Models

The(PyMTL(DSEL(

21'/'39'

def sorter_network( input ):!

return sorted( input )!

!

class SorterNetworkFL( Model )!

def init( s, nbits, nports ):! !

s.in_ = InPort nports! s.out = OutPortnports!

!

!

@s.tick_fl! def logic():! for i, v in enumerate( sorted( s.in_ ) ):! s.out[i].next = v'

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

f(x)'

['3,'1,'2,'0']' (^) f(x)' ['0,'1,'2,'3']'

The PyMTL DSEL: CL Models

The(PyMTL(DSEL(

22'/'39'

def sorter_network( input ):!

return sorted( input )!

!

class SorterNetworkCL( Model )!

def init( s, nbits, nports, delay=3 ):! !

s.in_ = InPort nports! s.out = OutPortnports! s.pipe = Pipeline( delay )!

!

@s.tick_cl! def logic():! s.pipe.xtick()! s.pipe.push( sorted( s.in_ ) )!

!

if s.pipe.ready():! for i, v in enumerate( s.pipe.pop() ):! s.out[i].next = v! !

'

PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

f(x)'

['3,'1,'2,'0']' (^) f(x)' ['0,'1,'2,'3']'

The PyMTL DSEL: RTL Models

The(PyMTL(DSEL(

24'/'39'

class MinMaxRTL( Model )!

def init( s, nbits ):! s.in_ = InPort 2! s.out = OutPort2! @s.combinational! def logic():! swap = s.in_[0] > s.in_[1]! s.out[0].value = s.in[1] if swap else s.in[0]! s.out[1].value = s.in[0] if swap else s.in[1]!

!

class RegRTL( Model )! def init( s, nbits ):! s.in_ = InPort (nbits)! s.out = OutPort(nbits)! @s.tick_rtl! def logic():! s.out.next = s.in_! ' PyMTL:'A'Unified'Framework'for'Ver8cally'Integrated' Computer'Architecture'Research'

Performance/Productivity Gap

Python is growing in popularity in many domains of scientific and

high-performance computing. How do they close this gap?

I (^) Python-Wrapped C/C++ Libraries

(NumPy, CVXOPT, NLPy, pythonoCC, gem5)

I (^) Numerical Just-In-Time Compilers

(Numba, Parakeet)

I (^) Just-In-Time Compiled Interpreters

(PyPy, Pyston)

I (^) Selective Embedded Just-In-Time Specialization

(SEJITS)