-
Notifications
You must be signed in to change notification settings - Fork 385
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
Add dataset/sampler benchmarking script #115
Conversation
Some fun stuff I found while trying to get this to work:
The ZipDataset looks to be working after the hack though: |
benchmark.py notes:
|
bc1e7ea
to
6b9aede
Compare
Most recent commit fixes a couple of bugs I found:
Results are still mostly the same, GridGeoSampler is significantly faster and I'm not sure why. |
Found another bug, we're reusing the same dataset for all samplers. For the first sampler, the cache is empty, but for later samplers it is not. So this results in an unfair comparison between samplers. Which of the following options should we use?
Option 1 represents the average sampling rate when starting from scratch with an empty cache. Option 2 represents a better average after the cache has already been populated. I'm leaning towards 2 since the cache will be full for the vast majority of the training time when running through multiple epochs. |
We can also manually clear the cache between samplers: https://www.geeksforgeeks.org/clear-lru-cache-in-python/ |
40a3b3e
to
dd1c8a2
Compare
for _ in range(num_batches): | ||
num_total_patches += args.batch_size | ||
x = torch.rand(args.batch_size, len(bands), args.patch_size, args.patch_size) | ||
# y = torch.randint(0, 256, (args.batch_size, args.patch_size, args.patch_size)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is left over from when I was thinking about benchmarking a segmentation model instead of ResNet. I think segmentation is one of the more common tasks in remote sensing, and the models are more complex and therefore slower. If we want to have a slower model for comparison with our data loading rates, it might be good to use something like Mask R-CNN instead.
* Add dataset/sampler benchmarking script * Some changes to get the benchmark script working * Added writing results to file * Added script for running a grid of benchmark experiments * Actual experiment configuration * Improve help message formatting * Remove default for mutually exclusive required group * Rounding, units, ignore output file * Fix a couple bugs in counting patches * Display cache info * Increase cache size * Cache is shared * Benchmark model as well * Warp to same CRS/res as CDL * Work around bug in sampler * Fix isort * Allow specification of CPU/GPU device Co-authored-by: Caleb Robinson <[email protected]>
This PR adds a script to benchmark our GeoDataset/GeoSampler implementations. I would like to commit this script to the repo for three reasons:
Now I just need to download some data and run it. Before I run it, we should make sure these default sizes/CRS/res/etc. look reasonable.
Closes #81