simplify and fix adaptive threshold logic

This commit is contained in:
Christoph Kluge
2026-03-06 10:09:44 +01:00
parent 2c519ab2dc
commit d74465215d
3 changed files with 7 additions and 27 deletions

View File

@@ -234,8 +234,6 @@
cluster={clusterInfos.find((c) => c.name == job.cluster)} cluster={clusterInfos.find((c) => c.name == job.cluster)}
subCluster={job.subCluster} subCluster={job.subCluster}
isShared={job.shared != "none"} isShared={job.shared != "none"}
numhwthreads={job.numHWThreads}
numaccs={job.numAcc}
zoomState={zoomStates[metric.data.name] || null} zoomState={zoomStates[metric.data.name] || null}
thresholdState={thresholdStates[metric.data.name] || null} thresholdState={thresholdStates[metric.data.name] || null}
{plotSync} {plotSync}

View File

@@ -43,8 +43,6 @@
subCluster, subCluster,
isShared = false, isShared = false,
forNode = false, forNode = false,
numhwthreads = 0,
numaccs = 0,
zoomState = null, zoomState = null,
thresholdState = null, thresholdState = null,
extendedLegendData = null, extendedLegendData = null,
@@ -83,9 +81,7 @@
const thresholds = $derived(findJobAggregationThresholds( const thresholds = $derived(findJobAggregationThresholds(
subClusterTopology, subClusterTopology,
metricConfig, metricConfig,
scope, scope
numhwthreads,
numaccs
)); ));
const longestSeries = $derived.by(() => { const longestSeries = $derived.by(() => {
if (useStatsSeries) { if (useStatsSeries) {
@@ -276,9 +272,7 @@
function findJobAggregationThresholds( function findJobAggregationThresholds(
subClusterTopology, subClusterTopology,
metricConfig, metricConfig,
scope, scope
numhwthreads,
numaccs
) { ) {
if (!subClusterTopology || !metricConfig || !scope) { if (!subClusterTopology || !metricConfig || !scope) {
@@ -303,21 +297,13 @@
} }
if (metricConfig?.aggregation == "sum") { if (metricConfig?.aggregation == "sum") {
// Scale Thresholds
let fraction;
if (numaccs > 0) fraction = subClusterTopology.accelerators.length / numaccs;
else if (numhwthreads > 0) fraction = subClusterTopology.core.length / numhwthreads;
else fraction = 1; // Fallback
let divisor; let divisor;
// Exclusive: Fraction = 1; Shared: Fraction > 1 if (scope == 'node') divisor = 1 // Node Scope: Always return unscaled (Maximum Scope)
if (scope == 'node') divisor = fraction; // Partial Scopes: Get from Topologies
// Cap divisor at number of available sockets or domains else if (scope == 'socket') divisor = subClusterTopology.socket.length;
else if (scope == 'socket') divisor = (fraction < subClusterTopology.socket.length) ? subClusterTopology.socket.length : fraction; else if (scope == "memoryDomain") divisor = subClusterTopology.memoryDomain.length;
else if (scope == "memoryDomain") divisor = (fraction < subClusterTopology.memoryDomain.length) ? subClusterTopology.socket.length : fraction;
// Use Maximum Division for Smallest Scopes
else if (scope == "core") divisor = subClusterTopology.core.length; else if (scope == "core") divisor = subClusterTopology.core.length;
else if (scope == "hwthread") divisor = subClusterTopology.core.length; // alt. name for core else if (scope == "hwthread") divisor = subClusterTopology.node.length;
else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length; else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length;
else { else {
console.log('Unknown scope, return default aggregation thresholds for sum', scope) console.log('Unknown scope, return default aggregation thresholds for sum', scope)

View File

@@ -178,8 +178,6 @@
timestep={selectedData.timestep} timestep={selectedData.timestep}
scope={selectedScope} scope={selectedScope}
metric={metricName} metric={metricName}
numaccs={job.numAcc}
numhwthreads={job.numHWThreads}
series={selectedSeries} series={selectedSeries}
{isShared} {isShared}
{zoomState} {zoomState}
@@ -194,8 +192,6 @@
timestep={selectedData.timestep} timestep={selectedData.timestep}
scope={selectedScope} scope={selectedScope}
metric={metricName} metric={metricName}
numaccs={job.numAcc}
numhwthreads={job.numHWThreads}
series={selectedSeries} series={selectedSeries}
{isShared} {isShared}
{zoomState} {zoomState}