xchangea cue from real life: market-based societies 9 participants try to maximize their own...

23
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

Upload: others

Post on 05-Sep-2020

1 views

Category:

Documents


0 download

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

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

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

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

▪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

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

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

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

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

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

▪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

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

▪ 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

▪ 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

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

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

▪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

▪ “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

▪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

▪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

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

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

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

▪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