Skip to content

Conversation

ailzhang
Copy link
Contributor

@ailzhang ailzhang commented Apr 6, 2021

Summary:
Pull Request resolved: #55238

I tried to avoid creating new TLS, but InferenceMode::is_enabeld()
is in perf critical path (TensorImpl constructor) so it seems
worth adding one for it.
This PR reduces one sources of instruction count increased by
#55008.

 λ ~ python compare.py
<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.FunctionCounts object at 0x7f59097ef310>
     100  0x0000000004854750
    -100  0x0000000004854760
   -4400  c10::impl::tls_is_dispatch_key_included(...)

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D27539230

Pulled By: ailzhang

Summary:
Pull Request resolved: pytorch#55238

I tried to avoid creating new TLS, but InferenceMode::is_enabeld()
is in perf critical path (TensorImpl constructor) so it seems
worth adding one for it.
This PR reduces one sources of instruction count increased by
pytorch#55008.
```
 λ ~ python compare.py
<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.FunctionCounts object at 0x7f59097ef310>
     100  0x0000000004854750
    -100  0x0000000004854760
   -4400  c10::impl::tls_is_dispatch_key_included(...)
```

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D27539230

Pulled By: ailzhang

fbshipit-source-id: 54b0c141d59ac569a154a036b284001fca9fc560
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Apr 6, 2021

💊 CI failures summary and remediations

As of commit 6dd97c1 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-scanned failure(s)

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D27539230

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #55424 (6dd97c1) into master (79fe5b7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #55424   +/-   ##
=======================================
  Coverage   77.42%   77.42%           
=======================================
  Files        1895     1895           
  Lines      187462   187470    +8     
=======================================
+ Hits       145143   145152    +9     
+ Misses      42319    42318    -1     

@facebook-github-bot
Copy link
Contributor

@ailzhang merged this pull request in bc05867.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants