xchangea cue from real life: market-based societies 9 participants try to maximize their own...
TRANSCRIPT
![Page 1: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/1.jpg)
XCHANGE¿PUEDE EL PUESTO DE FRUTA DEL MERCADO
AYUDAR A MI CPU?
José F. Martínez http://csl.cornell.edu/~martinez
Image: Britt Reints @ Wikimedia
![Page 2: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/2.jpg)
XCHANGE
MY VERSION OF MOORE’S LAW
2• Motivation • Prior Art • Markets
Image: Greudin@Wikimedia
Image: Morio@Wikimedia
Moore’s Law
![Page 3: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/3.jpg)
XCHANGE
MODERN PROCESSORS: A SILICON CITY
3
Image: Qualcomm
It’s not just “a processor”
Shared I/O pins
Heterogeneous processing
Shared on-chip power
• Motivation • Prior Art • Markets
Shared caches
Multicore
![Page 4: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/4.jpg)
▪Your chip needs a townhall• And your chip is not a village▪Centralized solutions don’t scale▪Market-based framework very promising• Based on sound, proven theory; but practical• Fast, scalable, amenable to external tuning▪ Implementation: XChange• Self-optimizing, extensible
MANAGING YOUR CHIP’S RESOURCES
4
XCHANGE• Motivation • Prior Art • Markets
![Page 5: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/5.jpg)
ANARCHY DOESN’T WORK
5
Crafty-Ammp-Apsi-Art
IPC
1.5
1.75
2
2.25
2.5
unregulated cache memory power cache_memory cache_power memory_power all
2.86%-0.44%
10.69%
-7.50%
-13.55%
XCHANGE
Wei
ghte
d Sp
eedu
p
• Motivation • Prior Art • Markets
![Page 6: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/6.jpg)
MANAGING RESOURCES: CENTRALIZED DOESN’T SCALE
6
Image: Choi and Yeung, ISCA ‘06
Sampling + hill-climbing
XCHANGE• Motivation • Prior Art • Markets
Search overhead too large: Not scalable
![Page 7: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/7.jpg)
MANAGING RESOURCES: CENTRALIZED DOESN’T SCALE
7
Image: Bitirgen et al., MICRO ‘08
Hardware acceleration
XCHANGE
Search still centralized and sequential
• Motivation • Prior Art • Markets
![Page 8: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/8.jpg)
WHAT “WORKS”? A CUE FROM REAL LIFE
8
▪Compromise global optimality for simplicity• Pursue absolute optimum is very expensive• Optimal outcome is not practical• Simple, distributed mechanisms can be reasonably good
XCHANGE• Prior Art • Markets • Utility
Image:Mariordo@Wikimedia
![Page 9: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/9.jpg)
A CUE FROM REAL LIFE: MARKET-BASED SOCIETIES
9
▪Participants try to maximize their own utilities▪Selfish behavior still benefits social welfare▪ (Largely) distributed solution → scalable
“It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest.”
Adam Smith, “The Wealth of Nations”
XCHANGE• Prior Art • Markets • Utility
Image: 663highland@Wikimedia
![Page 10: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/10.jpg)
▪Concept: “Competitive market”• Players have finite budgets• Prices are posted, same to all players• Players are price-takers: no monopolistic behavior• Non-satiation: Can always take more (*)
▪Concept: “Competitive market equilibrium”• Prices are such that supply = demand
A PEEK INTO MARKET THEORY
10
XCHANGE
(*) Strictly speaking this is monotonicity of preferences (stronger)
• Prior Art • Markets • Utility
![Page 11: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/11.jpg)
FIRST WELFARE THEOREM
11
▪Concept: “Pareto optimality”• An allocation is Pareto-optimal if there is no way to
reallocate goods so that someone is made better off without making someone else worse off• Caveat: Pareto-optimal not necessarily perfect• But much faster to reach (see results)
▪ First welfare theorem• Any competitive market equilibrium is Pareto-optimal
XCHANGE• Prior Art • Markets • Utility
![Page 12: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/12.jpg)
▪ 1: Market side• How does one set prices to satisfy demand?
▪Price-taking heuristic (F. Kelly)
XCHANGE: MARKET CHALLENGES
12
XCHANGE• Prior Art • Markets • Utility
pricej =bidi ' ji '∑
total _resourcejresourceij =
bidijpricej
![Page 13: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/13.jpg)
▪ 2: Agent side• How do I maximize my bang-for-buck resource-wise?
▪Utility estimation• Agents concurrently “discover” their own utility• Analytical models• Learning models• Heuristics (see XChange, HPCA’15)• t ∝ f(cpuapp,memapp) ∝ f(freqapp,cacheapp)• Infer t’ for (freqapp’,cacheapp’)
XCHANGE: MARKET CHALLENGES
13
XCHANGE• Prior Art • Markets • Utility
![Page 14: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/14.jpg)
A SIMPLE HEURISTIC UTILITY MODEL
▪Memory phase• Cache: Proportional to memory phase• Combine Miftakhutdinov + UMON
14
XCHANGE
Assume constant across allocations
Miftakhutdinov
• Markets • Utility • Practical Issues
![Page 15: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/15.jpg)
A SIMPLE HEURISTIC UTILITY MODEL
▪Compute phase• Power: Assume compute phase ~linear to f
15
XCHANGE
Measured (perf. counters)
Miftakhutdinov
• • Markets • Utility • Practical Issues
0
![Page 16: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/16.jpg)
▪Convergence• Detected through price fluctuation (<1%)• Price smoothing: Avoid ping-pong by incorporating
memory in pricing mechanism• Fall back to equal-share after 30 iterations▪Bankruptcy• Everything is too expensive• Guarantee one-way cache and 800 MHz operation• Exclude from market for one interval
PRACTICAL ISSUES
16
XCHANGE• Utility • Practical Issues • Results
![Page 17: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/17.jpg)
▪ “Rigging” the market
• Performance-oriented: Give more budget to app with more potential for gain• Internally derived, e.g., calculate for min/max resource
allocation
• Mission-oriented: Give more budget to more critical app • Externally derived, e.g., application feedback
• Fairness-oriented: Give same budget to everyone
XCHANGE: WEALTH REDISTRIBUTION
17
XCHANGE• Utility • Practical Issues • Results
![Page 18: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/18.jpg)
▪Leverage Linux’s APIC timer interrupt• Every 1 ms, for kernel statistics update• Designate “master core” to post prices, collect bids
▪Modest hardware overhead• ~ 4 kB/core (mostly Qureshi & Patt’s UMON)
XCHANGE: IMPLEMENTATION
18
XCHANGE• Utility • Practical Issues • Results
![Page 19: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/19.jpg)
▪Pretty much out of the window• Utility function approximation at best• Based on architecture heuristics
• Bidding search not exhaustive• Predictive: past history = future performance▪Nevertheless, reason for optimism• Plenty of real-life examples that just work• We want something “better”• Perfect is the enemy of Good
• We have reasonable fallback mechanism
WAIT—WHAT ABOUT THEORETICAL GUARANTEES?
19
XCHANGE• Utility • Practical Issues • Results
![Page 20: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/20.jpg)
EXPERIMENTAL SETUP
20
XCHANGE• Practical Issues • Results • Conclusions
![Page 21: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/21.jpg)
XCHANGE: 64-CORE RESULTS (SEE HPCA’15)
21• Practical Issues • Results • Conclusions
XCHANGE
![Page 22: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/22.jpg)
XCHANGE: OVERHEAD (SEE HPCA’15)
22• Practical Issues • Results • Conclusions
5M-cycle intervals
XCHANGE
![Page 23: XChangeA CUE FROM REAL LIFE: MARKET-BASED SOCIETIES 9 Participants try to maximize their own utilities Selfish behavior still benefits social welfare (Largely) distributed solution](https://reader031.vdocuments.mx/reader031/viewer/2022011917/5fe74cedd6c95926c676fc20/html5/thumbnails/23.jpg)
▪Market-based framework very promising• Based on sound theory; but practical• Fast, scalable, amenable to external tuning▪Ongoing work• Tunable markets (see ReBudget, ASPLOS’16)• Minimalistic hardware solutions• Market ensembles
TAKEAWAYS
23
XCHANGE• Practical Issues • Results • Conclusions