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

Loader bench #229

Merged
merged 4 commits into from
Oct 19, 2021
Merged

Loader bench #229

merged 4 commits into from
Oct 19, 2021

Conversation

kuenishi
Copy link
Member

Add benchmark to compare cache class performance

$ time python3 main.py --preload-path ./dat
<class 'pfio.cache.multiprocess_file_cache.MultiprocessFileCache'>
Namespace(dataset_len=1024, batchsize=32, num_workers=8, num_trials=5, preload_path='./dat', preserve_path=None, cache_type='multiprocess')
trial:  1, elapsed-time(all): 3.061 sec, ave-elapsed-time(img+label): 1.352 msec
trial:  2, elapsed-time(all): 2.045 sec, ave-elapsed-time(img+label): 1.967 msec
trial:  3, elapsed-time(all): 1.953 sec, ave-elapsed-time(img+label): 2.072 msec
trial:  4, elapsed-time(all): 1.981 sec, ave-elapsed-time(img+label): 2.062 msec
trial:  5, elapsed-time(all): 1.951 sec, ave-elapsed-time(img+label): 2.114 msec

real    0m11.728s
user    0m28.036s
sys     0m37.290s
$ time python3 main.py --preload-path ./dat --cache-type "readonly"
Cache class: <class 'pfio.cache.mmap_file_cache.ReadOnlyFileCache'>
Namespace(dataset_len=1024, batchsize=32, num_workers=8, num_trials=5, preload_path='./dat', preserve_path=None, cache_type='readonly')
trial:  1, elapsed-time(all): 3.336 sec, ave-elapsed-time(img+label): 1.739 msec
trial:  2, elapsed-time(all): 1.949 sec, ave-elapsed-time(img+label): 1.737 msec
trial:  3, elapsed-time(all): 1.857 sec, ave-elapsed-time(img+label): 1.379 msec
trial:  4, elapsed-time(all): 1.873 sec, ave-elapsed-time(img+label): 1.396 msec
trial:  5, elapsed-time(all): 1.919 sec, ave-elapsed-time(img+label): 1.465 msec

real    0m11.703s
user    0m34.291s
sys     0m28.853s
$ time python3 main.py --preload-path ./dat --cache-type "file"
Cache class: <class 'pfio.cache.file_cache.FileCache'>
Namespace(dataset_len=1024, batchsize=32, num_workers=8, num_trials=5, preload_path='./dat', preserve_path=None, cache_type='file')
trial:  1, elapsed-time(all): 3.245 sec, ave-elapsed-time(img+label): 1.523 msec
trial:  2, elapsed-time(all): 1.862 sec, ave-elapsed-time(img+label): 1.587 msec
trial:  3, elapsed-time(all): 1.920 sec, ave-elapsed-time(img+label): 1.687 msec
trial:  4, elapsed-time(all): 1.959 sec, ave-elapsed-time(img+label): 1.892 msec
trial:  5, elapsed-time(all): 1.998 sec, ave-elapsed-time(img+label): 2.050 msec

real    0m11.727s
user    0m26.644s
sys     0m35.895s

@kuenishi
Copy link
Member Author

Test failure is due to #228. After it's merged, restarting tests will make this success.

@kuenishi
Copy link
Member Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 599d50d:

@kuenishi kuenishi added this to the 2.0.0 milestone Oct 19, 2021
@kuenishi kuenishi merged commit 4d76782 into master Oct 19, 2021
@kuenishi kuenishi deleted the loader-bench branch October 19, 2021 00:48
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