Skip to content

Conversation

@heitorschueroff
Copy link
Contributor

@heitorschueroff heitorschueroff commented Oct 23, 2020

Stack from ghstack:

Benchmark

------------------------------------------------------------------------------------------ benchmark: 2 tests ------------------------------------------------------------------------------------------
Name (time in us)             Min                   Max                  Mean              StdDev                Median                IQR            Outliers         OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_grad_disabled       390.0155 (1.0)        533.4131 (1.0)        392.6161 (1.0)        8.5603 (1.0)        390.7457 (1.0)       0.3912 (1.0)        98;319  2,547.0171 (1.0)        2416           1
test_grad_enabled      3,116.7269 (7.99)     4,073.2883 (7.64)     3,178.0827 (8.09)     122.7487 (14.34)    3,142.2675 (8.04)     33.0228 (84.42)       10;22    314.6551 (0.12)        225           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

snippet (using pytest benchmark module)

import torch

torch.set_num_threads(1)
x = torch.randn(1000, 10, 36, requires_grad=True)

def test_grad_enabled(benchmark):
    benchmark(torch.max_pool1d, x, 2)

def test_grad_disabled(benchmark):
    torch.set_grad_enabled(False)
    benchmark(torch.max_pool1d, x, 2)

Differential Revision: D24565126

heitorschueroff added a commit that referenced this pull request Oct 23, 2020
ghstack-source-id: e45eb58
Pull Request resolved: #46767
@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #46767 into gh/heitorschueroff/21/base will decrease coverage by 0.00%.
The diff coverage is n/a.

@@                      Coverage Diff                       @@
##           gh/heitorschueroff/21/base   #46767      +/-   ##
==============================================================
- Coverage                       68.98%   68.98%   -0.01%     
==============================================================
  Files                             433      433              
  Lines                           55921    55921              
==============================================================
- Hits                            38579    38578       -1     
- Misses                          17342    17343       +1     

@facebook-github-bot
Copy link
Contributor

@heitorschueroff merged this pull request in bbe5bfa.

@facebook-github-bot facebook-github-bot deleted the gh/heitorschueroff/21/head branch October 31, 2020 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants