item response theory ( irt ) is a popular approach used for describing probabilistic relationships between correct responses on a set of test items and continuous latent traits ( see [ 14 ] ) .
in addition to educational and psychological measurement , irt models have been used in other areas of applied mathematics and statistical research , such as us supreme court decision - making processes , alcohol disorder analysis [ 69 ] , nicotine dependency [ 1012 ] , multiple - recapture population estimation , and psychiatric epidemiology [ 1416 ] , to name a few . in irt ,
the influence of items and persons on the responses is modeled by distinct sets of parameters so that the probability of a correct response to an item is a function of the person 's latent trait ,  , and the item 's characteristics ,  ; that is , 
 ( 1)py = correct = f(, ) . 
 in its original form , 
certainly , for psychological scales and other applications , it might be better labeled as  mood ,   attitude ,   depression ,  and so forth , depending on what the instrument is intended to measure .
the model assumes one  parameter for each person and is commonly referred to as the unidimensional model , signifying that each test item measures some facet of the unified latent trait . in this sense ,
the mathematical form of the model has made irt a more powerful psychometric theory than the traditional classical test theory ( which uses sum scores to estimate latent person traits ) , and its advantages have been well documented in [ 1820 ] .
specifically , irt models offer the ability to  ( a ) rigorously study how items function differently across examinee populations , ( b ) place individuals who have responded to different items onto a common scale , ( c ) derive individual scores that have good psychometric properties , ( d ) more thoroughly understand the psychometric properties of items and scales through inspection of item parameters and information functions , ( e ) create order in various research fields by having a common item pool and latent scale for key constructs , and ( f ) develop computerized adaptive testing ( cat ) systems or static short - forms for precise and efficient assessment of individual differences  [ 21 , page 212 ] .
although recent advances in computer technology and development of estimation algorithms have made the application of irt accessible to a wider range of users , problems exist in the efficiency of current estimation tasks with irt models .
is modeled by distinct sets of parameters , a primary concern associated with irt research has been on parameter estimation , which offers the basis for the theoretical advantages of irt .
specifically , of concern are the statistical complexities that can often arise when item and person parameters are simultaneously estimated ( see [ 1 , 2224 ] ) . more recent attention has focused on the fully bayesian estimation where markov chain monte carlo ( mcmc , [ 25 , 26 ] ) simulation techniques are used .
albert   applied gibbs sampling , one of the most efficient mcmc algorithms , to a unidimensional irt model , namely , the two - parameter normal ogive ( 2pno ; ) model .
the fully bayesian approach for estimating irt models is both memory and computationally expensive , which further limits its actual applications .
typically , item response data are based on n subjects ' responses to k items at one occasion , and a markov chain requires 5,000 to 10,000 iterations to reach convergence for such irt models .
each implementation of the algorithm would take five or more minutes to complete the computation by a single desktop when n and k are not sufficiently large ( e.g. , n = 1000 , k = 10 ) .
this fact makes it impractical for users to utilize the algorithm for various applications of irt .
for example , in standardized testing situations , each instrument can consist of 100 or more items , and the number of participants during each administration can go beyond 10,000 .
this is not practical with testing companies , as their primary consideration is to promptly report accurate trait estimates to the participants considering the frequency of handling the estimation of multiple tests / datasets .
another example is with the test development or scale construction where item analysis is a necessary step before individual items are included in an instrument .
the common practice is to collect data , estimate item parameters , analyze item performances , and modify the instrument accordingly .
the efficiency of the algorithm is hence important in delivering prompt item estimates , without which item analysis is not possible .
other examples include using irt ( 1 ) to diagnose patients for certain mental disabilities in psychiatry where the urgency of starting treatment of a concerning disability is essential , ( 2 ) to calibrate item parameters for a cat system where a large item pool with sufficient numbers of good quality items is required , and ( 3 ) in the massive open online courses ( moocs ) where sample sizes and test frequencies are much larger .
in addition to these applications , the computation expense limits researchers in conducting monte carlo studies where a large number of replications are desirable . in the irt literature ,
simulation studies commonly utilize 25 replications only , which makes it difficult to empirically evaluate the property of the population distribution of the model parameter .
even with such a small number of replications , the entire execution takes weeks or even months to finish .
the delayed research findings would in turn prevent the advance of irt research in developing more complicated irt models .
in general , the serial implementation of the gibbs sampler is limited in both practical applications and theoretical developments . consequently , achieving a considerable speedup and making less requirement on the memory size with well - designed parallel algorithms on an inexpensive and convenient execution platform would make it more practical for researchers or practitioners to implement such an irt model using mcmc .
high performance computing ( hpc ) employs supercomputers , computer clusters , and graphics processors to tackle problems with computing and memory intensive computations .
hpc utilizes the concept of parallel processing to run programs in parallel and achieve a much smaller execution time with high efficiency and low overhead .
many large - scale applications run on hpc machines through the message passing interface ( mpi ) standard to achieve a better performance .
previous studies have applied mpi to implement gibbs sampling for the 2pno irt model [ 32 , 33 ] . however , parallel computing is known to excel at tasks that rely on the processing of discrete units of data that are not heavily interdependent . given the high data dependencies in a single markov chain for irt models , such as the dependency of one state of the chain to the previous state and the dependencies among the data within the same state , the implementation of mpi for this problem requires domain decomposition   of data matrices while minimizing the communication overhead among processors .
[ 32 , 33 ] have demonstrated the advantage of parallel computing over the serial implementation , but with mpi , a speedup of only up to 5 or 6 could be achieved in their experimented conditions with efficiency gradually dropping as more processors are added due to the rapid growth in the communication overhead .
cuda - enabled graphic processing units ( gpu ) is gaining a growing research interest for data decomposition - based parallel applications . as of 2012
, the peak floating - point throughput of many - thread gpu is 10 times that of a multicore cpu .
first , the design of cpu is optimized for sequential algorithms with a complicated control logic and a large cache .
second , the memory bandwidth of delivering data from the memory to the processor is about six times faster for gpu than that of cpu , for which the bandwidth usually serves as the bottleneck in many applications .
the data size and the data - parallelism nature of the mcmc procedure with a high throughput requirement make gpu an ideal platform for a fast and efficient execution .
a typical gpu program utilizes thousands of threads simultaneously and can achieve an extremely high system throughput . on the contrary ,
a high - end multicore microprocessor cpu typically has only four to eight cores and multiple megabytes of on - chip cache for strong sequential code performance . in view of the above
, the cuda - enabled gpu can potentially accelerate the speed for implementing mcmc with an irt model , and , as the data size increases , the benefit of using gpu would increase . to the best of our knowledge , generic software for implementing mcmc techniques such as bugs   or jags   does not currently provide cuda support .
although r   has many parallel computing packages , the only package that implements cuda with bayesian modeling , cudabayesreg , is specifically limited to fmri data analysis .
hence , the purpose of this study is to develop a gpu - based high performance gibbs sampling algorithm for the 2pno irt model and further compare it with the cpu - based program .
section 2 illustrates the approach we propose in the present study to implement the mcmc algorithm using cuda . in section 3 , the performance of the proposed parallel algorithm is investigated by comparing it with the serial cpu algorithm and further with the parallel algorithm using mpi developed in .
a real data example is provided in section 4 to illustrate the program developed for implementing the proposed parallel algorithm .
this study was performed using a tesla k20c gpu on an intel core 2 quad cpu with 8  gb of ram . for the purpose of comparisons , the cpu - based mpi algorithm developed by sheng and rahimi  
was carried out using the maxwell linux cluster , a cluster with 106 processing nodes .
each node on the cluster has an intel xeon dual cpu quad - core processor clocked at 2.3  ghz , 8  gb of ram , 90  tb storage , and a linux 64  bit operating system .
the 2pno irt model provides a fundamental framework in modeling the person - item interaction by assuming one latent dimension .
let y = [ yij ] denote a matrix of n responses to k items where yij = 1 ( yij = 0 ) if the ith person answers the jth item correctly ( incorrectly ) for i = 1 ,  , n and j = 1 ,  , k. the probability of person i obtaining a correct response to item j is then defined for the 2pno model as 
 ( 2)p(yij=1)=(jij)=jij12et2/2dt , 
 where j and j denote item slope and intercept parameters and i denotes the continuous person trait parameter .
the gibbs sampler involves updating three sets of parameters in each iteration , namely , an augmented continuous variable zij ( which is positive if yij = 1 and negative if yij = 0 ) , the person parameter i , and the item parameters j , where j = ( j , j) from their respective full conditional distributions ; namely , 
 ( 3)zij    ~n(0,)(jij,1),if  yij=1n(,0)(jij,1),if  yij=0,(4)i    ~nj(zij+j)jjj2,1jj2,(5)j    ~nxx1xzj , xx1ij>0 , 
 where x = [  , 1 ] , assuming i ~ n(0,1 ) , j > 0 and p(j )  1 ( see , e.g. , [ 27 , 30 ] ) . hence , with starting values  and  , observations ( z ,  ,  ) can be simulated from the gibbs sampler by iteratively drawing from their respective full conditional distributions as specified in ( 3 ) , ( 4 ) , and ( 5 ) . to go from ( z ,  ,  ) to ( z ,  ,  ) , it takes three transition steps as follows.(1)draw z ~ p(z , ).(2)draw  ~ p(z , ).(3)draw  ~ p(z , ).this iterative procedure produces a sequence of (  ,  ) ,  = 0 ,  , l. to reduce the effect of the starting values , early iterations in the markov chain are set as burn - ins to be discarded .
samples from the remaining iterations are then used to summarize the posterior density of item parameters  and ability parameters . the gpu - based parallel algorithm begins with copying the data matrix y to the device , which then assumes the tasks of updating model parameters i , j , and j and calculating results . using the triple chevron notation , we defined a kernel per update to specify the number of blocks and the number of threads per block for decompositions of the data matrix and model parameters .
hence , each kernel has a random state indexed in a grid or a list .
specifically , the data matrix y , which is of size n  k , was decomposed over a two - dimensional grid of r  c blocks with a defined number of threads ( see figure 1 ) . this way , each block on the device receives a submatrix ybij of size gr  gc , where gr = n / r and gc = k / c .
in addition , each item ( person ) parameter was decomposed over a list of r ( c ) blocks as depicted in figure 2 .
the algorithm was implemented in ansi c with utilization of the curand library   for random number generations and normal cumulative densities . specifically , we employed the curand_normal2_double device api method , which uses the box - muller transform to generate two pseudorandom numbers at once .
in addition , using vector types improves the efficiency of memory access because fewer accesses would be needed for the same amount of data handled . for more detailed implementation , see figure 11 where a basic control diagram is provided between cpu host and gpu device for updating various variables in the algorithm .
specifically , after the initial matrices ( e.g. , dev_z ) , vectors ( e.g. , dev_avz , dev_gvz ) , and input values ( dev_y ) are stored in the device memory with random states allocated ( rngstatesa , rngstatesb , and rngstatesc ) , the gibbs sampler begins .
the first update is in the kernel of updating z ( calcz ) , which decomposes the data matrix y on a two - dimensional grid and calculates the augmented data z ( see figure 1 ) .
this kernel requires passing the pointer to the random state matrix on the device ( rngstatesa ) . calculating
the mean for  ( calcmn ) is a separate kernel that is decomposed on a one - dimensional list of blocks with the size of r ( see figure 2 ) . updating  ( calcth ) is decomposed similarly but requires passing a pointer to a vector of random states on the device ( rngstatesb ) .
updating  and  ( calcag ) is decomposed on a one - dimensional list of blocks with the size of c ( see figure 2 ) .
this update also requires a random state for each block of the decomposed items ( rngstatesc ) . calculating the posterior estimates for item or person parameters ( calcis , calcps ) , performed at the end of all the iterations
, is also parallelized using a one - dimensional list of c or r. the program stops when the device sends all the results back to the host .
it is noted that the update of  has been optimized using the thrust library , which provides templates for various parallel linear algebra algorithms with improved efficiency . with the use of two custom defined c structure operators ( one for vector addition and the other for inverse vector multiplication ) , a transform - reduce method from the thrust library
was successfully implemented to improve the performance when operating xx , a 2  n by n  2 matrix multiplication , in ( 5 ) . in this study where data sizes have been determined in all the experimented conditions as described in section 3 , statically allocating at compile time
was adopted due to its simplicity and efficiency in memory addressing of two - dimensional arrays and optimal memory alignment .
when decomposing an mcmc algorithm using cuda , each running kernel requires its own random state to grab the next random number in its sequence within a single block of each update .
therefore , after initial values are sent from the host to the device , a kernel must be executed to allocate random states in a vector or matrix for each similar kernel update .
adequate error checking is also performed on each call of the cuda kernel . in order to investigate the benefits of the proposed gpu - based parallel solution against its serial and mpi counterparts ,
experiments were carried out in which tests with n persons ( n = 500,1000,2000,5000,10000 ) and k items ( k = 20,50,100,200 ) were considered . in each experiment ,
gibbs sampling was implemented to run a single markov chain with a total of 10,000 iterations using ( 1 ) serial algorithm , ( 2 ) mpi with 10 processing nodes , ( 3 ) mpi with 20 processing nodes , and ( 4 ) cuda with a single gpu card .
they were evaluated using the execution time as well as the relative speedup , which is defined as 
 ( 6)s = tstp , 
 where ts is the execution time for the fastest sequential algorithm and tp is that for the parallel algorithm .
results for the fully crossed 5  4 = 20 experiments are summarized in figures 3to 6 .
as expected , parallel programs had a shorter execution time than the serial program in all the experimented conditions . under these conditions , the gpu - based program could achieve a speedup of up to 50 while the mpi program achieved a speedup of up to 20. for example , for the data size of k = 200 and n = 5000 , the serial implementation took more than half an hour , the mpi with 20 nodes took about 81 seconds , and the cuda implementation took only 40 seconds to complete a markov chain ( see figure 6 ) . comparing the two hpc platforms , mpi versus cuda , we observe a clear pattern that with a test length of k = 20 , both mpi and cuda resulted in similar execution times with a slight advantage to mpi ( with 20 nodes ) especially for data with a larger n ( see figure 3 ) .
on the other hand , when test length k increased , cuda showed a much shorter computing time and thus a higher speedup ( see figures 4through 6 ) .
the reason is due to the fact that the mpi algorithm developed by sheng and rahimi   uses a row - wise decomposition and consequently the communication size depends on the test length k. it follows that when k is large ( e.g. , k > 20 ) , the communication overhead overshadows the computation speedup .
this can be further demonstrated by assessing the relative efficiency of the mpi program in managing the computational resources , which is defined as 
 ( 7)e = tsptp , 
 where p is the number of available processing nodes , and ts and tp are as defined in ( 5 ) .
the efficiency values using mpi with 10 and 20 processing nodes are plotted in figure 7 for all the n  k experimented conditions .
given the reasons stated previously , we observe the general pattern that , for the same data size , increasing the number of processing nodes from 10 to 20 generally decreases the relative efficiency .
hence , the fact that the overhead of the mpi algorithm such as data communication cost grows faster than the computation speedup leads to the result that increasing the number of the mpi nodes reduces efficiency .
the amount of decrease reduces when the data size gets large , especially for tests with k > 20 .
in addition , with a fixed number of nodes , the efficiency improves with the increase of n or k because the computational gain overweighs the overhead loss . given the nature of data decomposition in the mpi algorithm , an increased n tends to have a larger effect on the relative efficiency than an increased k. it is also observed that the efficiency exceeds 1 for larger data sizes , which is due to the fact that , when there is insufficient memory for the problem to execute on a sequential program , the memory on multiple processing nodes can be utilized to overcome this limit .
this further illustrates that parallel algorithms can utilize a faster memory for a better performance .
consequently , mpi is not a scalable approach when n and/or k increases . on the contrary
, the developed cuda program demonstrates a much improved scalability and efficiency when the data size goes up and further allows us to investigate even larger data sizes with high accuracy .
with respect to the cuda implementations , for k = 20 or k = 50 , the relative speedup kept increasing for increased sample sizes n ( see figures 3 and 4 ) .
this suggests that the developed cuda program can scale up in both k and n , which makes it possible to fit the 2pno irt model to large - scale testing data that can differ in both test lengths and sample sizes . on the other hand , for k = 100 or
k = 200 , the relative speedup was the highest at n = 2000 and had a slight drop when n increased to 5000 and/or 10000 ( see figures 5 and 6 ) .
this may be due to the reason that when k gets large ( k > 50 ) , having an increase of 3000 or 5000 in n would result in a significant amount of computation , and therefore cuda uses proportionally more time to complete the gibbs sampler . to further compare the four implementation methods for all the experimented conditions ,
it is apparent that both gpu- and cpu - based approaches achieve a speedup over the serial implementation , with a clear advantage to the gpu approach .
furthermore , for data of the same size , n seems to be the key factor that determines the execution time for each individual implementation .
specifically , a larger n tends to result in a longer time in carrying out the gibbs sampler regardless of the serial or parallel algorithm .
finally , a comparison of the two parallel implementations in mpi ( namely , mpi with 10 nodes and mpi with 20 nodes ) suggests that when the data size and especially the sample size n are small , the use of fewer number of processing nodes ( e.g. , 10 ) is preferred , but when n increases , more processing nodes are necessary to achieve an improved speedup .
a set of the college basic academic subjects examination [ 43 , cbase ] data was used to further illustrate the proposed gpu parallel algorithm .
the cbase is a criterion - referenced achievement examination adopted by over 140 colleges and universities across the usa to evaluate knowledge and skills in four subject areas of sophomore - level students ( usually after they complete the core curriculum ) .
the data used in this study were from college students who took the lp form of the cbase in years 2001 and 2002 . after removing missing responses , there were 3,356 examinees left .
the overall cbase exam contains 180 multiple - choice items , with 41 for english , 56 for mathematics , 41 for science , and 42 for social studies .
we can assume that all items are measuring the same unified latent trait - academic knowledge and fit the 2pno irt model using the proposed algorithm .
the program for implementing this algorithm was developed on a linux operating system with a nvidia k20 gpu .
the program runs from the command line and is available upon request to the first author . for the cbase data
, it took the program 40 seconds ( less than a minute ) to implement the gibbs sampler with 10,000 iterations .
after the burn - in stage of 5,000 iterations , the posterior estimates and monte carlo standard errors for the item parameters were obtained and table 1 displays those for the first 10 items .
it is clear from the table that all the monte carlo standard errors are small , suggesting accurate posterior estimates .
these estimates were also compared with those obtained from the serial implementations in c and via the matlab function developed by sheng   and found to be close .
it is noted that the latter two implementations took a much longer time , with 17 minutes for the serial c implementation and 33 minutes for the matlab function .
again , with a speedup of up to 49 , the gpu approach is practically more attractive and therefore much preferred . using the estimated item parameters from table 1 and ( 2 )
a close examination indicates that among the first ten items , item 6 has the largest ^ value ( or the steepest curve ) and thus is the most discriminating between high and low ability students , whereas item 10 has the largest ^/^ value ( or its curve is on the rightmost ) and hence is the most difficult .
in addition , the posterior estimates of person parameters for all 3,356 students were obtained and plotted in figure 10 .
the density plot has a positive skew , suggesting that in the cbase data , there are more high achieving students ( ^>2 ) than low achieving students ( ^<-2 ) .
also , for those with a medium ability level ( -1<^<1 ) , more students are below the mean ( ^=0 ) than above it .
this study developed a cuda gpu - based high performance gibbs sampling algorithm for the 2pno irt model with the purpose of achieving high speedup and efficiency .
results indicated that the gpu - based parallel algorithm performed better than the cpu - based algorithm for tests with more than 20 items and that this advantage was more apparent for larger sample size conditions ( e.g. , n > 1000 ) .
this further suggests the computational advantage of cuda - enabled gpu in fitting such irt models to , for example , large - scale standardized test situations .
moreover , it has to be noted that in the study , the cuda implementation was realized using one gpu card with 2400 cores , whereas the mpi implementation was realized via the use of a computer cluster .
the relatively lower cost of the gpu card makes the proposed approach more cost - effective and convenient for many small research laboratories .
although this paper only focuses on a specific measurement model , its methodology and results shed light on ( 1 ) using gpu to improve efficiency with mcmc algorithms for other models ( such as factor analysis models or structural equation models ) in general and ( 2 ) developing gpu - based gibbs sampler for more complicated irt models more specifically . in the irt literature , the model can be more complex by assuming multiple latent traits , and such tests typically involve more than 20 items . given this , the gpu - based parallel computing is theoretically more appealing than the cpu - based approach . in this study ,
the performance of the gpu program was improved via optimizing global memory accesses and enabling massive thread - level parallelism .
its performance can be further improved by incorporating dynamic parallelism , a nested thread - level parallelism that is available in the cuda 5 package .
cuda 5 allows the parent kernel to invoke child kernels so that a kernel can dynamically decide the dimension of the to - be - called kernel to achieve an adaptive thread utilization and a better performance .
in addition , a kernel can be divided to have multiple streaming data transfer from host to device and to perform computation and data transfer from device to host .
this enables ( 1 ) the bidirectional data transfer between host and device and ( 2 ) kernel computations to be executed concurrently .
these strategies together with other optimization techniques such as shared memory , parallel reduction , and open multi - processing ( openmp ) interoperability with cuda   can be employed to potentially reduce the total run time . finally , this study achieved parallelization of the gibbs sampler for the 2pno irt model through a massive - core gpu computing and compared its performance with the mpi approach developed by .
it will also be interesting to consider a different decomposition scheme with mpi such as the 2d decomposition suggested by georganas   or use a hybrid cuda , mpi , and/or openmp parallel programming as recommended by karunadasa et al .
 item response theory ( irt ) is a popular approach used for addressing large - scale statistical problems in psychometrics as well as in other fields . 
 the fully bayesian approach for estimating irt models is usually memory and computationally expensive due to the large number of iterations . 
 this limits the use of the procedure in many applications . in an effort to overcome such restraint , previous studies focused on utilizing the message passing interface ( mpi ) in a distributed memory - based linux cluster to achieve certain speedups . 
 however , given the high data dependencies in a single markov chain for irt models , the communication overhead rapidly grows as the number of cluster nodes increases . 
 this makes it difficult to further improve the performance under such a parallel framework . 
 this study aims to tackle the problem using massive core - based graphic processing units ( gpu ) , which is practical , cost - effective , and convenient in actual applications . 
 the performance comparisons among serial cpu , mpi , and compute unified device architecture ( cuda ) programs demonstrate that the cuda gpu approach has many advantages over the cpu - based approach and therefore is preferred . 
1. Introduction
2. Methodology
3. Results
4. Real Data Example
5. Discussion