Skip to content

Make LLJit the default JIT and fix its configuration file keys - #1423

Closed
matthiaskoenig wants to merge 1 commit into
sys-bio:developfrom
matthiaskoenig:lljit-default-config
Closed

matthiaskoenig wants to merge 1 commit into
sys-bio:developfrom
matthiaskoenig:lljit-default-config

Conversation

@matthiaskoenig

Copy link
Copy Markdown
Collaborator

#1215 meant to make LLJit the default, but changed the map from the
names in the configuration file to the keys instead of the default
value, so MCJit stayed the default. That map then mapped LLVM_BACKEND,
LLJIT_OPTIMIZATION_LEVEL and LLJIT_NUM_THREADS to values instead of
keys: reading "LLVM_BACKEND: 1" from a configuration file switched on
LOADSBMLOPTIONS_RECOMPILE, and writing one wrote the values of other
keys under these names.

The map holds the keys again, and stringToKey uses it instead of its own
list of names, which lacked K_ROWS_PER_WRITE and the metabolic control
analysis keys. LLJit is the default with the optimization level DEFAULT
and one compile thread. With a model of 500 species, DEFAULT compiles
about 40% slower than NONE, and the model simulates about four times
faster. AGGRESSIVE is not faster than DEFAULT, and more compile threads
do not make the compilation of one model faster.

Fixes #1419.

The defaults were measured with Chen_MSB2009 of the PEtab benchmark collection (500 species, Linux, one process per setting, RECOMPILE on):

JIT level threads first load (s) simulate (s)
MCJit 2.60 0.052
LLJit NONE 1 0.82 0.042
LLJit DEFAULT 1 1.17 0.0096
LLJit AGGRESSIVE 1 1.16 0.0096
LLJit NONE 20 0.76 0.041
LLJit AGGRESSIVE 20 1.16 0.0096

simulate is the best of 7 runs of simulate(0, 100, 3) with the non-stiff solver and tolerances 1e-12/1e-14. With LLJit as the default, the LLJit object cache bug of #1420 affects every user; its fix is in a separate pull request.

sys-bio#1215 meant to make LLJit the default, but changed the map from the
names in the configuration file to the keys instead of the default
value, so MCJit stayed the default. That map then mapped LLVM_BACKEND,
LLJIT_OPTIMIZATION_LEVEL and LLJIT_NUM_THREADS to values instead of
keys: reading "LLVM_BACKEND: 1" from a configuration file switched on
LOADSBMLOPTIONS_RECOMPILE, and writing one wrote the values of other
keys under these names.

The map holds the keys again, and stringToKey uses it instead of its own
list of names, which lacked K_ROWS_PER_WRITE and the metabolic control
analysis keys. LLJit is the default with the optimization level DEFAULT
and one compile thread. With a model of 500 species, DEFAULT compiles
about 40% slower than NONE, and the model simulates about four times
faster. AGGRESSIVE is not faster than DEFAULT, and more compile threads
do not make the compilation of one model faster.

Fixes sys-bio#1419.
@luciansmith

Copy link
Copy Markdown

You gotta tell me when you're working on a PR; I was already working on this one ;-)

@matthiaskoenig

Copy link
Copy Markdown
Collaborator Author

@luciansmith no problem, just take is as an inspiration ;). Not expecting this to be merged, but more to provide you some input on what the scope of the fix is. If I can convince you that this is easy to fix than you probably address it.

@luciansmith

Copy link
Copy Markdown

Fixed elsewhere. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants