a discussion on performance analysis for smt · scalable tools workshop solitude, utah - july 12th,...

9
A discussion on Performance analysis for SMT Moderators: Michael Chynoweth & Ahmad Yasin Scalable Tools Workshop Solitude, Utah - July 12 th , 2018

Upload: others

Post on 25-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

A discussion on Performance analysis for SMT

Moderators: Michael Chynoweth & Ahmad Yasin

Scalable Tools Workshop

Solitude, Utah - July 12th, 2018

Page 2: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

Motivation

# threads per core

Intel Xeon - Skylake 2

AMD Zen 2

Intel Xeon Phi (KNL) 4

IBM Power 9 8

ARM, Intel Atom 1

Figure source: Ayers, G., Ahn, J.H., Kozyrakis, C. and Ranganathan, P., 2018, February. Memory Hierarchy for Web Search. In

High Performance Computer Architecture (HPCA), 2018 IEEE International Symposium on (pp. 643-656). IEEE.

SMT is commonplace for general-purpose high-performance

Page 3: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

3 Ahmad Yasin – How TMA Addresses Challenges in Modern Servers and Enhancements Coming in IceLake – Scalable Tools Workshop, 2018

Background: Tasting SMT

• SMT: two threads sharing a physical core

• Hardware increases core’s net efficiency

- Example: iTLB miss stalls are turned into useful slots for high IPC code (busy-loop)

CoreIPC of 3.7 in one core vs 2.7 in two cores

- See top chart - Measured on Broadwell.

• But.. complicates performance analysis: SMT interference

- Scheduling iTLB-miss kernel induce Frontend (BW) stalls on busy-loop

- These induced stalls do not exist when busy-loop is alone.

And thus cannot be detected by its own (bottom-up) miss events

1%

17%

39%

76%

4.3

3.7

2.7

0.9

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

4.5

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

busyloop busyloop xitlbmiss: one

core

busyloop xitlbmiss: two

cores

itlbmiss

Frontend_Bound Bad_Speculation

Backend_Bound Retiring

CoreIPC

1% 6%

29%

56%

0%

11%

10%

20%

Frontend_Latency Frontend_Bandwidth

Page 4: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

LoadStore

Off-core

BranchPredictor

i-cache

TraditionalInstruction

Decode

Issue

L2 Cache

UopQueue

Frontend

Out Of Order

Memory Subsystem

Sched

uler

Executio

n Po

rts

i-TLB

Uop Cache

Retire

in-order out-of-order

LoadStore

LoadStoreALU

LoadStore

Branch

L1d-cache

d-TLB

SMT thread-arbitration points

Page 5: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

SMT-off SMT-on single-threadSMT-on two threads

Page 6: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

Ahmad Yasin – How TMA Addresses Challenges in Modern Servers and Enhancements Coming in IceLake – Scalable Tools Workshop, 2018

clock 1 2 3 4 5 6 7 8 9 Sum

CPU_CLK_UNHALTED.THREAD: T0 1 1 1 1 1 1 1 7

CPU_CLK_UNHALTED.THREAD: T1 1 1 1 1 1 1 6

13!

CPU_CLK_UNHALTED.CORE: T0 1 1 1 1 0 1 0 - - 5

CPU_CLK_UNHALTED.CORE: T1 - - - 0 1 0 1 1 1 4

9

• Idea: distribute count among active threads in overlapping periods.• For events with threads contention• Aggregate on all threads gives a “core count”.

• Key advantages Per-thread cycle accounting Virtualization friendlier Sampling mode

A new solution: SMT-aware events

• Example events• Core Clockticks (see chart)• TOPDOWN.SLOTS

• Total number of available slots for an unhalted logical processor.

• TOPDOWN.BACKEND_BOUND_SLOTS

• Introduced in Icelake

Page 7: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

New reality

TMA per-Core TMA per-thread

1%

17%

39%

76%

4.3

3.7

2.7

0.9

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

4.5

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

busyloop busyloop x itlbmiss:one core

busyloop x itlbmiss:two cores

itlbmiss

Frontend_Bound Bad_Speculation Backend_Bound

Retiring CoreIPC

Thread0 Thread1

Page 8: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

SMT Performance Analysis Summary

• SMT is (the) key challenge for performance analysis• An overly complex technical area

• SMT-aware events• Universities (William & Mary, Versailles), PNNL Lab and Google liked the approach

• Latency vs. Throughput (likely homogenous work)• How to account when HW prioritizes a non-stalled thread?• For HPC and “native datacenter” users Throughput matters.

• Security remains a concern (Stephane)• The vulnerability is reduced to the shared interval (improved over AnyThread)

• Misc. other areas of interest• Xu: Extended PEBS support non-precise events including SMT-aware new ones• Nathan: Bias in precise load retired samples; Load Latency, SMT-off with retired loads as

backup• Michael and Emmanuel: detailed attributes of various pipelines behavior with SMT

Page 9: A discussion on Performance analysis for SMT · Scalable Tools Workshop Solitude, Utah - July 12th, 2018. Motivation # threads per core Intel Xeon - Skylake 2 ... - Scheduling iTLB-miss

SMT Performance Analysis

• SMT interference example

• SMT-aware events• SE and Nathan (Pacific Northwest Lab) and Emmanuel (U of Versailles) and Xu (U of ) like it.

• Data-centric profiling paper by Xu HPDC?• -> want load latency with SMT enabled.• SW need to increase data-sharing among the two threads.

• Latency vs. Throughput (likely homogenous work)• For HPC users Throughput matters.

• SE: Security• AY: The vulnerability is reduced to the shared interval (instead of full interval with AnyThread

when the spy thread is sleeping)• MC: Can be detected with self-monitoring thread too.• SGX has pretty robust protection of the PMU