Kissfft on parallella

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Kissfft on parallella

Postby Krisania » Tue Jul 25, 2017 2:56 pm

Hello,
I'm currently just starting out working on the parallella board, haven't worked another project on it before so not a lot of experience here, please be patient with me :P
What I'm trying to do is run an fft algorithm on the board. I've been using the kissfft libraries, working exclusively on the arm part of the board and it seems to be working fine. However, as a next step I want to use the epiphany cores to execute the fft. My point here though, and what's different from other threads I've seen, is, I don't want to parallellize the fft itself, I just want to run seperate ffts in seperate data, in parallell.
Is there a working version of what I described doable? When I try to run the kissfft on the cores the program seems to hang (possibly due to memory allocation problems that kissfft uses internally?)
Krisania
 
Posts: 6
Joined: Tue Jul 25, 2017 2:36 pm

Re: Kissfft on parallella

Postby jar » Tue Jul 25, 2017 8:52 pm

Each core has 32 KB of SRAM shared between instructions, data, and stack. Your code will pay a hefty penalty for exceeding that. How large are your FFTs?
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: Kissfft on parallella

Postby Krisania » Wed Jul 26, 2017 2:00 pm

jar wrote:Each core has 32 KB of SRAM shared between instructions, data, and stack. Your code will pay a hefty penalty for exceeding that. How large are your FFTs?


I'm currently working with 1-d ffts on 32-bit integers. Each core, should be doing about 500-1000 of them
Krisania
 
Posts: 6
Joined: Tue Jul 25, 2017 2:36 pm

Re: Kissfft on parallella

Postby jar » Wed Jul 26, 2017 4:23 pm

1000 FFTs... Are you operating on data from DRAM?

If you can publish the code, it would help.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: Kissfft on parallella

Postby Krisania » Tue Aug 29, 2017 12:47 pm

jar wrote:1000 FFTs... Are you operating on data from DRAM?

If you can publish the code, it would help.


Sorry for the really late reply. Unfortunately I'd been away for a while and had no access to my pc/parallella board. I'm at it again now though.
Here's my repository: https://github.com/Krisania/parallella-1dfft
As you can see I'm performing a typical calculation at the start and then pushing the data on the epiphany cores. However when the fft calculation begins the program hangs indefinetely.

Edit: I also changed the number of FFTs performed to about 10 per processor but still no difference
Krisania
 
Posts: 6
Joined: Tue Jul 25, 2017 2:36 pm

Re: Kissfft on parallella

Postby jar » Tue Aug 29, 2017 9:02 pm

I quickly scanned your code, but didn't try running it. It looks like you've hard coded addresses for your data, which probably overlap your instructions. Your cores may be trying to execute "data", not instructions. It looks like the code may also call printf, which might cause problems. Also, your code seems to be calling malloc.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: Kissfft on parallella

Postby Krisania » Wed Aug 30, 2017 12:10 pm

jar wrote:I quickly scanned your code, but didn't try running it. It looks like you've hard coded addresses for your data, which probably overlap your instructions. Your cores may be trying to execute "data", not instructions. It looks like the code may also call printf, which might cause problems. Also, your code seems to be calling malloc.


Ok, so you mean I've hardcoded addresses like this? :
Code: Select all
e_write(&dev, i, j, 0x2000, &dif[(i*platform.cols+j)*sections], sections*sizeof(int));

Isn't that the way to pass the data to the epiphany cores? Is there another way?

As far as printf goes, it was just for debugging purposes in the main code, not the epiphany cores. I can easily remove that.
Malloc is gonna be harder cause kissfft uses it as well. Is there something to replace it with? e_alloc() maybe if I remember correctly?
Krisania
 
Posts: 6
Joined: Tue Jul 25, 2017 2:36 pm

Re: Kissfft on parallella

Postby sebraa » Wed Aug 30, 2017 12:37 pm

Hi,

I don't think that using malloc() on the Epiphany cores is a good idea. Dynamic memory might be allocated in shared memory, which has different access semantics, which will cause your code to fail. There are provisions for using alloca() instead, but I don't know if this replaces all malloc()-calls. Try it.

Check your program size. If you put your data at 0x2000, then your whole kernel must be smaller than 8 KB. Try using a higher address, but make sure that your data does not overlap either your program (easy to check) or the stack (harder to check, if using alloca).

Also, quite some time ago, I released a program called e-top on this forum. Search for it, it might help you see what's going on within the cores.

Best Regards,
sebraa
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 5 guests

cron