task scheduler

295 views
Skip to first unread message

molly

unread,
Mar 23, 2017, 9:51:57 AM3/23/17
to gem5-gpu Developers List
Hello, 

I would like to look at the code related to the task scheduling in the gem5-gpu system.
But I gem5 and gem5-gpu catalog to see a lot of schedule (), I would like to ask where the relevant code?

Thank you 
molly

Jason Lowe-Power

unread,
Mar 23, 2017, 9:58:00 AM3/23/17
to molly, gem5-gpu Developers List
Hi Molly,

The "schedule()" function in gem5 is used to schedule *simulator* events in the event queue to support the discrete event simulator. This has nothing to do with the GPU programming model or OS scheduler. If you want to modify the OS scheduler you should modify the Linux kernel. If you are interested in the GPU programming model, you should start with the benchmarks and the associated runtime in benchmarks/.

Jason

molly

unread,
Mar 23, 2017, 9:51:29 PM3/23/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason
 

     The cmd is ' build/X86_VI_hammer_GPU/gem5.opt ../gem5-gpu/configs/se_fusion.py -c ../benchmarks/rodinia/backprop/gem5_fusion_backprop -o 16 -n 3'

     The benchmark program is loaded into this heterogeneous multi-core simulator with num-cpu 3, cluster is the default.
     I looked at config.ini, cpu0.workload, cpu1.workload, cpu2.workload are / benchmarks / rodinia / backprop / gem5_fusion_backprop.

     How does this program break down into subnormal tasks and assign them to the appropriate kernel?


Thank you 
molly
在 2017年3月23日星期四 UTC+8下午9:58:00,Jason Lowe-Power写道:

Jason Lowe-Power

unread,
Mar 24, 2017, 11:18:36 AM3/24/17
to molly, gem5-gpu Developers List
Hi Molly,

The command that you are using is only running a single application with a single thread on the CPU (the binary gem5_fusion_backprop). This application launches a GPU kernel, which executes on the GPU hardware. You can read through the backprop code to see exactly how it launches the GPU kernel.

Jason

molly

unread,
Mar 24, 2017, 11:43:32 AM3/24/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason
   a single thread?Are you saying that in this command line, only one cpu is working and launches the GPU kernel?

Molly
在 2017年3月24日星期五 UTC+8下午11:18:36,Jason Lowe-Power写道:

Jason Lowe-Power

unread,
Mar 24, 2017, 12:41:33 PM3/24/17
to molly, gem5-gpu Developers List

Yes.

molly

unread,
Mar 25, 2017, 8:54:37 AM3/25/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason,
    I'm a little confused.
    1. a cpu is responsible for an application
    2. start gpu kernel is determined by the test program, such as the test program is spec2006, this will not start gpu, if the test is a benchmark, it will start gpu.
        If I want to see the difference, I should look at spec2006 and benchmark code
   3. gem5-gpu only supports a gpu, in the command line can only add a benchmark program, such as / benchmark / rodinia / backprop / gem5_fusion_backprop

   Is it right?
在 2017年3月25日星期六 UTC+8上午12:41:33,Jason Lowe-Power写道:

Jason Lowe-Power

unread,
Mar 27, 2017, 10:36:49 AM3/27/17
to molly, gem5-gpu Developers List
Hi Molly,

First, let's talk about gem5, not gem5-gpu. gem5 is the basis of gem5-gpu. Everything you can do in gem5, you can do in gem5-gpu.

In gem5, you can run (almost) any application. The application is an emulated process in SE mode. You can assign different binaries to different gem5 cores, or you can have one binary assigned to many cores (e.g., pthreads).

Now, gem5-gpu extends gem5 and also allows you to run applications that are written in CUDA and execute partially on the GPU. gem5-gpu only supports a single application using the GPU (though, you could extend gem5-gpu to support multiple applications).

I hope this clears things up.

Jason

molly

unread,
Mar 28, 2017, 8:42:30 AM3/28/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason,
    Thanks for your explanation, I got it. thank you very much.

Molly

在 2017年3月27日星期一 UTC+8下午10:36:49,Jason Lowe-Power写道:

molly

unread,
Apr 5, 2017, 8:07:13 AM4/5/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason,
   

   In gem5-gpu, can be achieved in the task of migration on different CPU? 

   What I mean is that the program runs on cpu0 in a time slice and then runs on cpu1 on the next time slice.

   Maybe my question is very strange.


Thanks 

Molly


在 2017年3月27日星期一 UTC+8下午10:36:49,Jason Lowe-Power写道:
Hi Molly,

Jason Lowe-Power

unread,
Apr 5, 2017, 1:56:10 PM4/5/17
to molly, gem5-gpu Developers List
Hi Molly,

In FS mode, the application is free to move between cores as the OS sees fit. gem5 has no effect on this as it is emulating a "bare-metal" system.

However, for running GPU applications, the hardware emulation in gem5-gpu assumes the program will never be migrated. If the application *is* migrated, we raise an error.

Jason

molly

unread,
Apr 7, 2017, 11:09:11 AM4/7/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason,

    My goal is to implement the CPU core that is best suited for each application, so it can  involves the problem of migrating applications in different CPU core. If I want to do this, do  I need to run in GEM5-GPU FS mode and load the Linux kernel I've modified ?
   I was thinking about it for the time being, so I tried to run my program in the GEM5-GPU FS mode these days.
In the default configuration--kernel=x86_64-vmlinux-2.6.22.9--disk-image=linux-x86.img, I can open the M5term port and run the program, but when I compile my own Linux kernel,and replace x86_64-vmlinux-2.6.22.9, I encountered there is a problem, I have been stuck here,


What should I do to load my own linux kernel? 

Thanks
Molly

在 2017年4月6日星期四 UTC+8上午1:56:10,Jason Lowe-Power写道:

Jason Lowe-Power

unread,
Apr 7, 2017, 11:23:54 AM4/7/17
to molly, gem5-gpu Developers List
This post has some information on compiling your own kernel.


Cheers,
Jason

molly

unread,
Apr 7, 2017, 11:33:35 AM4/7/17
to gem5-gpu Developers List, mengx...@gmail.com
Hi Jason,
  Thanks, I also wanna know what my thoughts are right? I mean by changing the linux kernel to achieve the modified task scheduling algorithm.

Molly

在 2017年4月7日星期五 UTC+8下午11:23:54,Jason Lowe-Power写道:

Jason Lowe-Power

unread,
Apr 10, 2017, 10:12:34 AM4/10/17
to molly, gem5-gpu Developers List
Hi Molly,

You can change the kernel to change the task scheduling algorithm. I've never done it, and I don't know where to start. One thing to keep in mind is that gem5-gpu doesn't implement a device driver in the Linux kernel. All of the driver functions are emulated in the simulator code. You may need to modify the simulator and the kernel to pass information back and forth.

Jason
Reply all
Reply to author
Forward
0 new messages