Repository: pytorch/TensorRT

Issue:
 trtorch._C.compile_graph - RuntimeError: required keyword attribute 'use_input_stats' is undefined
##  Bug Description

  File "/home/oliver/miniconda3/lib/python3.7/site-packages/trtorch/_compiler.py", line 66, in compile
    compiled_cpp_mod = trtorch._C.compile_graph(module._c, _parse_compile_spec(compile_spec))
RuntimeError: required keyword attribute 'use_input_stats' is undefined


## To Reproduce

  ```
import trtorch
  import torch
  import torch.nn as nn

  m = torch.nn.Conv2d(3, 10, (3, 3))
  inp = torch.zeros(1, 3, 64, 64)

  traced = torch.jit.trace(m, inp)

  compile_settings = dict(
    input_shapes = [inp.shape],
    op_precision = torch.half
  )

  trtorch.compile(traced, compile_settings)

```
```

  trtorch.compile(traced, compile_settings)
  File "/home/oliver/miniconda3/lib/python3.7/site-packages/trtorch/_compiler.py", line 66, in compile
    compiled_cpp_mod = trtorch._C.compile_graph(module._c, _parse_compile_spec(compile_spec))
RuntimeError: required keyword attribute 'use_input_stats' is undefined

```


## Expected behavior

Expect to run without exception.

## Environment

 - TRTorch Version: github 0.3.0a0
 - PyTorch Version: 1.8.1
 - CPU Architecture: amd64
 - OS (e.g., Linux): Ubuntu 20.04
 - How you installed PyTorch (`conda`, `pip`, `libtorch`, source): conda
 - Build command you used (if compiling from source):  bazel build //:libtrtorch --compilation_mode opt --distdir third_party/dist_dir/x86_64-linux-gnu; python setup.py install

 - Are you using local sources or building from archives: From sources - Python version:
 - CUDA version: 11.1
 - GPU models and configuration: RTX 2070
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->



Discussion:
This error seems to be specific to pytorch 1.8.1 issue. We currently support torch 1.8.0 + cuda-11.1. Can you try with this configuration ? You can install them by 
```
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
```
Using the above config, your test script runs fine for me.

Resolving patch:
diff --git a/.github/scripts/run_cpp_linter.py b/.github/scripts/run_cpp_linter.py
--- a/.github/scripts/run_cpp_linter.py
+++ b/.github/scripts/run_cpp_linter.py
@@ -23,8 +23,10 @@
 if output.returncode != 0:
     comment = '''There are some changes that do not conform to C++ style guidelines:\n ```diff\n{}```'''.format(output.stdout.decode("utf-8"))
     approval = 'REQUEST_CHANGES'
-    exit(1)
 
 pr.create_review(commit, comment, approval)
 
-
+if output.returncode != 0:
+    exit(1)
+else:
+    exit(0)
\ No newline at end of file
diff --git a/.github/scripts/run_py_linter.py b/.github/scripts/run_py_linter.py
--- a/.github/scripts/run_py_linter.py
+++ b/.github/scripts/run_py_linter.py
@@ -23,6 +23,10 @@
 if output.returncode != 0:
     comment = '''There are some changes that do not conform to Python style guidelines:\n ```diff\n{}```'''.format(output.stdout.decode("utf-8"))
     approval = 'REQUEST_CHANGES'
-    exit(1)
 
 pr.create_review(commit, comment, approval)
+
+if output.returncode != 0:
+    exit(1)
+else:
+    exit(0)
\ No newline at end of file
diff --git a/cpp/ptq/training/vgg16/main.py b/cpp/ptq/training/vgg16/main.py
--- a/cpp/ptq/training/vgg16/main.py
+++ b/cpp/ptq/training/vgg16/main.py
@@ -167,7 +167,7 @@ def test(model, dataloader, crit, epoch):
     model.eval()
     with torch.no_grad():
         for data, labels in dataloader:
-            data, labels = data.cuda(), labels.cuda(async=True)
+            data, labels = data.cuda(), labels.cuda(non_blocking=True)
             out = model(data)
             loss += crit(out, labels)
             preds = torch.max(out, 1)[1]


Test patch: