-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running pinplay to generate EVENT_WARMUP_START #3
Comments
Sniper uses the 'controller' module from Pin/SDE which is described in detail here: https://www.intel.com/content/www/us/en/developer/articles/technical/pintool-regions.html |
Good news. Even though 'wamup-start/stop' events are not documented in the pintool-regions article (that will be fixed soon), the controller does support the events warmup-start and warmup-stop (note a '-', dash, not an '_', underscore). |
[ Thanks to @alenks for the Sniper details. ] |
@hgpatil Thanks a lot for the help! This is very helpful information.
and rewrite the import sim
SIM_USER_ROI = 0x0be0000f
class SimUserROI:
def setup(self, args):
roiscript = sim.config.get_bool('general/roi_script')
if not roiscript:
print '[SimUserROI] ERROR: --roi-script is not set, but is required when using a start instruction count. Aborting'
sim.control.abort()
return
sim.util.register_command(SIM_USER_ROI, self.set_roi)
# Out-of-bound set-roi
def set_roi(self, cmd, arg):
if (arg == 0): # start
print ('[SCRIPT] Start of ROI: beginning ROI')
sim.control.set_roi(True)
elif (arg == 1): # stop
print ('[SCRIPT] End of ROI: beginning ROI')
sim.control.set_roi(False)
elif (arg == 2): # warmup start
print ('[SCRIPT] Start of WARMUP: beginning WARMUP')
sim.control.set_instrumentation_mode(sim.control.WARMUP)
sim.util.register(SimUserROI()) |
However, the sequence these 3 events are generated isn't what I'm expecting... The warmup-start event should come first, but it comes after the event stop. I've attached my log output from Pinplay
The program I'm running is a muli-threaded program. |
Good progress.
|
There is a chance you are using an outdated version of the controller. Here's how the 'openmp' program included was tested for region reachability. export OMP_NUM_THREADS=8 This showed: global icount 540960151 Sim-Start i.e. all the region events are reported in the expected order. |
export SDE_BUILD_KIT=path-to-sde-9.14 |
I was using the SDE 9.14 from sniper package, but I can't build the tool
Is there something I need to include in the path? On the other hand, I do notice sometime the program got deadlock with low CPU utilization while generating bbv for some benchmarks. I suspect it might have something to do with the -fopenmp library. Is there anything I need to pay attention to working with omp programs? Some of the benchmarks I'm running uses omp. Here is all the step I take to generate bbv and start simulation. pin_hook_init and pin_hook_fini are labels I inserted into my benchmarks around the compute phase I'm trying to analyze.
|
./sde-build-GlobalLoopPoint.sh should instruct you about setting PINBALL2ELF That should let you see the file >..>pinball2elf/pintools/PinballSYSState/pinball-sysstate.H |
Thanks a lot. I managed to get it running through my pipeline. It looks great: clusters are generated, and events are triggered in sniper in the right order. I then try to apply the same script and environment to my benchmarks. Unfortunately, I notice sometimes the replayer deadlocks, or no bbv is generated, in the gen bbv step while running my benchmarks which also use openmp. One more thing I want to ask: Some of my benchmarks has long loading stage before the compute stage which I care about starts running. I've inserted assembly labels |
@hgpatil, LoopPoint tools on GitHub is already based on SDE 9.14. The problem @joydddd pointed out initially -- the warmup event occurring after the detailed simulation region -- was with Sniper, right? So, is that working correctly now, @joydddd? The deadlock issue may be happening within the flowcontrol code. You could try running the BBV generation step disabling flowcontrol and see if the issue persists. |
@alenks No, the warmup event occurring after the detailed simulation region issue persists. I don't think the problem is with sniper -- It happened during the simulation phase, but pinplay is responsible for generating the EVENT_START EVENT_WARMUP_START, and EVENT_STOP that trigger sniper to use different simulation modes. Here is the command sniper python script generates to run pin, where pinplay is responsible for generating the -control events, and also the controller logs as attached below. This log shows that pinplay is generating the events in the wrong order:
|
@joydddd Right, so were you able to see the events in the right order using the |
Thanks for the quick reply! I tried using
which is in the expected order. I'll try using sde-9.14 instead of pinplay-3.11 as the sniper frontend and see if that solves the problem. |
@joydddd Some issues were reported while compiling Sniper with SDE-9.14, which haven't been fixed yet. I'd recommend using Pin-3.22 as the Sniper frontend ( |
@alenks Thanks for the suggestion! I used Pin as the frontend the whole time as I didn't need any pinplay-specific features, but I used the image + offset. e.g. A pinpoint I generated would look like
instead of using chain+0x3229, I will test using One more question: I was testing pinplay with another benchmark on a new machine so I had to setup pinplay, pinball2elf, and sde again in the new environment. I run into this error while running
and
Do you have any clues about the error? Thank you so much! Joy |
pinplay-tools was recently updated to support the latest SDE (version 9.21) and it is now the default. SDE 9.21 has some header changes which requires the pinplay-tools update.
|
Thanks! I'll use |
"export CFLAGS=-DOLDSDE" before running sde-build-GlobalLoopPoint.sh should do it. |
I was running through all my benchmarks. Although most benchmarks worked fine, one run into this error while using the sde-global-icount tool:
|
Hi @alenks, thanks you so much for providing that! I'll try using it. |
Hi! Thanks a lot for creating this project. It has been a great help for me to build my simulation pipeline with sniper. I want to know if there is documentation about how to use Pinplay to setup a warmup region for sniper.
My current setup:
I built my pipeline with looppoint. https://github.com/nus-comparch/looppoint
I used my own benchmark and successfully generated mt_pinballs, dcfg, bbv and cluster. The cluster is generated for both roi and warmup region.
Then I start sniper simulation with
where pinplay generates EVENT_START and EVENT_STOP from
-pinplay:control start:address:chain+0x3229:count4329326580:global -pinplay:control stop:address:chain+0x3229:count4456164370:global
and snipersim pinkit will handle these two events and control the simulation.
I want to update the pinplay script so that it also generates EVENT_WARMUP_START at
address:0x3229:3981422787 :global
to trigger sniper handler start a warmup region.The text was updated successfully, but these errors were encountered: