-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Hello all,
I reproduced the DRAMgym setup at my end and observed a huge jump in latency numbers (up to 3 orders of magnitude) when one of the parameters is tweaked slightly. I noticed that this is because of using a common scaling factor (1e9) while reporting the observations vector [energy, power, latency] from the DRAMSys simulator.
design point 1:
{'PagePolicy': 'OpenAdaptive', 'Scheduler': 'FrFcfs', 'SchedulerBuffer': 'Shared', 'RequestBufferSize': 1, 'RespQueue': 'Reorder', 'RefreshPolicy': 'NoRefresh', 'RefreshMaxPostponed': 2, 'RefreshMaxPulledin': 2, 'Arbiter': 'Reorder', 'MaxActiveTransactions': 1}
Actual: Total Energy: 432139050.00 pJ', 'DRAMSys.dram0 Average Power: 1002.89 mW', 'DRAMSys.controller0 Total Time: 430895 ns',
Reported: [Environment] Observation: [4.3213905e-01 1.0028900e+00 4.3089500e-04]
design point 2:
{'PagePolicy': 'OpenAdaptive', 'Scheduler': 'FrFcfs', 'SchedulerBuffer': 'Shared', 'RequestBufferSize': 1, 'RespQueue': 'Reorder', 'RefreshPolicy': 'NoRefresh', 'RefreshMaxPostponed': 2, 'RefreshMaxPulledin': 2, 'Arbiter': 'Reorder', 'MaxActiveTransactions': 2}
Actual: Total Energy: 354977775.00 pJ', 'DRAMSys.dram0 Average Power: 1232.55 mW', 'DRAMSys.controller0 Total Time: 288003750 ps',
Reported: [Environment] Observation: [3.54977775e-01 1.23255000e+00 2.88003750e-01]
Though the units are ps, using the same scaling factor 1e9 is causing the latency to be reported as 0.288 sec when it is actually 0.000288 sec
Relevant Code:
line number 66 in oss-arch-gym/arch_gym/envs/DRAMEnv.py
def get_observation(self,outstream):
'''
converts the std out from DRAMSys to observation of energy, power, latency
[Energy (PJ), Power (mW), Latency (ns)]
'''
obs = []
keywords = ["Total Energy", "Average Power", "Total Time"]
energy = re.findall(keywords[0],outstream)
all_lines = outstream.splitlines()
for each_idx in range(len(all_lines)):
if keywords[0] in all_lines[each_idx]:
obs.append(float(all_lines[each_idx].split(":")[1].split()[0])/1e9)
if keywords[1] in all_lines[each_idx]:
obs.append(float(all_lines[each_idx].split(":")[1].split()[0])/1e3)
if keywords[2] in all_lines[each_idx]:
**obs.append(float(all_lines[each_idx].split(":")[1].split()[0])/1e9)**
obs = np.asarray(obs)
print('[Environment] Observation:', obs)
if(len(obs)==0):
print(outstream)
return obs