Skip to content

Conversation

@jpn--
Copy link
Member

@jpn-- jpn-- commented Jul 2, 2021

It appears that I can't currently run a model with chunking just plain turned off unless it's in training mode, but training mode carries a lot of overhead monitoring memory usage. If I set to production mode without an available chunk cache history file it falls back to training mode.

This is my crack at creating a fourth chunk training mode: 'disabled'. (the first 3 are training, production, and adaptive). The idea for disabled mode is that we don't do chunking, and also don't check or log memory usage ever, so we can focus on performance assuming there is abundant RAM.

It appears that I can't currently run a model with chunking turned off unless it's in training mode, but training mode carries a lot of overhead monitoring memory usage.
@jpn-- jpn-- requested a review from toliwaga July 2, 2021 14:31
@jpn--
Copy link
Member Author

jpn-- commented Jul 2, 2021

@toliwaga it certainly would be helpful for you to review this, as you're the expert on chunk management.

@toliwaga
Copy link
Contributor

toliwaga commented Jul 2, 2021

I'm out of the office on vacation until the beginning of August

@coveralls
Copy link

coveralls commented Jul 2, 2021

Coverage Status

Coverage increased (+8.5%) to 64.879% when pulling 37862e3 on jpn--:chunkless into a57efa1 on ActivitySim:master.

@jpn--
Copy link
Member Author

jpn-- commented Jul 8, 2021

Next steps: @esanchez01 and @stefancoe will test "disabled" mode to confirm it works correctly.

@bstabler bstabler removed the request for review from toliwaga July 9, 2021 20:58
@bstabler bstabler assigned stefancoe and esanchez01 and unassigned stefancoe Jul 9, 2021
@esanchez01
Copy link
Contributor

esanchez01 commented Jul 10, 2021

@jpn-- , After testing this on 100k households using the SANDAG 1 Zone setup (multiprocessed), there are still memory CSV files in the output/log directory as well as chunk logging across various logfiles. This does not conform with the behavior of the 'disabled' mode as described in the original post:

The idea for disabled mode is that we don't do chunking, and also don't check or log memory usage ever, ..

It seems like memory file creation is currently hard coded here in mem.py so changes may need to extend beyond just chunk.py. As for the chunk logging, it seems like empty logging is produced due to the placement of the 'disabled' chunk mode conditions in certain methods such as here or from functions that that don't set chunk mode conditions such as here.

You can find the configs and log files for this test run here.

@stefancoe
Copy link
Contributor

stefancoe commented Jul 10, 2021

I ran the model using 3 different modes using the same configuration of 20k households and mp turned off. The attached results show that the old code is fastest, 'disabled' is second but considerably slower and 'production' mode is the slowest.

chunkless_comparison.xlsx

@bstabler
Copy link
Contributor

@esanchez01 to test again since this feature would be good to get working soon

@esanchez01
Copy link
Contributor

I retested this feature with the new commits. There are still memory CSV files and chunk/memory logging that are produced. However, the extent of the memory tracking and logging appears to have been reduced. The run time for this new run was about 65 minutes compared to 140 minutes for the previous test, so it seems like unnecessary memory/chunk calls were further avoided.

You can find the configs and log files for the new test run here.

@bstabler
Copy link
Contributor

@jpn-- please PR to develop when ready

@bstabler
Copy link
Contributor

@jpn-- , actually, please move this to a branch within this repo so we can work on it here. Thanks.

@jpn--
Copy link
Member Author

jpn-- commented Jul 29, 2021

This is now a branch in the main repo, per @bstabler request. Closing this PR in favor of that.

@jpn-- jpn-- closed this Jul 29, 2021
@bstabler bstabler mentioned this pull request Aug 4, 2021
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.

6 participants