Skip to content

Commit 195609c

Browse files
author
Sunil Thaha
authored
Merge pull request #388 from sthaha/chore-hatch-fmt
chore: hatch fmt to format all source to 120 char width
2 parents d14240f + 7cc18be commit 195609c

File tree

86 files changed

+1191
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1191
-586
lines changed

cmd/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# -*- coding: utf-8 -*-
44
import re
55
import sys
6+
67
from kepler_model.cmd.main import run
78

89
if __name__ == "__main__":

manifests/compose/dev/compose.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: model-dev
2+
services:
3+
kepler:
4+
image: quay.io/sustainable_computing_io/kepler:latest
5+
ports:
6+
- 9100:9100
7+
privileged: true
8+
pid: host
9+
networks:
10+
- kepler-network
11+
- model-server-network
12+
volumes:
13+
- type: bind
14+
source: /proc
15+
target: /proc
16+
# - type: bind
17+
# source: /sys
18+
# target: /sys
19+
- type: bind
20+
source: ./kepler/etc/kepler
21+
target: /etc/kepler
22+
23+
# NOTE: use the models from the local repo
24+
- type: bind
25+
source: ./kepler/var/lib/kepler/data/model_weight/
26+
target: /var/lib/kepler/data
27+
- type: bind
28+
source: ./kepler/var/lib/kepler/data/cpus.yaml
29+
target: /var/lib/kepler/data/cpus.yaml
30+
31+
# NOTE: for estimator - kepler communication
32+
- kepler-tmp:/tmp
33+
34+
healthcheck:
35+
test: curl -f http://localhost:9100/metrics || exit 1
36+
interval: ${HEALTHCHECK_INTERVAL:-50s}
37+
timeout: ${HEALTHCHECK_TIMEOUT:-30s}
38+
retries: ${HEALTHCHECK_RETRIES:-3}
39+
start_period: ${HEALTHCHECK_START_PERIOD:-1m}
40+
41+
cap_add:
42+
- ALL
43+
44+
entrypoint:
45+
- /usr/bin/bash
46+
- -c
47+
48+
command:
49+
- |
50+
echo "Waiting for model-server";
51+
until [[ "$(curl -s -o /dev/null -w "%{http_code}" http://model-server:8100/best-models)" -eq 200 ]]; do
52+
echo " ... waiting for model-server";
53+
sleep 1;
54+
done;
55+
56+
echo "Waiting for estimator socket";
57+
until [[ -e /tmp/estimator.sock ]]; do
58+
echo " ... waiting for estimator socket";
59+
sleep 1;
60+
done;
61+
62+
echo "starting kepler";
63+
set -x;
64+
/usr/bin/kepler \
65+
-address="0.0.0.0:9100" \
66+
-v="8"
67+
68+
estimator:
69+
command: [estimator, -l, debug ]
70+
build: &build
71+
context: ../../../
72+
dockerfile: dockerfiles/Dockerfile
73+
74+
volumes:
75+
- type: bind
76+
source: ./kepler/etc/kepler
77+
target: /etc/kepler
78+
79+
- kepler-tmp:/tmp
80+
- estimator-mnt:/mnt
81+
networks:
82+
- kepler-network
83+
- model-server-network
84+
85+
model-server:
86+
ports:
87+
- '8100:8100'
88+
command: [model-server, -l, debug ]
89+
build:
90+
<<: *build
91+
volumes:
92+
- type: bind
93+
source: ./kepler/etc/kepler
94+
target: /etc/kepler
95+
- model-server-mnt:/mnt
96+
networks:
97+
- model-server-network
98+
99+
volumes:
100+
# for kepler - estimator sock
101+
kepler-tmp:
102+
103+
# for downloading models
104+
estimator-mnt:
105+
model-server-mnt:
106+
107+
networks:
108+
kepler-network:
109+
model-server-network:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NODE_TOTAL_ESTIMATOR=true
2+
NODE_TOTAL_INIT_URL=https://raw.githubusercontent.com/sustainable-computing-io/kepler-model-db/main/models/v0.7/specpower-0.7.11/acpi/AbsPower/BPFOnly/GradientBoostingRegressorTrainer_0.zip
3+
NODE_COMPONENTS_ESTIMATOR=true
4+
NODE_COMPONENTS_INIT_URL=https://raw.githubusercontent.com/sustainable-computing-io/kepler-model-db/main/models/v0.7/ec2-0.7.11/rapl-sysfs/AbsPower/BPFOnly/GradientBoostingRegressorTrainer_0.zip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http://model-server:8100
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
##########
2+
# CPUS - used to lookup uarch and channels by family, model, and stepping
3+
# The model and stepping fields will be interpreted as regular expressions
4+
# An empty stepping field means 'any' stepping
5+
6+
##########
7+
# Intel Core CPUs
8+
##########
9+
# Haswell
10+
- core: HSW
11+
uarch: Haswell
12+
family: 6
13+
model: (50|69|70)
14+
stepping:
15+
16+
# Broadwell
17+
- core: BDW
18+
uarch: Broadwell
19+
family: 6
20+
model: (61|71)
21+
stepping:
22+
23+
# Skylake
24+
- core: SKL
25+
uarch: Skylake
26+
family: 6
27+
model: (78|94)
28+
stepping:
29+
30+
# Kabylake
31+
- core: KBL
32+
uarch: Kaby Lake
33+
family: 6
34+
model: (142|158)
35+
stepping: 9
36+
37+
# Coffelake
38+
- core: CFL
39+
uarch: Coffee Lake
40+
family: 6
41+
model: (142|158)
42+
stepping: (10|11|12|13)
43+
44+
# Rocket Lake
45+
- core: RKL
46+
uarch: Cypress Cove
47+
family: 6
48+
model: 167
49+
stepping:
50+
51+
# Tiger Lake
52+
- core: TGL
53+
uarch: Willow Cove
54+
family: 6
55+
model: (140|141)
56+
stepping:
57+
58+
# Alder Lake
59+
- core: ADL
60+
uarch: Golden Cove
61+
family: 6
62+
model: (151|154)
63+
stepping:
64+
65+
# Raptor Lake
66+
- core: RTL
67+
uarch: Raptor Cove
68+
family: 6
69+
model: 183
70+
stepping:
71+
72+
##########
73+
# Intel Xeon CPUs
74+
##########
75+
# Haswell
76+
- core: HSX
77+
uarch: Haswell
78+
family: 6
79+
model: 63
80+
stepping:
81+
82+
# Broadwell
83+
- core: BDX
84+
uarch: Broadwell
85+
family: 6
86+
model: (79|86)
87+
stepping:
88+
89+
# Skylake
90+
- core: SKX
91+
uarch: Skylake
92+
family: 6
93+
model: 85
94+
stepping: (0|1|2|3|4)
95+
96+
# Cascadelake
97+
- core: CLX
98+
uarch: Cascade Lake
99+
family: 6
100+
model: 85
101+
stepping: (5|6|7)
102+
103+
# Cooperlake
104+
- core: CPX
105+
uarch: Cooper Lake
106+
family: 6
107+
model: 85
108+
stepping: 11
109+
110+
# Icelake
111+
- core: ICX
112+
uarch: Sunny Cove
113+
family: 6
114+
model: (106|108)
115+
stepping:
116+
117+
# Sapphire Rapids
118+
- core: SPR
119+
uarch: Sapphire Rapids
120+
family: 6
121+
model: 143
122+
stepping:
123+
124+
# Emerald Rapids
125+
- core: EMR
126+
uarch: Emerald Rapids
127+
family: 6
128+
model: 207
129+
stepping:
130+
131+
# Granite Rapids
132+
- core: GNR
133+
uarch: Granite Rapids
134+
family: 6
135+
model: 173
136+
stepping:
137+
138+
# Sierra Forest
139+
- core: SRF
140+
uarch: Sierra Forest
141+
family: 6
142+
model: 175
143+
stepping:
144+
145+
##########
146+
# AMD CPUs
147+
##########
148+
# Naples
149+
- core: Naples
150+
uarch: Zen
151+
family: 23
152+
model: 1
153+
stepping:
154+
155+
# Rome
156+
- core: Rome
157+
uarch: Zen 2
158+
family: 23
159+
model: 49
160+
stepping:
161+
162+
# Milan
163+
- core: Milan
164+
uarch: Zen 3
165+
family: 25
166+
model: 1
167+
stepping:
168+
169+
# Genoa
170+
- core: Genoa
171+
uarch: Zen 4
172+
family: 25
173+
model: 17
174+
stepping:
175+
176+
# Siena
177+
- core: Siena
178+
uarch: Zen 4c
179+
family: 25
180+
model: 160
181+
stepping:
182+
183+
##########
184+
# ARM CPUs
185+
#########
186+
# AWS Graviton 2
187+
- core: Ares
188+
uarch: neoverse_n1
189+
family:
190+
model: 1
191+
stepping: r3p1
192+
193+
# AWS Graviton 3
194+
- core: Zeus
195+
uarch: neoverse_v1
196+
family:
197+
model: 1
198+
stepping: r1p1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"platform": {"All_Weights": {"Bias_Weight": 220.9079278650894, "Categorical_Variables": {}, "Numerical_Variables": {"bpf_cpu_time_ms": {"scale": 5911.969193263386, "mean": 0, "variance": 0, "weight": 29.028228361462897}}}}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"platform": {"All_Weights": {"Bias_Weight": 49.56491877218095, "Categorical_Variables": {}, "Numerical_Variables": {"bpf_cpu_time_ms": {"scale": 5911.969193263386, "mean": 0, "variance": 0, "weight": 28.501356366108837}}}}}

0 commit comments

Comments
 (0)