MCPAT output , energystats.py , power.txt

1,115 views
Skip to first unread message

leas63

unread,
Mar 20, 2014, 3:27:35 PM3/20/14
to snip...@googlegroups.com
Hello,

       Looking into "energystats.py" , I see that apart from ("core", "L1-I", "L1-D" , "L2" ), you also register "dram". So I modified stattrace.py to extract the power of "dram" also. I would also like to extract the power of "L3" in the same way, but when I add similar code to that of "dram" , both in "energystats" and "stattrace", I get errors. Can you help me with that?

        Also, I am trying to make sense of the power stats  which are written in three different outputs : 1) power.txt 2) energystats.py 3) the output of mcpat.py in the terminal
       
         Both 2) and 3) are using data from 1 ).

         The data in 3) refer to a single core ,  right ?
 
         Am I right to assume that the data in 3) are calculated using the "power_stack" function in "mcpat.py"? If so, the connection between 1) and 3) is straightforward.

         I cannot understand the connection between 2) and 3). Shouldn't , for example, the L1-I power in 3), be equal to the sum of static+dynamic power for all periods for a single core in 2) ?

          Also, why do we have this line in "energystats":
         
               self.power[('core', core)] = get_power(power['Core'][core]) - (self.power[('L1-I', core)] + self.power[('L1-D', core)] + self.power[('L2', core)])     

          but in the terminal stats the  total core power seems to be the sum of the core-*  components ?


          I sure am missing a lot of things. I hope you can help me. I intended to use the power output of energystats (+L3 +dram) in a thermal simulator, but now I am not sure my thinking is correct.


Thank you very much,

Alex
          
        
       


Wim Heirman

unread,
Mar 20, 2014, 3:46:12 PM3/20/14
to snip...@googlegroups.com
Alex,

What is the exact error you get w.r.t. the L3? Note that McPAT places the L3 outside of the Core structure, so you'll probably need to use get_power(power['Processor']) rather than get_power(power['Core'][core], 'L3/').

The data in 3) is aggregated over all cores.

energystats.py reads power.py, which is generated by mcpat.py and is essentially the same information as what is in power.txt, but parsed into a Python dictionary. energystats therefore does not use the parsing done by power_stack, but has its own parsing of the data from 1) -- so the line from energystats that you posted and the terminal output of mcpat.py are unrelated. Instead, energystats just does a rough breakdown of the Core part of power.txt (which includes L1-I and -D and L2), then subtracts the caches to get only the core.

We've used the energystats output to feed Hotspot, and got pretty interesting results. So what you're planning to do is definitely possible.

Regards,
Wim



--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to
snipersim+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

leas63

unread,
Mar 20, 2014, 5:53:17 PM3/20/14
to snip...@googlegroups.com
I am adding two lines to energystats, both corresponding to what the script does with 'dram ' and 'Processor', all of which are outside the core structure:

1) sim.stats.register('L3', 0, metric, self.get_stat) 

no problem with 1)
     
2) self.power[('L3', 0)] = get_power(power['L3'])

 Command (2) generates the following error:

Traceback (most recent call last):
  File "/home/leas/Diploma/sniper-5.3/scripts/energystats.py", line 102, in get_stat
    self.update()
  File "/home/leas/Diploma/sniper-5.3/scripts/energystats.py", line 90, in update
    self.update_power(power)
  File "/home/leas/Diploma/sniper-5.3/scripts/energystats.py", line 117, in update_power
    self.power[('L3', 0)] = get_power(power['L3'])   
  File "/home/leas/Diploma/sniper-5.3/scripts/energystats.py", line 107, in get_power
    return Power(component[prefix + 'Subthreshold Leakage'] + component[prefix + 'Gate Leakage'], component[prefix + 'Peak Dynamic'])
TypeError: list indices must be integers, not str
227101784  [ 3299]  [ 1]  [py_stats.cc         : 152]  *WARNING* Stats callback: return value must be (convertable into) 64-bit unsigned integer

Wim Heirman

unread,
Mar 21, 2014, 3:44:23 AM3/21/14
to snip...@googlegroups.com
Alex,

Looks like power['L3'] is an array of potentially multiple L3 caches (for private L3 or clustered cache architectures), so the second line should read:

self.power[('L3', 0)] = get_power(power['L3'][0])

This will return power for the first L3 cache. I'm not sure how to cleanly handle the case when there are multiple L3 caches, your script will have to figure out how many there are, either by looking at the length of the power['L3'] array or by reading the configuration (sim.config), and do the appropriate thing.

Regards,
Wim


Message has been deleted
Message has been deleted

leas63

unread,
Mar 30, 2014, 7:44:25 PM3/30/14
to snip...@googlegroups.com
      Also, could you suggest a clean way of setting the temperature of the mcpat input .xml file, every time I want ot run the mcpat.py script. Assuming i.e. thatI I'vestored a temperature value in a file, and I'd like to run the update_energy function using that value in mcpat.

Thanks in advance!

Wim Heirman

unread,
Apr 1, 2014, 4:50:18 PM4/1/14
to snip...@googlegroups.com
Probably the way the voltage is specified (through the power/vdd setting in the configuration file) would be the cleanest?


On 30 March 2014 16:41, leas63 <kord...@gmail.com> wrote:
      Also, could you suggest a clean way of setting the temperature of the mcpat input .xml file, every time I want ot run the mcpat.py script. Assuming i.e. thatI I'vestored a temperature value in a file, and I'd like to run the update_energy function using that value in mcpat.

Thanks in advance!

Τη Πέμπτη, 20 Μαρτίου 2014 9:27:35 μ.μ. UTC+2, ο χρήστης leas63 έγραψε:

leas63

unread,
Apr 3, 2014, 7:32:10 AM4/3/14
to snip...@googlegroups.com
Well, I read in another thread that configuration parameters do not change during a run, but I would like to change the temperature every time I run the partial mcpat.

Wim Heirman

unread,
Apr 3, 2014, 8:50:33 AM4/3/14
to snip...@googlegroups.com
mcpat.py takes a -c parameter that allows you to specify an extra configuration file that overrides settings in sim.cfg. So for each partial run, you can generate a temporary config file with just the temperature setting, and pass that into mcpat.py.

Regards,
Wim

Message has been deleted
Message has been deleted
Message has been deleted

leas63

unread,
Apr 7, 2014, 7:21:47 PM4/7/14
to snip...@googlegroups.com
So I attempted to embed stattrace into energystats. The code runs without errors, the results are relatively close to those that I get when I run the scripts separately, but I am not 100% sure that I put the code segment of stattrace in the 'rightest' place in the energystats script. I have put it ath the end of the update() body. Can you say anything about it, please?


Thanks a lot!
energymerge.py

nazli sp

unread,
Jun 3, 2016, 3:30:19 AM6/3/16
to Sniper simulator
result??
Reply all
Reply to author
Forward
0 new messages