cost effective compiler directed memory prefetching and
play

Cost-Effective Compiler Directed Memory Prefetching and Bypassing - PowerPoint PPT Presentation

Cost-Effective Compiler Directed Memory Prefetching and Bypassing Daniel Ortega, , Eduard Ayguad e , Jean-Loup Baer and Mateo Valero Departamento de Arquitectura de Computadores, Department of


  1. ☎ � � ✁ � ✂ ✄ ✆ Cost-Effective Compiler Directed Memory Prefetching and Bypassing Daniel Ortega, , Eduard Ayguad´ e , Jean-Loup Baer and Mateo Valero Departamento de Arquitectura de Computadores, Department of Computer Science and Engineering, Universidad Polit´ ecnica de Catalu˜ na – Barcelona University of Washington – Seattle dortega,eduard,mateo @ac.upc.es baer@cs.washington.edu PACT 2002 – p.1/20

  2. Conventional Cache Hierarchy Regs 1 cycle L1 L1 10s cycles L2 >100 cycles Main Memory PACT 2002 – p.2/20

  3. Conventional Cache Hierarchy Regs 3-5 cycles (more?) L1 L1 10s cycles L2 >100 cycles Main Memory PACT 2002 – p.2/20

  4. Conventional Cache Hierarchy Regs 3-5 cycles (more?) (smaller?) L1 L1 10s cycles L2 >100 cycles Main Memory PACT 2002 – p.2/20

  5. ✝ ✝ ✞ ✞ ✞ Our approach Attack register-L1 gap with memory instruction bypassing Use hardware prefetcher for L1-L2 gap Directed by the software thus simple Hardware no recovery needed in case of misprediction PACT 2002 – p.3/20

  6. Limit Study 2.5 SpeedUp No Prefetching No Bypassing 2.0 No Prefetching Perfect Bypassing Perfect Prefetching No Bypassing Perfect Prefetching Perfect Bypassing 1.5 1.0 applu apsi hydro2d swim tomcatv Average Limit values for a 4-way machine PACT 2002 – p.4/20

  7. ✝ ✝ ✝ ✝ Index Motivation Memory Instruction Bypassing Compiler Directed Memory Prefetcher Comparison with APDP PACT 2002 – p.5/20

  8. ✠ ✟ ✡☛ MIB through Renaming I ... pref a[i] ... load r , a[i+1] load r , a[i] load r , a[i+3] ... loop branch PACT 2002 – p.6/20

  9. ✡☛ ✑ ✠ ✡ ✡ ✑ ✡ ✟ ✒ ✌ ✎ ✡ ✍ ✌ ☞ MIB through Renaming I ... ... ✡✏✎ ✡✏✎ pref a[i] pref r , a[i] ... ... load r , a[i+1] load r , a[i+1] load r , a[i] load r , a[i] load r , a[i+3] load r , a[i+3] ... ... loop branch loop branch PACT 2002 – p.6/20

  10. ✔ ✕ ✗ ✕ ✓ ✕✖ ✕ ✖ ✓ ✓ ✓ ✕ ✓ ✕ ✓ ✕✖ ✕ ✓ ✔ ✓ ✓ ✓ ✔ MIB through Renaming II Renaming Table . . . . . . r f r f r f . . . . . . Special Renaming Table . . . . . . r . . . r . . . r . . . . . . . . . PACT 2002 – p.7/20

  11. ✖ ✕ ✕ ✓ ✤ ✓ ✥ ✕✖ ✕ ✗ ✔ ✥✦ ✤ ✓ ✓ ✓ ✕ ✔ ✓ ✕ ✕ ✓ ✕ ✓ ✣ ✁ ✘ ✙ ✢ ✛ ✕✖ ✚ ✓ ✔ ✓ MIB through Renaming II ... Renaming Table ✚✜✛ ✚✜✛ pref r , a[i] . . . . . . r f r f r f . . . . . . Special Renaming Table . . . . . . r f r f r f . . . . . . PACT 2002 – p.7/20

  12. ✕ ✥✦ ✕ ✕ ✕ ✓ ✓ ✕✖ ✥ ✤ ✔ ✕ ✓ ✓ ✤ ✓ ✔ ✓ ✓ ✕ ✖ ✓ ✕✖ ✓ ✔ ✚ ✁ ✘ ✙ ✓ ✢ ✛ ✚ ✢ ✣ MIB through Renaming II ... Renaming Table ✚✜✛ ✚✜✛ pref r , a[i] . . . . . . r f ... r f load r , a[i+1] r f . . . . . . Special Renaming Table . . . . . . r f r . . . r f . . . . . . PACT 2002 – p.7/20

  13. ✓ ✤ ✕ ✕✖ ✓ ✕ ✕ ✓ ✓ ✓ ✕ ✓ ✥ ✤ ✔ ✕ ✕ ✓ ✓ ✖ ✔ ✔ ✓ ✢ ✘ ✛ ✚ ✣ ✙ ✢ ✚ ✥✦ ✁ ✘ ✓ MIB through Renaming II ... Renaming Table ✚✜✛ ✚✜✛ pref r , a[i] . . . . . . r f ... r f load r , a[i+1] r f . . . . . . load r , a[i] Special Renaming Table . . . . . . r . . . r . . . r f . . . . . . PACT 2002 – p.7/20

  14. ✕ ✓ ✓ ✦ ✚ ✚ ✥ ✤ ✥ ✔ ✕ ✔ ✓ ✤ ✕✖ ✓ ✓ ✘ ✓ ✓ ✕ ✓ ✁ ✓ ✘ ✕ ✙ ✓ ✢ ✢ ✛ ✚ ✣ ✖ ✕ ✚ ✕ MIB through Renaming II ... Renaming Table ✚✜✛ ✚✜✛ pref r , a[i] . . . . . . r f ... r f load r , a[i+1] r f . . . . . . load r , a[i] Special Renaming Table load r , a[i+3] . . . . . . r . . . r . . . r . . . . . . . . . PACT 2002 – p.7/20

  15. ✕ ✥ ✓ ✦ ✚ ✚ ✥ ✤ ✕ ✔ ✓ ✤ ✓ ✔ ✓ ✓ ✕✖ ✘ ✓ ✕ ✕ ✓ ✁ ✓ ✘ ✕ ✙ ✓ ✢ ✢ ✛ ✚ ✣ ✖ ✕ ✚ ✓ MIB through Renaming II ... Renaming Table ✚✜✛ ✚✜✛ pref r , a[i] . . . . . . r f ... r f load r , a[i+1] r f . . . . . . load r , a[i] Special Renaming Table load r , a[i+3] . . . . . . r . . . ... r . . . loop branch r . . . . . . . . . PACT 2002 – p.7/20

  16. ✝ ✝ ✝ ✝ Index Motivation Memory Instruction Bypassing Compiler Directed Memory Prefetcher Comparison with APDP PACT 2002 – p.8/20

  17. ✝ ✝ ✝ ✝ ✝ Decoupled Prefetcher Compiler inserts prefetching operations Instructions bring data closer to the processor Memory instruction bypassing takes care of bringing data to the register file from L1 Compiler also instructs prefetching hardware to prefetch ahead (to L1) No.s of prefetches are minimised by compiler control PACT 2002 – p.9/20

  18. Prefetching Mechanism pctag type last @ ... PACT 2002 – p.10/20

  19. ✧ Prefetching Mechanism Decode phase pctag type last @ pctag PC last @ ... PACT 2002 – p.10/20

  20. ✧ ✧ Prefetching Mechanism Decode phase pctag type last @ Address calc. pctag PC last @ ... eff @ - stride PACT 2002 – p.10/20

  21. ✧ ✧ ✧ Prefetching Mechanism Decode phase pctag type last @ Address calc. pctag PC last @ ... Generate new prefetch eff @ - stride *N+ PACT 2002 – p.10/20

  22. ✧ ✧ ★ ✧ Prefetching Mechanism Decode phase pctag type last @ Address calc. pctag PC last @ ... Generate new prefetch eff @ N depends on type - stride *N+ PACT 2002 – p.10/20

  23. ★ ✧ ★ ✧ ✧ Prefetching Mechanism Decode phase pctag type last @ Address calc. pctag PC last @ ... Generate new prefetch eff @ N depends on type - stride wait for free port *N+ PACT 2002 – p.10/20

  24. Performance Results 2.0 O3 LoadStore O3+SW pref LoadStore SpeedUp O3+SW pref only Bypassing O3+SW pref Proposal 16 1.5 O3+SW pref Proposal 32 O3+SW pref Proposal 64 O3+SW pref Proposal infinite 1.0 applu apsi hydro2d swim tomcatv Average Effect of number of streams in a 4-way machine PACT 2002 – p.11/20

  25. Performance Results II 2.0 O3 LoadStore SpeedUp O3+SW pref LoadStore O3+SW pref only Bypassing 1.5 O3+SW pref Proposal N=(pref 1,load 1) O3+SW pref Proposal N=(pref 1,load 2) O3+SW pref Proposal N=(pref 2,load 1) 1.0 applu apsi hydro2d swim tomcatv Average Effect of lookahead policy in a 4-way machine with 32 entries PACT 2002 – p.12/20

  26. ✝ ✝ ✝ ✝ Index Motivation Memory Instruction Bypassing Compiler Directed Memory Prefetcher Comparison with APDP PACT 2002 – p.13/20

  27. ✞ ✝ ✞ ✞ ✩ ✞ ✄ Comparison with APDP Address Prediction for Data Prefetching predicts addresses of memory operations makes prediction available as soon as load arrives to decoding needs recovery mechanism in case of misprediction dynamic mechanism J. González and A. González, ICS 97 PACT 2002 – p.14/20

  28. Prefetching Mechanism v address stride conf. val ... PACT 2002 – p.15/20

  29. ✧ Prefetching Mechanism Decode phase v address stride conf. val PC ... PACT 2002 – p.15/20

  30. ✧ ✧ Prefetching Mechanism Decode phase v address stride conf. val Is value correct? PC ... ? PACT 2002 – p.15/20

  31. ✧ ✧ ✪ ✧ Prefetching Mechanism Decode phase v address stride conf. val Is value correct? PC ... Yes bypass ? register file PACT 2002 – p.15/20

  32. ✧ ✧ ✧ ✪ ✧ Prefetching Mechanism Decode phase v address stride conf. val Is value correct? PC ... Yes bypass new address ? ? Address calc. register file PACT 2002 – p.15/20

  33. ✧ ✧ ✧ ✪ ✧ ✧ Prefetching Mechanism Decode phase v address stride conf. val Is value correct? PC ... Yes bypass new address ? Address calc. - Update table register file PACT 2002 – p.15/20

  34. ✧ ✧ ✧ ✧ ✧ ✪ ✧ Prefetching Mechanism Decode phase v address stride conf. val Is value correct? PC ... Yes bypass new address ? Address calc. - Update table register file ? + Generate prefetch? new prediction PACT 2002 – p.15/20

  35. Comparison Results 2.0 O3 LoadStore O3 APDP only prefetching SpeedUp O3 APDP (squash) O3 APDP (selective) 1.5 O3+SW pref LoadStore O3+SW pref APDP only prefetching O3+SW pref APDP (squash) O3+SW pref APDP (selective) 1.0 applu apsi hydro2d swim tomcatv Average Effect of only prefetching in APDP (4-way and 2 ports) PACT 2002 – p.16/20

  36. Comparison Results 1.2 O3 LoadStore SpeedUp O3 APDP (squash) O3 APDP (selective) 1.1 O3 only Bypassing O3 Proposal 16 entries O3 Proposal 32 entries 1.0 0.9 applu apsi hydro2d swim tomcatv Average 4 way machine comparison against APDP PACT 2002 – p.17/20

  37. Memory traffic applu apsi hydro2d swim tomcatv 1.00 1.00 1.00 1.00 1.00 LoadStore 1.14 1.14 1.24 1.21 1.21 APDP sel. 1.14 1.15 1.24 1.21 1.22 APDP sq. 0.90 0.74 0.82 0.72 0.89 Bypassing 0.98 0.85 0.95 0.83 0.94 Proposal PACT 2002 – p.18/20

  38. Any questions? PACT 2002 – p.19/20

  39. Thank you dortega@ac.upc.es PACT 2002 – p.20/20

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