Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine code for sparse model functions and their index files #2159

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Aug 18, 2023

Combine code for sparse model functions and their index files, i.e. generate only a single file instead of 3 individual files for content, rowvals, and colptrs, respectively.

Advantage: Faster import of smaller models and fewer files. For a toy model, this reduced the build steps from 44 to 28, and reduced build time by >20% on my computer.

Disadvantage: None found, so I don't think it worth adding an option for (not) combining those files. For larger models, there shouldn't be any impact. The extra time for compiling the index arrays should be negligible compared to computing the contents.

Related to #2119

Combine code for sparse model functions and their index files, i.e. generate
only a single file instead of 3 individual files for content, rowvals, and
colptrs, respectively.

Advantage: Faster import of smaller models and fewer files. For a toy model,
this reduced the build steps from 44 to 28, and reduces build time by >20%.

Disadvantage: None found, so I don't think it worth adding an option
for (not) combining those files. For larger models, there shouldn't be any impact.
The extra time for compiling the index arrays should be negligible compared
to computing the contents.

Related to #2119
@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #2159 (59143c7) into develop (16aad6f) will decrease coverage by 22.52%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #2159       +/-   ##
============================================
- Coverage    76.74%   54.23%   -22.52%     
============================================
  Files           82       34       -48     
  Lines        14943     5585     -9358     
============================================
- Hits         11468     3029     -8439     
+ Misses        3475     2556      -919     
Flag Coverage Δ
cpp ?
petab 54.23% <100.00%> (-0.03%) ⬇️
python ?
sbmlsuite ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
python/sdist/amici/de_export.py 78.68% <100.00%> (-13.08%) ⬇️

... and 65 files with indirect coverage changes

@dweindl dweindl marked this pull request as ready for review August 18, 2023 14:25
@dweindl dweindl requested a review from a team as a code owner August 18, 2023 14:25
Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, historically, this slowed down compilation of larger models

@dweindl
Copy link
Member Author

dweindl commented Aug 20, 2023

I think, historically, this slowed down compilation of larger models

Will double-check

@dweindl dweindl self-assigned this Aug 20, 2023
@dweindl
Copy link
Member Author

dweindl commented Aug 25, 2023

Here a test for a large model (N=1):

File Size Compilation time (s)
dwdx 22.4MiB 3413.64
dwdx_colptrs 2.0KiB 2.79
dwdx_rowvals 65.6KiB 2.66
combined 3416.79

I'd consider this time increase negligible.

@dweindl dweindl merged commit 98c782d into develop Aug 25, 2023
@dweindl dweindl deleted the combine_function_index_files branch August 25, 2023 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants