Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
1e4aa6c1
Commit
1e4aa6c1
authored
Aug 20, 2019
by
Carla Guillen Carias
Browse files
New derived metrics
parent
5d4b2271
Changes
5
Hide whitespace changes
Inline
Side-by-side
analytics/operators/smucngperf/SKXPMUMetrics.cpp
View file @
1e4aa6c1
...
...
@@ -52,10 +52,10 @@ bool calculatePackedFlops(reading_t & packedDP128, reading_t & packedSP128,
return
getTimestampFromReadings
(
result
.
timestamp
,
packedDP128
,
packedSP128
,
packedDP256
,
packedSP256
,
packedDP512
,
packedSP512
);
}
bool
calculateVectorizationRat
e
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
bool
calculateVectorizationRat
io
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
result
)
{
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
)
{
float
denominator
=
static_cast
<
float
>
(
scalarDB
.
value
+
scalarSP
.
value
+
packedDP128
.
value
+
packedSP128
.
value
+
packedDP256
.
value
+
packedSP256
.
value
+
...
...
@@ -72,7 +72,7 @@ bool calculateVectorizationRate(reading_t & scalarDB, reading_t & scalarSP,
bool
calculateAVX512FlopsToVectorizedRatio
(
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
){
float
denominator
=
static_cast
<
float
>
(
packedDP128
.
value
+
packedSP128
.
value
+
packedDP256
.
value
+
packedSP256
.
value
+
...
...
@@ -88,7 +88,7 @@ bool calculateAVX512FlopsToVectorizedRatio(reading_t & packedDP128, reading_t &
bool
calculateSP_TO_TOTAL_RATIO
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
){
auto
single_precision
=
packedSP128
.
value
*
4
+
packedSP256
.
value
*
8
+
packedSP512
.
value
*
16
+
scalarSP
.
value
;
...
...
@@ -102,6 +102,16 @@ bool calculateSP_TO_TOTAL_RATIO(reading_t &scalarDB, reading_t & scalarSP,
return
false
;
}
bool
calculateL3HitToL3MissRatio
(
reading_t
&
l3_misses
,
reading_t
&
l3_load_hits
,
reading_t
&
l3_load_misses
,
reading_t
&
result
,
unsigned
int
scaling_factor
){
float
denominator
=
static_cast
<
float
>
(
l3_load_hits
.
value
+
l3_load_misses
.
value
);
if
(
denominator
>
0
){
result
.
value
=
(
l3_misses
.
value
/
denominator
)
*
scaling_factor
;
return
getTimestampFromReadings
(
result
.
timestamp
,
l3_misses
,
l3_load_hits
,
l3_load_misses
);
}
return
false
;
}
bool
calculateMemoryBandwidth
(
std
::
vector
<
reading_t
>
membw_counts
,
reading_t
&
result
)
{
result
.
value
=
0
;
const
unsigned
int
SIZEPERACCESS
=
64
;
...
...
analytics/operators/smucngperf/SKXPMUMetrics.h
View file @
1e4aa6c1
...
...
@@ -28,7 +28,7 @@
#ifndef ANALYTICS_ANALYZERS_SMUCNGPERFANALYZER_SKXDERIVEDMETRICS_SKXPMUMETRICS_H_
#define ANALYTICS_ANALYZERS_SMUCNGPERFANALYZER_SKXDERIVEDMETRICS_SKXPMUMETRICS_H_
#include
<vector>
#include
"
../../../../common/include/
cacheentry.h"
#include
"cacheentry.h"
bool
calculateFlops
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
...
...
@@ -44,20 +44,23 @@ bool calculatePackedFlops(reading_t & packedDP128, reading_t & packedSP128,
bool
calculateVectorizationRatio
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
result
);
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
);
bool
calculateAVX512FlopsToVectorizedRatio
(
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
);
bool
calculateSP_TO_TOTAL_RATIO
(
reading_t
&
scalarDB
,
reading_t
&
scalarSP
,
reading_t
&
packedDP128
,
reading_t
&
packedSP128
,
reading_t
&
packedDP256
,
reading_t
&
packedSP256
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
reading_t
&
packedDP512
,
reading_t
&
packedSP512
,
unsigned
int
scaling_factor
,
reading_t
&
result
);
bool
calculateL3HitToL3MissRatio
(
reading_t
&
l3_misses
,
reading_t
&
l3_load_hits
,
reading_t
&
l3_load_misses
,
reading_t
&
result
,
unsigned
int
scaling_factor
);
bool
calculateMemoryBandwidth
(
std
::
vector
<
reading_t
>
membw_counts
,
reading_t
&
result
);
#endif
/* ANALYTICS_ANALYZERS_SMUCNGPERFANALYZER_SKXDERIVEDMETRICS_SKXPMUMETRICS_H_ */
analytics/operators/smucngperf/SMUCNGPerfOperator.cpp
View file @
1e4aa6c1
...
...
@@ -78,7 +78,7 @@ void SMUCNGPerfOperator::printConfig(LOG_LEVEL ll) {
void
SMUCNGPerfOperator
::
compute
(
U_Ptr
unit
)
{
auto
inputs
=
unit
->
getInputs
();
auto
timestamp
=
getTimestamp
()
-
10e9
;
//ToDo timestamp minus some time...
auto
timestamp
=
getTimestamp
()
-
10e9
;
for
(
auto
&
outSensor
:
unit
->
getOutputs
()){
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
CPI
)
{
computeCPI
(
inputs
,
outSensor
,
timestamp
);
...
...
@@ -88,6 +88,20 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
outSensor
->
getMetric
()
==
SMUCSensorBase
::
AVX512_TOVECTORIZED_RATIO
||
outSensor
->
getMetric
()
==
SMUCSensorBase
::
VECTORIZED_RATIO
||
outSensor
->
getMetric
()
==
SMUCSensorBase
::
SINGLE_PRECISION_TO_TOTAL_RATIO
)
{
computeFLOPS
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
L3_TO_INSTRUCTIONS_RATIO
){
computeL3_TO_INSTRUCTIONS_RATIO
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
L3HIT_TO_L3MISS_RATIO
){
computeL3HIT_TO_L3MISS_RATIO
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
LOADS_TO_STORES
){
computeLOADS_TO_STORES
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
LOADS_TOL3MISS_RATIO
){
computeLOADS_TOL3MISS_RATIO
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
BRANCH_PER_INSTRUCTIONS
){
computeBRANCH_PER_INSTRUCTIONS
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
MISSBRANCHES_TO_TOTAL_BRANCH_RATIO
){
computeMISSBRANCHES_TO_TOTAL_BRANCH_RATIO
(
inputs
,
outSensor
,
timestamp
);
}
else
if
(
outSensor
->
getMetric
()
==
SMUCSensorBase
::
MEMORY_BANDWIDTH
)
{
computeMEMORY_BANDWIDTH
(
inputs
,
outSensor
,
timestamp
);
}
resetBuffers
();
}
...
...
@@ -172,21 +186,20 @@ void SMUCNGPerfOperator::computeFLOPS(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr&
}
else
if
(
flop_metric
==
SMUCSensorBase
::
VECTORIZED_RATIO
)
{
if
(
calculateVectorizationRatio
(
scalar_double
,
scalar_single
,
packed128_double
,
packed128_single
,
packed256_double
,
packed256_single
,
packed512_double
,
packed512_single
,
result
))
{
packed512_double
,
packed512_single
,
outSensor
->
getScalingFactor
(),
result
))
{
outSensor
->
storeReading
(
result
);
}
}
else
if
(
flop_metric
==
SMUCSensorBase
::
AVX512_TOVECTORIZED_RATIO
)
{
if
(
calculateAVX512FlopsToVectorizedRatio
(
packed128_double
,
packed128_single
,
packed256_double
,
packed256_single
,
packed512_double
,
packed512_single
,
result
))
{
packed512_double
,
packed512_single
,
outSensor
->
getScalingFactor
(),
result
))
{
outSensor
->
storeReading
(
result
);
}
}
else
if
(
flop_metric
==
SMUCSensorBase
::
SINGLE_PRECISION_TO_TOTAL_RATIO
)
{
if
(
calculateSP_TO_TOTAL_RATIO
(
scalar_double
,
scalar_single
,
packed128_double
,
packed128_single
,
packed256_double
,
packed256_single
,
packed512_double
,
packed512_single
,
result
)){
packed512_double
,
packed512_single
,
outSensor
->
getScalingFactor
(),
result
)){
outSensor
->
storeReading
(
result
);
}
}
}
...
...
@@ -199,6 +212,14 @@ void SMUCNGPerfOperator::computeFLOPS(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr&
void
SMUCNGPerfOperator
::
computeL3_TO_INSTRUCTIONS_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
l3_misses
=
_buffers
[
0
];
std
::
vector
<
reading_t
>
&
instructions
=
_buffers
[
1
];
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_LOAD_UOPS_RETIRED_L3_MISS
]]
->
getName
(),
timestamp
,
l3_misses
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
INSTRUCTIONS
]]
->
getName
(),
timestamp
,
instructions
);
reading_t
l3toinstrRatio
;
if
(
instructions
.
size
()
>
0
&&
l3_misses
.
size
()
>
0
&&
calculateMetricRatio
(
instructions
[
0
],
l3_misses
[
0
],
outSensor
->
getScalingFactor
(),
l3toinstrRatio
))
{
outSensor
->
storeReading
(
l3toinstrRatio
);
}
}
void
SMUCNGPerfOperator
::
computeL3_BANDWIDTH
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
...
...
@@ -207,23 +228,71 @@ void SMUCNGPerfOperator::computeL3_BANDWIDTH(std::vector<SMUCNGPtr>& inputs, SMU
void
SMUCNGPerfOperator
::
computeL3HIT_TO_L3MISS_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
//MEM_LOAD_UOPS_RETIRED_L3_MISS/(MEM_LOAD_RETIRED_L3_HIT+MEM_LOAD_RETIRED_L3_MISS
std
::
vector
<
reading_t
>
&
l3_misses
=
_buffers
[
0
];
std
::
vector
<
reading_t
>
&
l3_hits
=
_buffers
[
1
];
std
::
vector
<
reading_t
>
&
l3_load_miss
=
_buffers
[
2
];
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_LOAD_UOPS_RETIRED_L3_MISS
]]
->
getName
(),
timestamp
,
l3_misses
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_LOAD_RETIRED_L3_HIT
]]
->
getName
(),
timestamp
,
l3_hits
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_LOAD_RETIRED_L3_MISS
]]
->
getName
(),
timestamp
,
l3_load_miss
);
reading_t
l3hitToMissRatio
;
if
(
l3_misses
.
size
()
>
0
&&
l3_hits
.
size
()
>
0
&&
l3_load_miss
.
size
()
>
0
&&
calculateL3HitToL3MissRatio
(
l3_misses
[
0
],
l3_hits
[
0
],
l3_load_miss
[
0
],
l3hitToMissRatio
,
outSensor
->
getScalingFactor
()))
{
outSensor
->
storeReading
(
l3hitToMissRatio
);
}
}
void
SMUCNGPerfOperator
::
computeLOADS_TO_STORES
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
loads
=
_buffers
[
0
];
std
::
vector
<
reading_t
>
&
stores
=
_buffers
[
1
];
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_INST_RETIRED_ALL_LOADS
]]
->
getName
(),
timestamp
,
loads
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_INST_RETIRED_ALL_STORES
]]
->
getName
(),
timestamp
,
stores
);
reading_t
loadToStoreRatio
;
if
(
loads
.
size
()
>
0
&&
stores
.
size
()
>
0
&&
calculateMetricRatio
(
loads
[
0
],
stores
[
0
],
outSensor
->
getScalingFactor
(),
loadToStoreRatio
)){
outSensor
->
storeReading
(
loadToStoreRatio
);
}
}
void
SMUCNGPerfOperator
::
computeLOADS_TOL3MISS_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
loads
=
_buffers
[
0
];
std
::
vector
<
reading_t
>
&
l3_misses
=
_buffers
[
1
];
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_INST_RETIRED_ALL_LOADS
]]
->
getName
(),
timestamp
,
loads
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
MEM_LOAD_UOPS_RETIRED_L3_MISS
]]
->
getName
(),
timestamp
,
l3_misses
);
reading_t
loads_to_l3misses
;
if
(
loads
.
size
()
>
0
&&
l3_misses
.
size
()
>
0
&&
calculateMetricRatio
(
loads
[
0
],
l3_misses
[
0
],
outSensor
->
getScalingFactor
(),
loads_to_l3misses
))
{
outSensor
->
storeReading
(
loads_to_l3misses
);
}
}
void
SMUCNGPerfOperator
::
computeBRANCH_PER_INSTRUCTIONS
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
)
{
void
SMUCNGPerfOperator
::
computeBRANCH_PER_INSTRUCTIONS
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
missedbranches
;
std
::
vector
<
reading_t
>
&
instructions
;
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
PERF_COUNT_HW_BRANCH_MISSES
]]
->
getName
(),
timestamp
,
missedbranches
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
INSTRUCTIONS
]]
->
getName
(),
timestamp
,
instructions
);
reading_t
branchPerInstructions
;
if
(
missedbranches
.
size
()
>
0
&&
instructions
.
size
()
>
0
&&
calculateMetricRatio
(
missedbranches
[
0
],
instructions
[
0
],
outSensor
->
getScalingFactor
(),
branchPerInstructions
))
{
outSensor
->
storeReading
(
branchPerInstructions
);
}
}
void
SMUCNGPerfOperator
::
computeMISSBRANCHES_TO_TOTAL_BRANCH_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
missedbranches
;
std
::
vector
<
reading_t
>
&
totalbranches
;
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
PERF_COUNT_HW_BRANCH_MISSES
]]
->
getName
(),
timestamp
,
missedbranches
);
query
(
inputs
[
_metricToPosition
[
SMUCSensorBase
::
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
]]
->
getName
(),
timestamp
,
totalbranches
);
reading_t
missbranchesPerTotal
;
if
(
missedbranches
.
size
()
>
0
&&
totalbranches
.
size
()
>
0
&&
calculateMetricRatio
(
missedbranches
[
0
],
totalbranches
[
0
],
outSensor
->
getScalingFactor
(),
missbranchesPerTotal
)){
outSensor
->
storeReading
(
missbranchesPerTotal
);
}
}
void
SMUCNGPerfOperator
::
computeMEMORY_BANDWIDTH
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
)
{
std
::
vector
<
reading_t
>
&
mem_counters
;
//ToDo how do I get them?
}
analytics/operators/smucngperf/SMUCNGPerfOperator.h
View file @
1e4aa6c1
...
...
@@ -67,7 +67,7 @@ protected:
//void computeINSTRUCTIONS_PER_SECOND(SMUCNGPtr &outSensor, const uint64_t timestamp);
void
computeFLOPS
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
void
computeEXPENSIVE_INSTRUCTIONS_PER_SECOND
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
//
void computeEXPENSIVE_INSTRUCTIONS_PER_SECOND(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr &outSensor, const uint64_t timestamp);
//void computeINSTR_INTRA_NODE_LOADIMBALANCE(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr &outSensor, const uint64_t timestamp);
//void computeINSTR_INTER_NODE_LOADIMBALANCE((SMUCNGPtr &outSensor); //needs to be donejob plugin
//void computeL2_HITS_PER_SECOND(SMUCNGPtr &outSensor, const uint64_t timestamp);
...
...
@@ -80,7 +80,7 @@ protected:
void
computeLOADS_TO_STORES
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
void
computeLOADS_TOL3MISS_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
//void computeMISSBRANCHES_PER_SECOND(SMUCNGPtr &outSensor, const uint64_t timestamp);
void
computeBRANCH_PER_INSTRUCTIONS
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
);
void
computeBRANCH_PER_INSTRUCTIONS
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
void
computeMISSBRANCHES_TO_TOTAL_BRANCH_RATIO
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
void
computeMEMORY_BANDWIDTH
(
std
::
vector
<
SMUCNGPtr
>&
inputs
,
SMUCNGPtr
&
outSensor
,
const
uint64_t
timestamp
);
};
...
...
analytics/operators/smucngperf/SMUCSensorBase.h
View file @
1e4aa6c1
...
...
@@ -62,8 +62,9 @@ public:
FP_ARITH_512B_PACKED_SINGLE
,
MEM_INST_RETIRED_ALL_LOADS
,
MEM_INST_RETIRED_ALL_STORES
,
PERF_COUNT_HW_CACHE_REFERENCES
,
PERF_COUNT_HW_CACHE_MISSES
,
MEM_LOAD_UOPS_RETIRED_L3_MISS
,
MEM_LOAD_RETIRED_L3_HIT
,
MEM_LOAD_RETIRED_L3_MISS
,
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
,
PERF_COUNT_HW_BRANCH_MISSES
,
CORE_TEMPERATURE
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment