New size on start and removed paths

This commit is contained in:
Eduardo Cueto-Mendoza 2023-07-11 14:12:23 +01:00
parent ceecd79c7a
commit 43aae48415
4 changed files with 19 additions and 16 deletions

View File

@ -1,4 +1,5 @@
#!/bin/env bash
powerstat -D -z 0.5 10000000 > $1
#powerstat -z 0.5 1000000 > $1
sudo powerstat -D -z 0.5 10000000 > $1
#sudo powerstat -D -z 0.5 10000000 > $1

View File

@ -24,7 +24,7 @@ with (open("configuration.pkl", "rb")) as file:
# CUDA settings
device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def getModel(net_type, inputs, outputs, priors, layer_type, activation_type):
@ -196,6 +196,7 @@ if __name__ == '__main__':
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Initial Time =", current_time)
print("Using bayesian model of size: {}".format(cfg["model"]["size"]))
run(cfg["data"], cfg["model"]["net_type"])
now = datetime.now()
current_time = now.strftime("%H:%M:%S")

View File

@ -21,7 +21,7 @@ with (open("configuration.pkl", "rb")) as file:
break
# CUDA settings
device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def getModel(net_type, inputs, outputs, wide=cfg["model"]["size"]):
@ -143,6 +143,7 @@ if __name__ == '__main__':
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Initial Time =", current_time)
print("Using frequentist model of size: {}".format(cfg["model"]["size"]))
run(cfg["data"], cfg["model"]["net_type"])
now = datetime.now()
current_time = now.strftime("%H:%M:%S")

View File

@ -2,7 +2,7 @@ import psutil
import pickle
import arguments
from time import sleep
from pathlib import Path
#from pathlib import Path
import subprocess as sub
from arguments import makeArguments
@ -94,22 +94,22 @@ cpu_watt = "cpu_watt.sh"
ram = "mem_free.sh"
gpu = "radeontop.sh"
path_cpu_watt = Path(cpu_watt)
path_ram = Path(ram)
path_gpu = Path(gpu)
#path_cpu_watt = Path(cpu_watt)
#path_ram = Path(ram)
#path_gpu = Path(gpu)
path_cpu_watt = str(Path(cpu_watt).absolute()) + '/' + cpu_watt
path_ram = str(Path(ram).absolute()) + '/' + ram
path_gpu = str(Path(gpu).absolute()) + '/' + gpu
#path_cpu_watt = str(Path(cpu_watt).absolute()) + '/' + cpu_watt
#path_ram = str(Path(ram).absolute()) + '/' + ram
#path_gpu = str(Path(gpu).absolute()) + '/' + gpu
if cmd[1] == "main_frequentist.py":
cmd2 = [path_cpu_watt, "freq_{}_cpu_watts".format(wide)]
cmd3 = [path_ram, "freq_{}_ram_use".format(wide)]
cmd4 = [path_gpu, "freq_{}_flop_app".format(wide)]
cmd2 = ['./'+cpu_watt, "freq_{}_cpu_watts".format(wide)]
cmd3 = ['./'+ram, "freq_{}_ram_use".format(wide)]
cmd4 = ['./'+gpu, "freq_{}_flop_app".format(wide)]
elif cmd[1] == "main_bayesian.py":
cmd2 = [path_cpu_watt, "bayes_{}_cpu_watts".format(wide)]
cmd3 = [path_ram, "bayes_{}_ram_use".format(wide)]
cmd4 = [path_gpu, "bayes_{}_flop_app".format(wide)]
cmd2 = ['./'+cpu_watt, "bayes_{}_cpu_watts".format(wide)]
cmd3 = ['./'+ram, "bayes_{}_ram_use".format(wide)]
cmd4 = ['./'+gpu, "bayes_{}_flop_app".format(wide)]
path = sub.check_output(['pwd'])