Skip to content

Commit

Permalink
Increase the default batch size of alexnet (#919)
Browse files Browse the repository at this point in the history
Summary:
The default batch size for alexnet is too small and is not a proper workload for GPU. Some performance issues (e.g., pytorch/pytorch#76970) only affects small batch size inputs and I believe they are insignificant in real settings.
This PR increases the default batch size for alexnet on GPU.

Although this PR will also increase CPU batch size, we are working on a PR that uses separate batch sizes for different devices, which will use small batch size for CPU, and large batch size for GPU.

Pull Request resolved: #919

Reviewed By: jansel

Differential Revision: D36549692

Pulled By: xuzhao9

fbshipit-source-id: 03552c1f5617670797b7ea9069be926293da4f34
  • Loading branch information
xuzhao9 authored and facebook-github-bot committed May 20, 2022
1 parent 113887c commit af847a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchbenchmark/models/alexnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Model(TorchVisionModel):
# Train batch size: use the smallest example batch of 128 (assuming only 1 worker)
# Source: https://arxiv.org/pdf/1404.5997.pdf
DEFAULT_TRAIN_BSIZE = 128
DEFAULT_EVAL_BSIZE = 16
DEFAULT_EVAL_BSIZE = 128

def __init__(self, test, device, jit, batch_size=None, extra_args=[]):
super().__init__(model_name="alexnet", test=test, device=device, jit=jit,
Expand Down

0 comments on commit af847a9

Please sign in to comment.