• About Jakob Engblom and this blog
Observations from Uppsala Computer Simulation, Virtual Platforms, Embedded Programming, Multicore and More (by Jakob Engblom)

David Ungar: It is Good to be Wrong

2012 February 12 23:31 / 7 Comments / Jakob

I was recently pointed to a 2011 SPLASH presentation by David Ungar, an IBM researcher working on parallel programming for manycore systems. In particular, in a project called Renaissance, run together with the Vrije Universiteit Brussels in Belgium (VUB) and Portland State University in the US. The title of the presentation is “Everything You Know (about Parallel Programming) Is Wrong! A Wild Screed about the Future“, and it has provoked some discussion among people I know about just how wrong is wrong.

When reading the slides I really wish I had been there, this must have been a blast live. Still, there is an interview video posted online taken at the event (it failed to play properly for me).

Two things stand out in the talk:

  • The poetic notion that a 1000-core processor is like discovering a new space. It is something new, not just more of the same.
  • Synchronization is bad.

I think this second point is why the talk is titled “everything you know is wrong”. When teaching parallel programming, synchronization is a core part of the subject. When designing parallel languages and systems, the hardest problem is how to handle synchronization (or hide it so that it does not have to be explicitly handled).

Instead of finding better ways to synchronize, David Ungar makes the point that we need to find ways to eliminate synchronization altogether. Any synchronization will sooner or later become a bottleneck. I see where he is coming from. A talk I heard in 2009 made much the same point:

They also had the opportunity to test their solution [for parallel Erlang] on a Tilera 64-core machines. This mercilessly exposed any scalability limitations in their system, and proved the conventional wisdom that going beyond 10+ cores is quite different from scaling from 1 to 8… The two key lessons they learned was that no shared lock goes unpunished, and data has to be distributed as well as code.

In the same vein, it seems that all big system parallelization efforts turn into a hunt for locks and the splitting up of code and data into units that can run in parallel without having to synchronize. The “upper limit” of this process is clearly a system with no synchronization points at all.

He makes the valid point that even “lock-free” algorithms depend on synchronization, albeit a simple form of it. They do want a single atomic instruction – and that means that the hardware has to do some kind of synchronization to guarantee this atomicity across cores sharing memory (at least at the hardware level). I had not really considered that before, but it is true.

I would add that message-passing shared-nothing systems like Erlang are not exempt either – sending a message is a synchronizing operation, and it is quite possible to build synchronized systems in Erlang that do not scale either. It is all about communication vs computation, and making sure each thread can do as much work as possible without having to stop and wait for other threads.

Dropping synchronization as a concept makes the system non-deterministic, and that is the part that makes this hard to do. Most programmers do not like the idea that their programs do not have defined results, but there is a fundamental conflict here. Synchronized or high-performance, choose one. I have been working alongside very smart programmers for a long time trying to build parallel simulation systems. As long as there is a requirement for determinism and precise repeatability, performance from parallelism is very hard to obtain. Relax determinism, and performance is much easier to achieve. But maybe the entire value of the program is lost in the process?

I am reminded of an old Dilbert cartoon, where Wally asks the boss “Is it OK to do things wrong if we are really really fast?” Maybe it is, in the world of a thousand cores…

Ungar’s core idea seems to be to move towards a more approximate or statistical idea of program correctness. That makes sense, and is applicable in quite a few domains.

In a case like web searching, is there really a “right” result? For a human, all you really want is a useful result. Behind this is the idea of eventually consistent databases: it does not hurt if data is not quite the same in all places in a system, as long as updated data eventually reaches all parts of it. Better to available and fast and produce a useful result, than to be perfectly right but only be able to serve a portion of the user base.

In “soft” real-time systems we accept that we will occasionally miss a deadline, drop a phone call, have a bump in the flight of airliner, skip a frame in a movie playback, etc – as long as the results are not fatal but just an inconvenience. We rely on humans being forgiving, adaptable, and able to cope with the occasional problem. Traditionally, computers are not like that, in a binary a world a single error tends to be absolute.

Obviously, there are systems that just have to be right – I would not like control systems for aircraft to occasionally hiccup, nor my bank to play roulette with my money on a massively parallel machine… and the same goes for basic data structures. David Ungar brings up the example of a parallel hash table, and compares a few different implementations that all actually strive to give a correct results. The actual order of things in lists would seem to be different depending on how races play out, but with checking and patching making sure that the results are all correct (containing all data in the right buckets with no duplicates). That is familiar territory in parallel programming – correct final result, different way to get there (in terms of the exact order in which threads insert values into the table).

The techniques used in the hash table example remind me of the old idea of optimistic concurrency control – make a change and then check if it was invalidated, rather than checking before you make the change. This is benchmarked against compare-and-swap atomic instructions, and the performance trade-off is not clear. Even very slight synchronization will hurt performance, even though patching things up after a mistake has been done should use more cycles for retries and redoing work.

Overall, I think the core point David Ungar really makes is our thinking about right or wrong needs to go from a binary concept to shades-of-grey. In the future, programmers will not create programs that are fast but wrong, but rather programs which are sufficiently correct and still fast.

How to debug such a thing is still a bit of mystery though…

Tweet
Posted in: computer architecture, multicore debug, multicore software, programming / Tagged: David Ungar, manycore, Portland State, Renaissance, Smalltalk, Squeak, Vrije Universiteit Brussels

7 Thoughts on “David Ungar: It is Good to be Wrong”

  1. usdhfjsdf on 2012 February 24 at 00:12 said:

    You know I would truly love for the bank computer to make mistakes on my account because i might get rich in the process. It can not be worse than it is now ( assuming it will not go negative ).

    BTW what is the end game of capitalism? :
    -all the money in 1 enormous bank account one cent transaction at a time?

    Computers will get more powerful one Mflop at a time : no doubt about this.

  2. Catherine on 2012 March 11 at 11:14 said:

    Hello,
    We would like to collaborate with you!
    Can you please email me for complete details? Thank you.

  3. Miha Ahronovitz on 2012 March 18 at 09:38 said:

    David Ungar’s video you reference on my site

    The memories of a Product Manager: Many Core processors: Everything You Know (about Parallel Programming) Is Wrong! http://bitly.com/y

    …runs well on Windows 7. Did you try to see it on a Windows, Mac or Linux machine? Any feedback on whether you can see the video better now?

    Miha Ahronovitz

  4. Jakob on 2012 March 19 at 12:55 said:

    Miha Ahronovitz :David Ungar’s video you reference on my site
    The memories of a Product Manager: Many Core processors: Everything You Know (about Parallel Programming) Is Wrong! http://bitly.com/y
    …runs well on Windows 7. Did you try to see it on a Windows, Mac or Linux machine? Any feedback on whether you can see the video better now?
    Miha Ahronovitz

    Previously when I tried to view it, Firefox went off looking for Silverlight or something, and then crashed. IE9 died. Now, Firefox instead selects to download the .vmw file which should eventually play locally on my machine.

  5. Miha Ahronovitz on 2012 May 25 at 01:20 said:

    A new interview with David Ungar from May 22
    http://my-inner-voice.blogspot.com/2012/05/interview-with-david-ungar-ibm-research.html

    Comments?

    Miha Ahronovitz

  6. David Ungar on 2013 January 11 at 00:19 said:

    Just found your posting on my talk. Wanted to let you know that I think you did a great job of both summarizing and interpreting it, and that I agree with your thoughts. Thank you.

  7. Jakob on 2013 January 11 at 11:54 said:

    Thank you. It is always good to get an acknowledgement that you have understood something right.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation

← Previous Post
Next Post →

Recent Posts

  • Wind River Blog: Simics 4.8 is Here
  • A Few Electrons too Many
  • Wind River Blog: Visuality NQ CIFS Server on Simics
  • Everything in the Cloud?
  • Wind River Blog: TCF and Simics
  • Off-Topic: Moving Bad Piggies Save Games
  • Two Cores, Four Cores, Eight Cores – Mobile Variety
  • Bliss: Failing to Pivot for Ideology
  • Wind River Blog and Movie: Demo of Simics Debugging
  • Simulation vs Reality in Schlock Mercenary
  • Programming like Lego
  • Does ISA Matter for Performance?
  • Wind River Blog: Debugging Simics using Simics
  • Wind River Blog: Simics and Flying Piggies
  • Dragons can be Useful – when AT Models Make Sense

Categories

  • appearances (30)
  • articles (21)
  • blogging (10)
  • books (6)
  • business issues (31)
  • computer architecture (35)
  • conferences (34)
  • EDA (50)
    • ESL (35)
  • embedded (78)
    • embedded software (57)
    • embedded systeme (50)
  • general research (6)
  • history (32)
    • general history (7)
    • history of computing (26)
  • off-topic (94)
    • biking (5)
    • board games (1)
    • computer games (3)
    • desktop software (35)
    • food and drink (1)
    • funny (12)
    • gadgets (24)
    • Politics (3)
    • popular culture (5)
    • trains (5)
    • transportation (10)
    • travel (10)
    • websites (3)
  • parallel computing (92)
    • multicore computer architecture (51)
    • multicore debug (22)
    • multicore software (65)
  • programming (107)
  • review (8)
  • security (19)
  • teaching (7)
  • testing (9)
  • uncategorized (12)
  • virtual things (129)
    • computer simulation technology (68)
    • virtual machines (17)
    • virtual platforms (98)
    • virtualization (14)
  • Wind River Blog (40)

Tags

ARM blog commentary Cadence Checkpointing clock-cycle models Communications of the ACM computer architecture conference cycle accuracy debugging DML Domain-specific languages embedded freescale G900 heterogeneous homogeneous IBM Intel iPod lego linux mobile phones multicore off-topic office 2007 operating systems p4080 podcast commentary power architecture rant research reverse debugging reverse execution S4D SiCS Multicore days Simics simulation software tools Sun SystemC video virtualization Vista Windows

1

  • F-Secure Blog

Blogs and news

  • Andras Vajda's blog (on multicore)
  • Embedded in Academia (John Regehr)
  • Grant Martin
  • Jack Ganssle
  • My Wind River Blog
  • Security Now podcast
  • Secworks (Joachim Strömbergson)
  • Simon Kågström
  • Synopsys View from the Top
  • Worse Than Failure

Archives

  • May 2013 (2)
  • April 2013 (1)
  • March 2013 (4)
  • February 2013 (1)
  • January 2013 (3)
  • December 2012 (2)
  • November 2012 (2)
  • October 2012 (1)
  • September 2012 (6)
  • August 2012 (4)
  • July 2012 (4)
  • June 2012 (3)
  • May 2012 (4)
  • April 2012 (2)
  • March 2012 (3)
  • February 2012 (1)
  • January 2012 (6)
  • December 2011 (2)
  • November 2011 (3)
  • October 2011 (4)
  • September 2011 (5)
  • August 2011 (4)
  • July 2011 (3)
  • June 2011 (4)
  • May 2011 (7)
  • April 2011 (1)
  • March 2011 (3)
  • February 2011 (5)
  • January 2011 (1)
  • December 2010 (4)
  • November 2010 (3)
  • October 2010 (5)
  • September 2010 (5)
  • August 2010 (5)
  • July 2010 (6)
  • June 2010 (5)
  • May 2010 (3)
  • April 2010 (4)
  • March 2010 (3)
  • February 2010 (4)
  • January 2010 (7)
  • December 2009 (6)
  • November 2009 (6)
  • October 2009 (7)
  • September 2009 (6)
  • August 2009 (7)
  • July 2009 (11)
  • June 2009 (5)
  • May 2009 (10)
  • April 2009 (7)
  • March 2009 (8)
  • February 2009 (9)
  • January 2009 (12)
  • December 2008 (8)
  • November 2008 (9)
  • October 2008 (9)
  • September 2008 (10)
  • August 2008 (13)
  • July 2008 (12)
  • June 2008 (8)
  • May 2008 (9)
  • April 2008 (10)
  • March 2008 (7)
  • February 2008 (8)
  • January 2008 (5)
  • December 2007 (5)
  • November 2007 (7)
  • October 2007 (7)
  • September 2007 (12)
  • August 2007 (9)
  • July 2007 (2)
© Copyright 2013 - Observations from Uppsala
Infinity Theme by DesignCoral / WordPress