[Static Runtime] Added a variable for clamp in the NNC code for Logit. (#63839)
authorRaghavan Raman <raghavanr@fb.com>
Wed, 25 Aug 2021 18:12:57 +0000 (11:12 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 25 Aug 2021 18:19:55 +0000 (11:19 -0700)
commitdde07cad6f029c2727487544b851dfd74945efb1
tree80422b480decaa91baed19a82a6d606e8cd486af
parenta2399a76e18b31747019ead8f80e2a4eb53e8223
[Static Runtime] Added a variable for clamp in the NNC code for Logit. (#63839)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63839

Replaced the use of a constant for clamp in the NNC code for Logit
with a variable. This makes it easier to enable caching for Logit.

There is no performance difference with this change, as shown in the micro-benchmarks below.

```
Logit NNC Benchmark Time (ns)
           const-clamp var-clamp
logit_nnc_sleef/64 550 543
logit_nnc_sleef/512 3514 3517
logit_nnc_sleef/8192 85537 82900
logit_nnc_sleef/32768 347635 337016
logit_nnc_fast/64 173 167
logit_nnc_fast/512 829 866
logit_nnc_fast/8192 13286 13069
logit_nnc_fast/32768 51116 53429
logit_nnc_vml/64 146 164
logit_nnc_vml/512 773 783
logit_nnc_vml/8192 11556 11563
logit_nnc_vml/32768 44815 46720
```

Test Plan: SR unit tests and the inline_cvr model.

Reviewed By: bertmaher

Differential Revision: D30405466

fbshipit-source-id: adb891fdae5746439931ce5f43165291fec08f52
torch/csrc/jit/runtime/static/ops.cpp
torch/csrc/jit/runtime/static/te_wrapper.cpp
torch/csrc/jit/runtime/static/te_wrapper.h