-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The code has been improved to deal with `torch.nn.DataParallel`. It can now be used to train in parallel with decent speedups. This was executed on a 2 x NVIDIA TITAN RTX system: In [1]: import torch ...: from msd_pytorch import MSDRegressionModel ...: model = MSDRegressionModel(1, 1, 100, 1) ...: inp0 = torch.zeros(16, 1, 1000, 1000, dtype=torch.float32, device=torch.device("cuda:0")) ...: inp1 = torch.zeros(16, 1, 1000, 1000, dtype=torch.float32, device=torch.device("cuda:1")) ...: par_net = torch.nn.DataParallel(model.net, device_ids=[0,1]) In [2]: %timeit par_net(inp0) 1.03 s ± 1.8 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) In [2]: %timeit model.net(inp0) 2.83 s ± 2.35 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
- Loading branch information
Allard Hendriksen
committed
Jul 30, 2019
1 parent
335cf17
commit 3f1d648
Showing
9 changed files
with
117 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters