pycomparch: python-based modules for exploring computer ...summary and future plans ! new...

29
PyCompArch: Python-Based Modules for Exploring Computer Architecture Concepts Dan Connors, Kyle Dunn, Ryan Bueter Department of Electrical Engineering University of Colorado Denver Workshop on Computer Architecture Education 2015

Upload: others

Post on 06-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

PyCompArch: Python-Based Modules for Exploring Computer Architecture

Concepts

Dan Connors, Kyle Dunn, Ryan Bueter Department of Electrical Engineering

University of Colorado Denver

Workshop on Computer Architecture Education 2015

Page 2: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Overview

Ø Motivation Ø IPython Notebook Ø PyCompArch Concept Notebooks Ø Multiprocessing: Mandelbrot, Amdahl’s, Speedup,

and Efficiency Ø ParallelSchedule: Job Scheduling Ø Synthetic Speedup: Interactive Ø PyCompArch Concept Notebooks Ø Dynamic frequency scaling Ø Computer Vision (CV) Ø Code Box

Page 3: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Motivation

Ø Visualization of concepts of parallelism Ø Explore concepts from learner’s perspective versus

single static graph of parameters Ø Explore/perform experiments on hands-on devices Ø Raspberry PI Ø Streamline collection, comparison, and visualization

Page 4: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

IPython Notebook Overview Ø  The IPython Notebook is a

web-based interactive computational environment

Ø  A well-structured code development environment

Ø  A framework for observing and recording and results of code execution

Ø  Linking text such as comments, equation generators for mathematics

Ø  Embedded plots and other rich media formatting options

Ø  The cloud coding advantage is that the IPython Notebook Viewer renders the code as a web page and users can read and interact with a remote system without having to install anything on their device.

Ø  Changes can be rolled back also, encouraging experimentation without creating excessive copies of source material

At Scale Learning – MOOC

Page 5: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Example: Jupyter (www.jupyter.org) 5

Page 6: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

PyCompArch

Matplotlib

Visualization

Raspberry Pi Explore

Collect Results

DVFS

Concepts Explore

Code Box

Parallel

Amdahl’s Law

Parameters

Page 7: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Python

Ø IPython Notebooks Ø Interactive lectures Ø Code and see: embed visualization of parallel

performance trade-offs Ø Assignment template

Ø Related work: ISCA 2015 Workshop PyMTL and Pydgin Tutorial: Python Frameworks for Highly Productive Computer Architecture Research Ø PyMTL is a hardware modeling framework Ø Pydgin is a framework for rapidly developing

instruction-set simulators (ISSs) from a Python-based architecture description language.

Page 8: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

IPython

Ø Computer Architecture Concepts - Python Parallelism Ø Multithreading and multiprocessing support Ø Speedup and efficiency Ø Amdahl’s law Ø Overhead

Ø Explore Experiments Ø Benchmarking (Example: OpenCV) Ø Collecting, displaying, and comparing results Ø Dynamic frequency scaling on Raspberry Pi

Page 9: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Mandelbrot Calculation : Block Size

Ø Overhead of work assignment

Page 10: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Parallelism – Python’s Multiprocessing Module

Page 11: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Speedup and Efficiency

Page 12: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Base Graph

Page 13: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Parallelism Exploration

Slider control in IPython figure

Page 14: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Parallel Exploration

Ø Serial fraction

Ø Overhead

Page 15: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Execution Time

Page 16: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Speedup

Page 17: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Efficiency

Page 18: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Amdahl Law’s Evaluation

Page 19: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Amdahl Law’s Evaluation

Page 20: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Single Job Timeline

Page 21: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Parallel Job Scheduling Timeline (8 cores)

Page 22: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Worker Workload Summary

Page 23: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Computer Architecture Education and Raspberry PI

Ø http://www.raspberrypi.org Ø Center piece of course

Page 24: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Raspberry PI Stats

Ø  $35 is inexpensive…must be a toy?

Ø  “It’s just a slightly under-powered computer without a screen, and anything you can do on it you could do on a laptop”

Ø  True, but also: Ø Students can’t destroy the

systems with software. Ø  It changes mindsets because

the systems are easily accessible.

Ø What about Arduino? Ø Similar aims, but Raspberry Pi

runs Linux- full operating system, is a modern 32-bit ARM processor

Page 25: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

OpenCV Algorithm Evaluation on Raspberry Pi 25

Ø  Evaluate selected set of various OpenCV functions Ø  rotate, convolution, sobel, median blur, resize, histogram, erosion, etc Ø  Benchmark various image file sizes: 720x480 1280x720 1920x1080

3840x2160

Page 26: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Raspberry Pi- DFS (Dynamic Frequency Scaling)

Page 27: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Code Box Ø Code compiled

Page 28: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Code Box Ø Execution

time observed

Page 29: PyCompArch: Python-Based Modules for Exploring Computer ...Summary and Future Plans ! New opportunities for exploring concepts related to computer architecture ! Theoretical concepts

Summary and Future Plans

Ø  New opportunities for exploring concepts related to computer architecture Ø  Theoretical concepts – Amdahl’s law Ø  Evaluation of Python multiprocessing module for parallelism Ø  Code Box – Evaluation of performance of small code examples Ø  Sharing content between developers [github]

Ø  Raspberry Pi support Ø  Enhance development of projects and independent learning by

having set functions for gathering performance results Ø  Dynamic frequency scaling Ø  OpenCV evaluation

Ø  Future work: Python-based Numba generates optimized machine code using the LLVM compiler infrastructure at import time, runtime, or statically (using the included pycc tool). Ø  Numba supports compilation of Python to run on either CPU or

GPU hardware.