tvb-root icon indicating copy to clipboard operation
tvb-root copied to clipboard

Improve speed of reduced set models

Open maedoc opened this issue 3 years ago • 4 comments

Describe the new feature or enhancement

The reduced set models are quite slow and should be improved as with other models in the TVB library.

Describe your proposed implementation

The dfun implementations can be replaced by Numba functions with explicit loops, which will provide an immediate speed up with the default backend.

Describe possible alternatives

The differential equations could annotated as with the MPR model to make them compatible with the Numba code gen backend. The backend may need to be taught to generate code for the mode coupling.

Additional comments

Following a request from the TVB list this morning, cf https://groups.google.com/g/tvb-users/c/GovsAb-xc1k/m/vCTOQcd_FAAJ

maedoc avatar Apr 01 '22 07:04 maedoc

Hey there , Can you eloborate on this a bit , I want to work on this ,but as a newbie I am a bit confused that how should I begin with that.

peeplika avatar Jan 03 '24 12:01 peeplika

The dfun method linked to in the issue is a bottleneck for simulations using this model. This issue would involve writing a new implementation with Numba. This can be approached by writing a benchmark of the current code, creating a second implementation, checking the second implementation produces identical results as the first, and finally checking that the second implementation is faster.

maedoc avatar Jan 08 '24 09:01 maedoc

Thanks for the detailed explanation. I’ll start working on this issue using the information you’ve provided. I’ve observed Numba implementations in other models and I think they can be used as references for this task.

peeplika avatar Jan 11 '24 08:01 peeplika

Hello, I've tried re-implementing the dfun functions, but unfortunately, the results are not identical to the previous implementation. I've attached a PR for your review. Could you please take a look and provide any feedback ? Thank you

peeplika avatar Mar 14 '24 20:03 peeplika