[pypy-svn] r70147 - in pypy/extradoc/talk/jitdec09: . ui

pedronis at codespeak.net pedronis at codespeak.net
Wed Dec 16 14:22:44 CET 2009


Author: pedronis
Date: Wed Dec 16 14:22:43 2009
New Revision: 70147

Added:
   pypy/extradoc/talk/jitdec09/
   pypy/extradoc/talk/jitdec09/result.png   (contents, props changed)
   pypy/extradoc/talk/jitdec09/talk.html
   pypy/extradoc/talk/jitdec09/talk.txt   (contents, props changed)
   pypy/extradoc/talk/jitdec09/ui/   (props changed)
      - copied from r70142, pypy/extradoc/talk/roadshow-ibm/ui/
Log:
brief jit and jit status talk



Added: pypy/extradoc/talk/jitdec09/result.png
==============================================================================
Binary file. No diff available.

Added: pypy/extradoc/talk/jitdec09/talk.html
==============================================================================
--- (empty file)
+++ pypy/extradoc/talk/jitdec09/talk.html	Wed Dec 16 14:22:43 2009
@@ -0,0 +1,414 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
+<meta name="version" content="S5 1.1" />
+<title>A generated JIT compiler for Python</title>
+<meta name="author" content="Samuele Pedroni, Open End AB" />
+<meta name="date" content="December '09" />
+<style type="text/css">
+
+/*
+:Author: David Goodger (goodger at python.org)
+:Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
+:Copyright: This stylesheet has been placed in the public domain.
+
+Default cascading style sheet for the HTML output of Docutils.
+
+See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
+customize this style sheet.
+*/
+
+/* used to remove borders from tables and images */
+.borderless, table.borderless td, table.borderless th {
+  border: 0 }
+
+table.borderless td, table.borderless th {
+  /* Override padding for "table.docutils td" with "! important".
+     The right padding separates the table cells. */
+  padding: 0 0.5em 0 0 ! important }
+
+.first {
+  /* Override more specific margin styles with "! important". */
+  margin-top: 0 ! important }
+
+.last, .with-subtitle {
+  margin-bottom: 0 ! important }
+
+.hidden {
+  display: none }
+
+a.toc-backref {
+  text-decoration: none ;
+  color: black }
+
+blockquote.epigraph {
+  margin: 2em 5em ; }
+
+dl.docutils dd {
+  margin-bottom: 0.5em }
+
+/* Uncomment (and remove this text!) to get bold-faced definition list terms
+dl.docutils dt {
+  font-weight: bold }
+*/
+
+div.abstract {
+  margin: 2em 5em }
+
+div.abstract p.topic-title {
+  font-weight: bold ;
+  text-align: center }
+
+div.admonition, div.attention, div.caution, div.danger, div.error,
+div.hint, div.important, div.note, div.tip, div.warning {
+  margin: 2em ;
+  border: medium outset ;
+  padding: 1em }
+
+div.admonition p.admonition-title, div.hint p.admonition-title,
+div.important p.admonition-title, div.note p.admonition-title,
+div.tip p.admonition-title {
+  font-weight: bold ;
+  font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+  color: red ;
+  font-weight: bold ;
+  font-family: sans-serif }
+
+/* Uncomment (and remove this text!) to get reduced vertical space in
+   compound paragraphs.
+div.compound .compound-first, div.compound .compound-middle {
+  margin-bottom: 0.5em }
+
+div.compound .compound-last, div.compound .compound-middle {
+  margin-top: 0.5em }
+*/
+
+div.dedication {
+  margin: 2em 5em ;
+  text-align: center ;
+  font-style: italic }
+
+div.dedication p.topic-title {
+  font-weight: bold ;
+  font-style: normal }
+
+div.figure {
+  margin-left: 2em ;
+  margin-right: 2em }
+
+div.footer, div.header {
+  clear: both;
+  font-size: smaller }
+
+div.line-block {
+  display: block ;
+  margin-top: 1em ;
+  margin-bottom: 1em }
+
+div.line-block div.line-block {
+  margin-top: 0 ;
+  margin-bottom: 0 ;
+  margin-left: 1.5em }
+
+div.sidebar {
+  margin: 0 0 0.5em 1em ;
+  border: medium outset ;
+  padding: 1em ;
+  background-color: #ffffee ;
+  width: 40% ;
+  float: right ;
+  clear: right }
+
+div.sidebar p.rubric {
+  font-family: sans-serif ;
+  font-size: medium }
+
+div.system-messages {
+  margin: 5em }
+
+div.system-messages h1 {
+  color: red }
+
+div.system-message {
+  border: medium outset ;
+  padding: 1em }
+
+div.system-message p.system-message-title {
+  color: red ;
+  font-weight: bold }
+
+div.topic {
+  margin: 2em }
+
+h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
+h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
+  margin-top: 0.4em }
+
+h1.title {
+  text-align: center }
+
+h2.subtitle {
+  text-align: center }
+
+hr.docutils {
+  width: 75% }
+
+img.align-left {
+  clear: left }
+
+img.align-right {
+  clear: right }
+
+ol.simple, ul.simple {
+  margin-bottom: 1em }
+
+ol.arabic {
+  list-style: decimal }
+
+ol.loweralpha {
+  list-style: lower-alpha }
+
+ol.upperalpha {
+  list-style: upper-alpha }
+
+ol.lowerroman {
+  list-style: lower-roman }
+
+ol.upperroman {
+  list-style: upper-roman }
+
+p.attribution {
+  text-align: right ;
+  margin-left: 50% }
+
+p.caption {
+  font-style: italic }
+
+p.credits {
+  font-style: italic ;
+  font-size: smaller }
+
+p.label {
+  white-space: nowrap }
+
+p.rubric {
+  font-weight: bold ;
+  font-size: larger ;
+  color: maroon ;
+  text-align: center }
+
+p.sidebar-title {
+  font-family: sans-serif ;
+  font-weight: bold ;
+  font-size: larger }
+
+p.sidebar-subtitle {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+p.topic-title {
+  font-weight: bold }
+
+pre.address {
+  margin-bottom: 0 ;
+  margin-top: 0 ;
+  font-family: serif ;
+  font-size: 100% }
+
+pre.literal-block, pre.doctest-block {
+  margin-left: 2em ;
+  margin-right: 2em }
+
+span.classifier {
+  font-family: sans-serif ;
+  font-style: oblique }
+
+span.classifier-delimiter {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+span.interpreted {
+  font-family: sans-serif }
+
+span.option {
+  white-space: nowrap }
+
+span.pre {
+  white-space: pre }
+
+span.problematic {
+  color: red }
+
+span.section-subtitle {
+  /* font-size relative to parent (h1..h6 element) */
+  font-size: 80% }
+
+table.citation {
+  border-left: solid 1px gray;
+  margin-left: 1px }
+
+table.docinfo {
+  margin: 2em 4em }
+
+table.docutils {
+  margin-top: 0.5em ;
+  margin-bottom: 0.5em }
+
+table.footnote {
+  border-left: solid 1px black;
+  margin-left: 1px }
+
+table.docutils td, table.docutils th,
+table.docinfo td, table.docinfo th {
+  padding-left: 0.5em ;
+  padding-right: 0.5em ;
+  vertical-align: top }
+
+table.docutils th.field-name, table.docinfo th.docinfo-name {
+  font-weight: bold ;
+  text-align: left ;
+  white-space: nowrap ;
+  padding-left: 0 }
+
+h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
+h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
+  font-size: 100% }
+
+ul.auto-toc {
+  list-style-type: none }
+
+</style>
+<!-- configuration parameters -->
+<meta name="defaultView" content="slideshow" />
+<meta name="controlVis" content="hidden" />
+<!-- style sheet links -->
+<script src="ui/default/slides.js" type="text/javascript"></script>
+<link rel="stylesheet" href="ui/default/slides.css"
+      type="text/css" media="projection" id="slideProj" />
+<link rel="stylesheet" href="ui/default/outline.css"
+      type="text/css" media="screen" id="outlineStyle" />
+<link rel="stylesheet" href="ui/default/print.css"
+      type="text/css" media="print" id="slidePrint" />
+<link rel="stylesheet" href="ui/default/opera.css"
+      type="text/css" media="projection" id="operaFix" />
+
+<style type="text/css">
+#currentSlide {display: none;}
+</style>
+</head>
+<body>
+<div class="layout">
+<div id="controls"></div>
+<div id="currentSlide"></div>
+<div id="header">
+
+</div>
+<div id="footer">
+<h1>A generated JIT compiler for Python</h1>
+
+</div>
+</div>
+<div class="presentation">
+<div class="slide" id="slide0">
+<h1 class="title">A generated JIT compiler for Python</h1>
+<table class="docinfo" frame="void" rules="none">
+<col class="docinfo-name" />
+<col class="docinfo-content" />
+<tbody valign="top">
+<tr><th class="docinfo-name">Author:</th>
+<td>Samuele Pedroni, Open End AB</td></tr>
+<tr><th class="docinfo-name">Date:</th>
+<td>December '09</td></tr>
+</tbody>
+</table>
+<!-- Definitions of interpreted text roles (classes) for S5/HTML data. -->
+<!-- This data file has been placed in the public domain. -->
+<!-- Colours
+======= -->
+<!-- Text Sizes
+========== -->
+<!-- Display in Slides (Presentation Mode) Only
+========================================== -->
+<!-- Display in Outline Mode Only
+============================ -->
+<!-- Display in Print Only
+===================== -->
+<!-- Display in Handout Mode Only
+============================ -->
+<!-- Incremental Display
+=================== -->
+
+</div>
+<div class="slide" id="idea">
+<h1>Idea</h1>
+<p>Derive a dynamic compiler from a sufficiently rich intermediate representation
+of the interpreter while it is turned into a VM</p>
+<ul class="simple">
+<li>all features supported by construction</li>
+<li>semantics are more easily encoded as interpreting code</li>
+</ul>
+</div>
+<div class="slide" id="tracing-jit-compiler">
+<h1>Tracing JIT compiler</h1>
+<p>Template: use the streamlined approach introduced by tracing JITs</p>
+<ul class="simple">
+<li>identify hot loops</li>
+<li>produce linear traces with stay-on-trace checks (guards), follow calls!</li>
+<li>compile the traces to assembler which run the loop</li>
+</ul>
+</div>
+<div class="slide" id="details">
+<h1>Details</h1>
+<ul class="simple">
+<li>Identifying loops: hints for the JIT runtime to identify the
+interpreter loop, and back edges of user loops</li>
+<li>Tracing: build encoding such that interpreter functions can be
+executed and their operation recorded in the traces</li>
+<li>Exploit when heap allocation can be forgone, mirror Python frames on
+the CPU stack</li>
+</ul>
+</div>
+<div class="slide" id="example">
+<h1>Example</h1>
+</div>
+<div class="slide" id="status">
+<h1>Status</h1>
+<ul class="simple">
+<li>Intel x86-32</li>
+<li>Small, medium examples run</li>
+<li>Algorithmic code is sped up, see benchmarks</li>
+<li>Reasonable heuristic when traces get too long</li>
+</ul>
+</div>
+<div class="slide" id="benchmarks">
+<h1>Benchmarks</h1>
+<div align="center" class="align-center"><img alt="result.png" class="align-center" src="result.png" /></div>
+</div>
+<div class="slide" id="work-left">
+<h1>Work Left</h1>
+<ul class="simple">
+<li>Further work on memory footprint</li>
+<li>Correct and improved behavior in the presence of exceptions: work in progress</li>
+<li>Better results for recursion, asm to asm calls</li>
+<li>Bugs, correctness (sys.setrace for example)</li>
+</ul>
+</div>
+<div class="slide" id="work-left-ii">
+<h1>Work Left (ii)</h1>
+<ul class="simple">
+<li>Machine code management, discard no longer valid  traces</li>
+<li>Make the interpreter more JIT friendly</li>
+<li>Interpreter level algorithmic improvements</li>
+<li>Intel x86-64</li>
+</ul>
+</div>
+</div>
+</body>
+</html>

Added: pypy/extradoc/talk/jitdec09/talk.txt
==============================================================================
--- (empty file)
+++ pypy/extradoc/talk/jitdec09/talk.txt	Wed Dec 16 14:22:43 2009
@@ -0,0 +1,74 @@
+.. include:: <s5defs.txt>
+
+=========================================================
+A generated JIT compiler for Python
+=========================================================
+
+:Author: Samuele Pedroni, Open End AB
+:Date: December '09
+
+
+Idea
+==========
+
+Derive a dynamic compiler from a sufficiently rich intermediate representation
+of the interpreter while it is turned into a VM
+
+- all features supported by construction
+
+- semantics are more easily encoded as interpreting code
+
+Tracing JIT compiler
+=======================
+
+Template: use the streamlined approach introduced by tracing JITs
+
+- identify hot loops
+- produce linear traces with stay-on-trace checks (guards), follow calls!
+- compile the traces to assembler which run the loop
+
+Details
+=========
+
+- Identifying loops: hints for the JIT runtime to identify the
+  interpreter loop, and back edges of user loops
+
+- Tracing: build encoding such that interpreter functions can be
+  executed and their operation recorded in the traces
+
+- Exploit when heap allocation can be forgone, mirror Python frames on
+  the CPU stack
+
+Example
+=========
+
+
+Status
+=======
+
+- Intel x86-32
+- Small, medium examples run
+- Algorithmic code is sped up, see benchmarks
+- Reasonable heuristic when traces get too long
+
+Benchmarks
+============
+
+.. image:: result.png
+   :align: center
+
+Work Left
+==========
+
+- Further work on memory footprint
+- Correct and improved behavior in the presence of exceptions: work in progress
+- Better results for recursion, asm to asm calls
+- Bugs, correctness (sys.setrace for example)
+
+Work Left (ii)
+===============
+
+- Machine code management, discard no longer valid  traces
+- Make the interpreter more JIT friendly
+- Interpreter level algorithmic improvements
+- Intel x86-64



More information about the Pypy-commit mailing list