adaptive concretization for parallel program synthesis
play

Adaptive)Concretization)for) Parallel)Program)Synthesis) - PowerPoint PPT Presentation

Adaptive)Concretization)for) Parallel)Program)Synthesis) Jinseong(Jeon 1 ,)Xiaokang)Qiu 2 ,) Armando)Solar@Lezama 2 ,)and)Jeffrey)S.)Foster 1) ) 1.)University)of)Maryland,)College)Park) 2.)MIT)CSAIL ) Syntax@guided)Synthesis) bit[32]


  1. Adaptive)Concretization)for) Parallel)Program)Synthesis) Jinseong(Jeon 1 ,)Xiaokang)Qiu 2 ,) Armando)Solar@Lezama 2 ,)and)Jeffrey)S.)Foster 1) ) 1.)University)of)Maryland,)College)Park) 2.)MIT)CSAIL )

  2. Syntax@guided)Synthesis) bit[32] spec(bit[32] x) { program) return x – (x % 8); speciMication) } bit[32] foo(bit[32] x) starts)from) implements spec structural) { hypothesis) if (??) { // G (a.k.a.) template )) return x & ??; // A } else { unknown) return x | ??; // B 32@bit)integer) } } 2

  3. Explicit)Search) • Stochastic/systematic)enumeration)of)candidate)space) bit[32] foo(bit[32] x) ... 65)(=1)+)32*2)) { if (true) { // G unknown)bits) return x & 0x00000000; // A } else { return x | 0x00000000; // B } } bit[32] foo(bit[32] x) bit[32] foo(bit[32] x) ... { implements spec if (true) { // G return x & 0x00000001; // A { } else { return x | 0x00000000; // B if (??) { // G } } return x & ??; // A ... } else { bit[32] foo(bit[32] x) ... return x | ??; // B { if (false) { // G } } return x & 0xffffffff; // A } else { return x | 0xffffffff; // B } } 4

  4. Symbolic)Search) • Constraint)solving)via)SAT/SMT)solver) bit[32] spec(bit[32] x) { Sketch)solves) return x – (x % 8); in)50ms) } bit[32] foo(bit[32] x) eq(spec(x), bvSub(x, implements spec bvMod(x, 8))) { if (??) { // G eq(foo(x), spec(x)) return x & ??; // A eq(foo(x), } else { ite(G, return x | ??; // B bvAND(x, A), } } bvOR(x, B))) 5

  5. Adaptive)Concretization) Explicit)search) Adaptive)concretization) Symbolic)search) bit[32] foo(bit[32] x) ... bit[32] foo(bit[32] x) ... { { if (true) { // G if (true) { // G return x & 0x00000000; // A return x & ??; // A } else { } } return x | 0x00000000; // B ... } } eq(spec(x), eq(foo(x), bvSub(x, bit[32] foo(bit[32] x) ... bvAND(x, A)) { bvMod(x, 8))) if (true) { // G return x & 0x00000001; // A } else { ... return x | 0x00000000; // B eq(foo(x), spec(x)) } } bit[32] foo(bit[32] x) ... eq(foo(x), { ... ite(G, if (false) { ... } else { bvAND(x, A), return x | ??; // B bit[32] foo(bit[32] x) ... } } { bvOR(x, B))) if (false) { // G ... return x & 0xffffffff; // A } else { eq(foo(x), return x | 0xffffffff; // B } } bvOR(x, B)) 6

  6. Symbolic)Constraints) bit[32] spec(bit[32] x) { return x – (x % 8); } bit[32] foo(bit[32] x) eq(spec(x), bvSub(x, implements spec bvMod(x, 8))) { if (??) { // G eq(foo(x), spec(x)) return x & ??; // A eq(foo(x), } else { ite(G, return x | ??; // B bvAND(x, A), } } bvOR(x, B))) 7

  7. Low@level)SAT)Formula) #node)488) 50ms)to)solution) eq(spec(x), x0) x1) x2) x3) x4) x5) x6) x7) x8) x9) bvSub(x, bvMod(x, 8))) A_0) B_0) A_1) B_1) A_2) B_2) A_3) B_3) A_4) B_4) A_5) B_5) A_6) B_6) A_7) B_7) A_8) B_8) A_9) B_9) &) |) &) |) &) |) &) |) &) |) &) |) &) |) &) |) &) |) &) |) G) x)@)x)%)8) eq(foo(x), spec(x)) ite) ite) ite) ite) ite) ite) ite) ite) ite) ite) eq(foo(x), ite(G, bvAND(x, A), =) =) =) =) =) =) =) =) =) =) bvOR(x, B))) 8

  8. Highly)InMluential)Unknowns) • Key)observation:)Unknowns)are)not)all)equally)important) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( A_0( B_0( A_1( B_1( A_2( B_2( A_3( B_3( A_4( B_4( A_5( B_5( A_6( B_6( A_7( B_7( A_8( B_8( A_9( B_9( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( G( x(+(x(%(8( ite( ite( ite( ite( ite( ite( ite( ite( ite( ite( =( =( =( =( =( =( =( =( =( =( 9

  9. Partial)Concretization) • Replacing)an)unknown)with)a)concrete)value) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( A_0( B_0( A_1( B_1( A_2( B_2( A_3( B_3( A_4( B_4( A_5( B_5( A_6( B_6( A_7( B_7( A_8( B_8( A_9( B_9( !"#$ &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( x(+(x(%(8( ite( ite( ite( ite( ite( ite( ite( ite( ite( ite( =( =( =( =( =( =( =( =( =( =( 10

  10. Partial)Concretization) • Then)simplifying)the)formula) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( A_0( A_1( A_2( A_3( A_4( A_5( A_6( A_7( A_8( A_9( true &( &( &( &( &( &( &( &( &( &( x(+(x(%(8( =( =( =( =( =( =( =( =( =( =( #node)488)⇒)391) 50)⇒)30ms)to)solution) 11

  11. Partial)Concretization) • BeneMicial)even)with)a)wrong)concrete)value) • Running)two)trials)(incorrect)one)and)then)correct)one))is) faster)than)pure)symbolic)search) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( B_0( B_1( B_2( B_3( B_4( B_5( B_6( B_7( B_8( B_9( false |( |( |( |( |( |( |( |( |( |( x(+(x(%(8( =( =( =( =( =( =( =( =( =( =( #node)488)⇒)391) 50)⇒)2ms)to)UNSAT) 12

  12. Unknowns)for)Computation) • Arithmetic)unknowns)are)best)left)to)the)solver) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( !"#$ A_0( B_0( A_1( B_1( A_2( B_2( A_3( B_3( A_4( B_4( A_5( B_5( A_6( B_6( A_7( B_7( A_8( B_8( B_9( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( G( x(+(x(%(8( ite( ite( ite( ite( ite( ite( ite( ite( ite( ite( =( =( =( =( =( =( =( =( =( =( 13

  13. Unknowns)for)Computation) • Arithmetic)unknowns)are)best)left)to)the)solver) x0( x1( x2( x3( x4( x5( x6( x7( x8( x9( !"#$ A_0( B_0( A_1( B_1( A_2( B_2( A_3( B_3( A_4( B_4( A_5( B_5( A_6( B_6( A_7( B_7( A_8( B_8( B_9( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( &( |( |( G( x(+(x(%(8( ite( ite( ite( ite( ite( ite( ite( ite( ite( ite( =( =( =( =( =( =( =( =( =( =( #node)488)⇒)486) 50ms)to)solution/UNSAT) 14

  14. InMluence)Estimation) • Key)observation:)Unknowns)are)not)all)equally)important) Low) inMluence) High) inMluence) • But,)this)inMluence)computation)is)an) estimate .) • We)opt)to) randomize !) 15

  15. Degree)of)Concretization) • Threshold)for)concretization) • Probability)of)concretizing)a)high)inMluence)unknown) (explicit)) (mixed)) (symbolic)) all)nodes)have) The)higher)the)inMluence,) all)nodes)have) ½)chance)of) the)higher)the)chance)of) no)chance)of) concretization) concretization) concretization) 0) d) ∞) 16

  16. The)“V”,)Abstractly) Running(time( 16) 32) 64) 128) 256) 512) 1024) 2048) 4096) 8192) • Optimal)degree)has)best)tradeoff)of)amount)of) concretization)vs.)probability)of)success) 17

  17. Adaptive)Concretization) • Basic)algorithm) • Start)with)degree)low=1,)high=2) • Trials)at)low)degrees)will)be)very)fast,)since)mostly)concrete) • Exponentially)climb)until)optimum)degree)between)low,)high) • Use)a)statistical)test)to)determine)which)degree)is)faster) • Binary)search)between)low,)high)to)Mind)optimal)degree) • Repeatedly)run)concretization)at)Minal)degree) • Exit)at)any)time)if)solution)found) • Naturally)parallelize) • Using)different)cores)to)run)different)trials) 18

  18. Estimated)Running)Time) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Starts)from)low)degrees) (to)avoid)long@running)high)degree) ) • Runs)trials)(in)parallel))and)estimates)running)time) 19

  19. Comparing)Two)Degrees) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Wilcoxon)Signed@Rank)Test) • determines)if)two)data)sets)are)from)distinct)populations) 20

  20. Widening) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Widen)the)range) • if)not)distinguishable) 21

  21. Shifting) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Shift)to)the)next)range) • if)distinguishable)and)the)high)pivot)is)faster)(i.e.,)down@hill)) 22

  22. Climbing) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Keep)climbing)until)the)up@hill)appears) • optimum)likely)lies)between)that)range) 23

  23. Binary)Search) 16# 32# 64# 128# 256# 512# 1024# 2048# 4096# 8192# • Binary)search)between)the)rough)range) 24

  24. Experiment) • 26)sketches)from)5)domains) • Pasket)–)framework)model)synthesis) • The)motivation)for)this)work) • Several)Pasket)examples)could)not)run)under)plain)Sketch) • Data)structure)manipulation) • Invariants)for)stencils)@)ScientiMic)computation) • SyGuS)2014) • Sketch)performance)benchmarks) • Did)13)runs)on)server)with)forty)2.4GHz)CPUs,)99GB)RAM,) Ubuntu)14.04.1)LTS) • 2@hour)timeout,)32GB)memory)bound) 25

  25. Performance)Results) • Running)on)32)cores,)compared)to)Sketch) • Adaptive)Concretization)(AC))better)on)23)of)26) • In)one)case,)Sketch)often)aborts)with)out)of)memory) • Many)cases)with)speedups)from)3x)to)14x) 26

  26. Parallel)Scalability)Results) • Run)on)1,)4,)and)32)cores) • AC)faster)on)1@core)in)17)of)26)cases) • AC)generally)speeds)up)with)more)cores) • Best)performance)at)32)cores)in)20)of)26)cases) • Implementation)does)not)fully)utilize)cores) • Current)source)of)overhead:)re@loading)input)Mile)every)time) • Compared)to)Enumerative)Solver)(SyGuS)2014)winner)) • Faster)on)6)of)9)benchmarks) • Competitive)on)others) 27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend