[Eeglablist] EEGlab parallel computing & hardware specs

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Wed Apr 23 11:36:09 PDT 2014


Dear Jens,

Actually I found that runica() does not use pcsquash() any more, so I
investigated how pca dimension reduction is handled in the current runica()
which I have been curious too. Based on this experience, I wrote code and
tested following steps:

1. Reduce dimensions from 37 to 20
2. Run cudaica to obtain 20 ICs
3. Backproject the obtained 20 IC activities to 37 channels for comparison

It worked, at least for me, so let me share it with you.
CAUTION: The attached code is with ABSOLUTELY NO GUARANTEE! Please use it
at your own risk.

Makoto


2014-04-23 7:57 GMT-07:00 Bernhardsson Jens <Jens.Bernhardsson at miun.se>:

>  Dear Makoto,
>
>
> It states on the cudaica web site that the pca option is not currently
> supported, http://liaa.dc.uba.ar/?q=node/10 . Cudaica does however create
> rank reduced weight and sphere matrices before it crashes when trying to
> read in the weight and sphere [wts sph] results.
>
> It would be great if you could provide some information on pcsquash() and
> what to do with the wts and sph matrices generated by cudaica() as I get
> matrices with n-c*n-c dimensions after using pcsquash() and not n-c*n.
>
>  Thank you
> Jens
>
>
>
> On 04/18/2014 04:52 AM, Makoto Miyakoshi wrote:
>
> Dear Jens,
>
>  Look like cudaica does have pca option, so just 'pca', 10 for example.
>
>  If it does not work, or for AMICA (which does not support pca although
> in the help it says it does), you can always use pcsquash() and pcexpand()
> included in the EEGLAB package.
> If you need more details let us know.
>
>  Makoto
>
>
> 2014-04-15 2:54 GMT-07:00 Bernhardsson Jens <Jens.Bernhardsson at miun.se>:
>
>>  Dear Makoto
>>
>>
>>
>> When you run CUDAICA how do you reduce the rank of your data?
>>
>>
>>
>> Best,
>>
>> Jens
>>
>>
>>
>>
>>
>>
>>
>> Dear Avi,
>>
>>
>>
>> runica() runs slowly, and spending 50 min is not surprising (assuming you
>> have >32 channels and >30min data). binica() runs faster, but does not run
>> on windows. We have cudaica() which runs super-fast but requires
>> configuration of GPU.
>>
>>
>>
>> Makoto
>>
>>
>>
>> 2013/6/9 Avi Lazarovits <avila at post.bgu.ac.il>
>>
>>  Hello,
>>
>> Thank you very much, I will try to run this function with the new filter.
>>
>> About the inconsistency, actually I run a bandpass filter and by mistake
>> I quoted the code for the low pass filter which is much faster. The code
>> for the highpass is: EEG = pop_eegfilt( EEG, 1, 0, [], 0,0,0, 0,
>> ‘firls’, 0);
>>
>>
>>
>> Another function I intend to use is running ICA on these files. Is there
>> any way to accelerate the ICA (in my computer it took about 50 min wuth
>> deafult settings of ICA)?
>>
>>
>>
>> Thanks
>>
>> Avi
>>
>>
>>
>>
>>
>>
>>
>> 2013/6/9 Andreas Widmann <widmann at uni-leipzig.de>
>>
>> Hi Avi,
>>
>> short answer:
>> upgrading to a recent 12.x EEGLAB version and using pop_eegfiltnew should
>> solve your problem.
>>
>> Long answer:
>> * I have to slightly correct my previous statement. The legacy
>> (fir1/firls) FIR filter uses MATLAB filtfilt instead of MATAB filter and is
>> thus not multi-threaded by default.
>> * The legacy filter is flawed (see e.g.
>> http://www.frontiersin.org/Perception_Science/10.3389/fpsyg.2012.00233/fulland
>> https://sccn.ucsd.edu/bugzilla/show_bug.cgi?id=631for a more detailed
>> description) and is not recommended.
>> * The new FIR filter in EEGLAB 12.x uses plain MATLAB filter an is thus
>> genuinely multi-threaded. Filtering a 1086734-point 66-channel dataset
>> takes 5 seconds with 265-point filter (default for 100 Hz-lowpass) and 2
>> min 16 seconds with 6145-point filter (your filter length) on my 1.7 Ghz
>> dual core i5. Should be much faster on your machine.
>> * Note: there is an inconsistency between your command (EEG =
>> pop_eegfilt( EEG, 0, 100, [], 0,0, 0, ‘firls’, 0);) and your reported
>> output. This command should give a 60-point lowpass filter and *not* a
>> 6144-point highpass. Did you change something in your EEGLAB code?
>>
>> Hope this helps! Best,
>> Andreas
>>
>>
>> > I am using EEGlab to process EEG recordings, and running low pass 100
>> Hz is very slow. I am looking for code modifications I can make to
>> accelerate the running time, and also recommendation for optimal hardware
>> specs for this process.
>> >
>> > The files I process are recordings of 66 channles @ 2KHz ~10 minutes
>> long (1086734 samples) bug. I can’t resample the files because I need high
>> temporal resolution.
>> >
>> > I use EEGlab version 11.0.3.1b, and run “firls” filter. I run the
>> filter with the following command:
>> > EEG = pop_eegfilt( EEG, 0, 100, [], 0,0, 0, ‘firls’, 0);
>> > When I run this command I get the following message:
>> >
>> > eegfilt() - performing 6144-point highpass filtering.
>> > eegfilt() - highpass transition band width is 0.2 Hz.
>> >
>> > The computer I run the processing on now is i5 3470 (4 cores@ 3.2 Ghz)
>> with 4Gb RAM running windows 7 enterprise 64 bit and Matlab 2012a.
>> >
>> > I tried running the same process on an i7 extreme edition 3930k with
>> 64Gb RAM system and it didn't shorten the running time at all. I also tried
>> running this filter on a workstation with Xeon CPU and it shortened the
>> running time, but not significantly. I looked on the CPU monitor and found
>> that it doesn’t use more than 1 core, and that the maximal RAM memory usage
>> during the processing was about 6.5 Gb.
>> >
>> > 1.     I found that using SSD shortens the time significantly, and
>> therefore I assume that one of the big bottlenecks of this processing is
>> that the process is made on the hard disk and not on the RAM. Is there a
>> way to “make” Matlab use RAM instead of the hard drive?
>> >
>> > 2.     Are there code changes I can make in EEGlab’s code to run this
>> filter multithreaded so that the process will use all the cores of my CPU?
>> Is there any way to make this process on GPU? Will it accelerate the
>> process more than using parallel computing of the CPU?
>> >
>> >
>> > Thank you
>> >
>> > Avi
>> >
>> >
>> >
>> > 2013/6/8 Arnaud Delorme <arno at sccn.ucsd.edu>
>> > Thanks Andreas for the clarification.
>> >
>> > Arno
>> >
>> > On 8 Jun 2013, at 06:58, Andreas Widmann wrote:
>> >
>> > > Hi Avi and Arno,
>> > >
>> > > no using parfor won't help here, filtering is already multithreaded
>> since MATLAB R2007a.
>> > > http://www.mathworks.de/support/solutions/en/data/1-4PG4AN/
>> > >
>> > > I can try to narrow down the problem, but please on list
>> (eeglablist). This might be interesting also for others. Many relevant
>> parameters are missing:
>> > > * Length of dataset (samples or time and fs)
>> > > * Filter length or order
>> > > * OS and version
>> > > * EEGLAB version
>> > > * Why legacy filter (fir1/firls)? Using the new filter will
>> immediately halve computation time.
>> > >
>> > > Best,
>> > > Andreas
>> > >
>> > > Am 07.06.2013 um 22:20 schrieb Arnaud Delorme <arno at sccn.ucsd.edu>:
>> > >
>> > >> Dear Avi,
>> > >>
>> > >> yes, it is possible to shorten the time.
>> > >> If you have multiple processor, you could try replacing line 74 of
>> firfilt.m
>> > >>
>> > >> for iDc = 1:(length(dcArray) - 1)
>> > >>
>> > >> with
>> > >>
>> > >> parfor iDc = 1:(length(dcArray) - 1)
>> > >>
>> > >>
>> > >> Channels will be filtered in parallel.
>> > >> GPU could help as well, but that's another story.
>> > >>
>> > >> Hope this helps,
>> > >>
>> > >> Arno
>> > >>
>> > >> On 2 Jun 2013, at 23:53, Avi Lazarovits wrote:
>> > >>
>> > >>> Hello,
>> > >>> My name is Avi and I work in lab with EEG recordings. I am using
>> the EEGlab on matlab 2012b and would like to thank you for writing this
>> useful toolbox.
>> > >>>
>> > >>> the Processing time of the fir1/firls lowpass filters is very long
>> (20 minutes for 66 channels SSD and I am looking for ways to shorten it. Is
>> there any way to shorten it by changing the code for using parallel
>> computingqGPU computing? will EEGlab use parallel computing in next
>> versions?
>> > >>> If not, what are the best hardware specs to run these filters? I
>> tried running it on an i7 3930k with 64Gb RAM system and it didn't shorten
>> the time vs. my i5 3470 4Gb RAM system. I also tried to run this filter on
>> a workstation system with Xeon CPU and it shortened the running time, but
>> not significantly. I found that using SSD shortens the time significantly.
>> Do you have any other hardware specs recommendations?
>> > >>>
>> > >>> Thank you
>> > >>> Avi
>> > >>
>> > >
>> >
>> >
>>
>>
>>
>>
>> _______________________________________________
>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>> To unsubscribe, send an empty email to
>> eeglablist-unsubscribe at sccn.ucsd.edu
>> For digest mode, send an email with the subject "set digest mime" to
>> eeglablist-request at sccn.ucsd.edu
>>
>>
>>
>>
>>
>> --
>>
>> Makoto Miyakoshi
>> Swartz Center for Computational Neuroscience
>> Institute for Neural Computation, University of California San Diego
>>
>
>
>
>  --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
>
>
>


-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140423/4396afa8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cudaicaPcaPractice.m
Type: text/x-objcsrc
Size: 1620 bytes
Desc: not available
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140423/4396afa8/attachment.bin>


More information about the eeglablist mailing list