sarchlab / mgpusim

A highly-flexible GPU simulator for AMD GPUs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

where is private segment memory allocation for kernel load ?

bufans opened this issue · comments

Hi,

I did not found see the private segment memory allocation process in kernel.go?

AMD generally does not use private segment memory. If the kernel requires, AMD compiler will use registers. Do you have any specific example that allocates private memory?

AMD generally does not use private segment memory. If the kernel requires, AMD compiler will use registers. Do you have any specific example that allocates private memory?

I do not have an example. But i think private memory is necessary ? the number of private variable can be greater than the number of reigster in GPU hardware ?

I actually do not know exactly how AMD handles private memory. If I were the designer, I have three choices.

  1. Use register as private memory. If too many registers are needed, I can spill the register to either LDS or the global memory.
  2. Use LDS as private memory. If there is no sufficient LDS, the kernel crash and returns an error code.
  3. Use global memory as private memory. This is bad because accessing private memory is supposed to be fast, but it is actually slow.

MGPUSim really implements features whenever we see a need. So we will need to see concrete examples so that we can consider working on it. If you do not have an urgent need, is it OK to close the issue and reopen it when you encounter one?

OK, thank you for your answer.
I think option one is an general solution. When kenrnel has private memory allocated in global memory, I think they just provide a base address in code object and it will be pre loaded into scalar register before kernel starts. So the hardware can access private variable through explict private load instrucion.
By the way, thanks for open source MGPUSim, it is very helpfull to understand the GPGPU archicture

@bufans Thank you for your kind words. If you are interested, please consider joining our Akita/MGPUSim Community workshop on March 13. You can find more information here. https://sarchlab.org/akita/akita24