Giter Club home page Giter Club logo

energy's Introduction

Energy

Table of contents

...

virtual env -p python3 venv
source venv/bin/activate
pip install -r requeriments.txt
python setup.py install

Example monitor process

from energyOptimal.monitor import monitorProcess
from energyOptimal.cpufreq import cpuFreq
try:
    process= monitorProcess(program_name_= 'example/program.elf', sensor_type_='ipmi')
    args= [['arg1','arg2'],['arg3','arg4'],...]
    thrs= [1]+list(range(2,33,2))

    process.run_dvfs(list_threads= thrs, list_args= args, idle_time= 30,
    verbose=2, save_name='dvfs/{}_complet.pkl'.format(p.program_name))

    # Power and Performance model
    process.run(list_threads= thrs, list_args= args, idle_time= 30,
    verbose=2, save_name='performance/{}_complet.pkl'.format(p.program_name))
except KeyboardInterrupt:
    cpu= cpuFreq()
    cpu.reset()

Example power model

from energyOptimal.powerModel import powerModel

pw_model= powerModel()
# Fit power model
pw_model.loadData(filename='power_model/ipmi_2-32_cpuload.pkl',load_sensors=False)
pw_model.fit()
pw_model.save('ipmi_2-32_cpuload.pw')
# Load power model
pw_model.load('ipmi_2-32_cpuload.pw')

error= pw_model.error()
print("Error, ", error)
print("Power model constants, ", pw_model.power_model_x)
res= pw_model.estimate(pw_model.frequencies, pw_model.threads)
from energyOptimal.performanceModel import performanceModel

en_model= performanceModel()
# Fit model
df= en_model.loadData(filename='performance_model/program.pkl', arg_num=idx)
en_model.fit(C_=10e3,gamma_=0.1)
scores= en_model.crossValidate(method='mpe')
print("CrossValidation ", np.mean(scores)*100, scores)
en_model.saveDataframe('dataframes/program'+l)
en_model.saveSVR('svr/program'+l)

# Load model
df= en_model.loadDataFrame('dataframes/program')
en_model.loadSVR('svr/program')

# Predict
preds= en_model.estimate(df[['freq', 'thr', 'in_cat']].values)

from energyOptimal.energyModel import energyModel

pw_model= powerModel('data/ipmi_2-32_cpuload.pw')
perf_model= performanceModel('dataframes/program', 'svr/program')
en_model= energyModel(pw_model,perf_model)

print(en_model.minimalEnergy())

License

The entire suite is licensed under the GPL v3.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.