The Auditory Project – an investigation into modelling the human ear using HPC

Author: Fiona Reid
Posted: 14 Nov 2014 | 15:12

The Auditory pilot project investigated the use of HPC to enable faster run times for computational models of the human cochlea. It was a collaboration between EPCC and Dr Michael Newton of the University of Edinburgh’s Acoustics and Audio group.

We began with an existing cochlea model code written in Matlab, which took many hours to run on a single processor. Our initial profiling of the Matlab code showed that almost the entire runtime (see Figure 1) was taken up by this solver and thus any attempts to parallelise the code would require a C/C++ replacement to be found. 

Figure 1: Performance of original Matlab code showing that the ODE solver dominates the runtime.Figure 1: Performance of original Matlab code showing that the ODE solver dominates the runtime.

This project was particularly challenging as there is no direct replacement for the ordinary differential equation (ODE) solver used by the Matlab code. The code supplied by Dr Newton uses a Matlab built-in function to solve an expression of the form f(t,y) = M(t,y)y’, where M is a mass matrix. Whilst solvers for ordinary differential equations of the form f(t,y) = y’ are relatively commonplace, the number of options is greatly reduced in our case, where a non-zero right-hand side with a time and space dependent mass matrix is present.

We found just two possible replacement solvers, PETSc and SUNDIALS. We focused our efforts on PETSc as it allows for parallel computations using MPI. After identifying a selection of suitable replacement ODE solvers, much of our subsequent work on the project involved ensuring that we could obtain comparable results from Matlab and PETSc.

For these experiments we opted to use a simple problem consisting of just two equations. The Van der Pol problem was chosen as it has a very similar mathematical form to that of the cochlea model and therefore should give us an idea of the performance we could potentially expect.

PETSc has a variety of different solvers for use with ODE type systems. We tested all the possible solvers and found that the choice of solver and solver tolerance could have a significant impact on how well the PETSc and Matlab results agreed. Overall we found that the Rosenbrock-W or rosw solver gave the best performance and agreement with the Matlab code. We also found that the choice of solver tolerance had a significant impact on the runtime (see Table 1).

Tolerance used PETSc rosw runtine (seconds) Matlab ODE15s runtime(seconds)
0.01 0.302 8.632
0.001 0.571 10.285
0.0001 1.087 13.766
1E-05 2.219 17.003
1E-06 4.619 22.460
1E-07 9.672 29.745
1E-08 20.906 39.675
1E-09 45.052 50.740
1E-10 96.317 70.616
Table 1: Showing runtime variation with solver tolerance for the PETSc rosw solver run with Van der Pol on 2000 time units and Matlab running Van der Pol for 2000 time units.

For tolerances of 1.0E-09 or greater PETSc was significantly faster than Matlab, suggesting that PETSc could be a suitable replacement solver.

However, the Van der Pol problem consists of just two equations. Any cochlea model would contain hundreds or thousands of equations, each of which would need to be converted into a form that PETSc could interpret. Converting these equations into something that can be handled by PETSc was found to be entirely non-trivial and indeed the problem ultimately proved intractable.

Future work will focus on exploring Finite Difference Time Domain Techniques (FTSD) to solve the cochlear equations. This will essentially involve re-writing the equations into a new form, which will avoid the need for an ODE solver and should therefore increase the opportunities for optimisation and parallelisation.

Find out more

More details on the background of the Auditory Project can be found in Brian Hamilton's blog post, Simulating the acoustics of 3D rooms, which also appeared in EPCC News no 76 (pages 8-9). 

Acknowledgements: The Auditory pilot project gratefully acknowledges the support of the College of Humanities & Social Sciences Challenge Investment Fund (University of Edinburgh).

Author

Fiona Reid, EPCC