Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

sustainable-computing-io/kepler-estimator

Repository files navigation

Kepler Estimator

Kepler estimator is a client module to kepler model server running as a sidecar of Kepler exporter.

This python will serve a PowerReequest from model package in Kepler exporter as defined in estimator.go via unix domain socket /tmp/estimator.sock.

type PowerRequest struct {
    ModelName       string      `json:"model_name"`
    MetricNames     []string    `json:"metrics"`
    ContainerMetricValues [][]float32 `json:"values"`
    CorePower       []float32   `json:"core_power"`
    DRAMPower       []float32   `json:"dram_power"`
    UncorePower     []float32   `json:"uncore_power"`
    PkgPower        []float32   `json:"pkg_power"`
    GPUPower        []float32   `json:"gpu_power"`
    SelectFilter    string      `json:"filter"`
}

Patch estimator sidecar to Kepler DaemonSet

kubectl patch daemonset kepler-exporter --patch-file deploy/patch.yaml

Local test

  1. single process
python src/estimator_test.py
  1. server-client test
python src/estimator.py & \
until [ -e /tmp/estimator.sock ]; do sleep 1; done \
&& python src/estimator_client.py \
&& kill $(ps -eaf|grep "python src/estimator.py" -m 1|awk '{print $2}') 2> /dev/null