r2plus1d - strange relationship with inference batch size and inference speed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
I'm seeing a weird relationship between inference batch size and inference speed that I can't explain. I have an r2plus1d resnet18 model that I trained. Input size is 8x32x32x3. I've been running some tests with fake data (random arrays) to measure inference speed as a function of batch size. For some reason, when the batch size increases from 6 to 7, the throughput suddenly drops significantly. It then slowly increases with the batch size until going from batch size of 24 to 25, at which point the throughput nearly doubles. I'm running this on a machine with one RTX 2080 with no other major processes running at the same time. I can run the experiment multiple times and I see the same phenomenon. I'm using Torch 1.9.1+cu102 and Torchvision 0.10.1+cu102. If anyone has any insight that might explain what I'm seeing, I'd appreciate it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named. Start by reproducing the reported r2plus1d ResNet-18 benchmark with fake data across batch sizes 6–25 on the stated Torch and Torchvision versions, then compare timings and profiling results. Done means identifying a reproducible explanation for the throughput changes or documenting the cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100
