Commit Graph

75 Commits

Author SHA1 Message Date
albanD
3e0f1a8a32 Add option to skip binaries when doing pip install for lintrunner (#78668)
This is a workaround for https://github.com/suo/lintrunner/issues/7
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78668
Approved by: https://github.com/suo
2022-06-02 20:50:57 +00:00
Nikita Shulga
ab1b4aa237 Make s3_init linter adapter work in abscense of git (#77466)
Summary: PYTORCH_ROOT is just 3 folders above `s3_init.__file__`

Test Plan: CI

Differential Revision: D36389775

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77466
Approved by: https://github.com/suo
2022-05-14 00:23:36 +00:00
Michael Suo
6cbe9d1f58 [ci] delete old linter stuff
lintrunner has been running for a while, so delete redundant linter
things

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76984

Approved by: https://github.com/janeyx99
2022-05-11 07:40:44 +00:00
PyTorch MergeBot
12f67ed2c0 Revert "[ci] delete old linter stuff"
This reverts commit 3a68155ce0.

Reverted https://github.com/pytorch/pytorch/pull/76984 on behalf of https://github.com/janeyx99
2022-05-10 23:17:40 +00:00
Michael Suo
3a68155ce0 [ci] delete old linter stuff
lintrunner has been running for a while, so delete redundant linter
things

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76984

Approved by: https://github.com/janeyx99
2022-05-10 22:06:18 +00:00
Michael Suo
7eb7b090b0 [lint] make grep_linter.py portable
grep_linter.py was using the `-P` flag of `grep`, which is available in
GNU grep but notably *not* available in the BSD grep that is installed
on Macs.

Use `-E` instead, which uses ERE instead of PCRE. Sadly we were actually
using two PCRE features in our linters:
- Negative lookaheads. I changed these to less-accurate-but-still-good-enough
  versions that use `[^...]` expressions.
- Apparently ERE doesn't support the `\t` atom lol. So I used a literal tab
  character instead (and then had to disable the TAB linter for
  `.lintrunner.toml` lol.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76947

Approved by: https://github.com/ezyang
2022-05-07 00:33:53 +00:00
Sherlockk Huang
8b6a78f39f Python Interface for Jiterator
This PR allows user to author a CUDA kernel in python.

```
from torch.cuda.jiterator import create_jit_fn

code_string = "template <typename T> T my_kernel(T x, T y, T alpha) { return  -x * y + x - y + alpha; }"
jitted_fn = create_jit_fn(code_string, alpha=0)

a = torch.rand(3, device='cuda')
b = torch.rand(3, device='cuda')
result = jitted_fn(a, b, alpha=1.0)
```

Limitations:
- Only supports elementwise kernel
- 1~8 tensor inputs (empty input, e.g. factory methods, is not supported)
- inputs tensors must live in cuda device
- cpu Scalar is not supported
- kwargs must be pre-declared when calling create_jit_fn
- kwargs must be convertible to at::Scalar, one of float64, int64_t, bool. (complex not support for now)

TODOs:
- [x] consolidate union and c10::variant implementation
- [x] plug into existing op testing framework
- [ ] rename files, place files in the right folder
- [ ] place util functions in the right file
- [x] enforce assumptions in python interface e.g <8 inputs, kwargs types
- [x] Add user-facing documentation
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76394
Approved by: https://github.com/mruberry
2022-05-06 18:44:28 +00:00
Michael Suo
84641d0dba [lint] fix pip init for lint when user has a global install
Closes https://github.com/suo/lintrunner/issues/4.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76707
Approved by: https://github.com/janeyx99
2022-05-03 19:36:59 +00:00
anjali411
b204ad863f Revert "Revert "Allow specifying tags for aten operators in native_functions.yaml""
This reverts commit ea44645c9a.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76456

Approved by: https://github.com/osalpekar
2022-04-28 02:04:57 +00:00
Baoshuo Ren
4120cfd018 chore: remove git.io
All links on git.io will stop redirecting after April 29, 2022.

- https://github.blog/changelog/2022-04-25-git-io-deprecation/

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76426
Approved by: https://github.com/ngimel
2022-04-27 23:02:45 +00:00
Edward Z. Yang
d286197e81 Add black linter
Signed-off-by: Edward Z. Yang <ezyangfb.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76352

Approved by: https://github.com/suo
2022-04-26 02:01:32 +00:00
Edward Yang
36420b5e8c Rename tools/codegen to torchgen (#76275)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76275

In preparation for addressing
https://github.com/pytorch/pytorch/issues/73212

Diff was generated with:

```
git mv tools/codegen torchgen
git grep -l 'tools.codegen' | xargs sed -i 's/tools.codegen/torchgen/g'
sed -i "s/\${TOOLS_PATH}\/codegen/\${TORCH_ROOT}\/torchgen/g" caffe2/CMakeLists.txt
```

and a manual edits to:

* tools/test/test_gen_backend_stubs.py
* torchgen/build.bzl
* torchgen/gen_backend_stubs.py

aka this diff:

```
 diff --git a/tools/test/test_gen_backend_stubs.py b/tools/test/test_gen_backend_stubs.py
index 3dc26c6d2d..104054575e 100644
 --- a/tools/test/test_gen_backend_stubs.py
+++ b/tools/test/test_gen_backend_stubs.py
@@ -9,7 +9,7 @@ from torchgen.gen_backend_stubs import run
 from torchgen.gen import _GLOBAL_PARSE_NATIVE_YAML_CACHE  # noqa: F401

 path = os.path.dirname(os.path.realpath(__file__))
-gen_backend_stubs_path = os.path.join(path, '../torchgen/gen_backend_stubs.py')
+gen_backend_stubs_path = os.path.join(path, '../../torchgen/gen_backend_stubs.py')

 # gen_backend_stubs.py is an integration point that is called directly by external backends.
 # The tests here are to confirm that badly formed inputs result in reasonable error messages.
 diff --git a/torchgen/build.bzl b/torchgen/build.bzl
index ed04e35a43..d00078a3cf 100644
 --- a/torchgen/build.bzl
+++ b/torchgen/build.bzl
@@ -1,6 +1,6 @@
 def define_targets(rules):
     rules.py_library(
-        name = "codegen",
+        name = "torchgen",
         srcs = rules.glob(["**/*.py"]),
         deps = [
             rules.requirement("PyYAML"),
@@ -11,6 +11,6 @@ def define_targets(rules):

     rules.py_binary(
         name = "gen",
-        srcs = [":codegen"],
+        srcs = [":torchgen"],
         visibility = ["//visibility:public"],
     )
 diff --git a/torchgen/gen_backend_stubs.py b/torchgen/gen_backend_stubs.py
index c1a672a655..beee7a15e0 100644
 --- a/torchgen/gen_backend_stubs.py
+++ b/torchgen/gen_backend_stubs.py
@@ -474,7 +474,7 @@ def run(
 ) -> None:

     # Assumes that this file lives at PYTORCH_ROOT/torchgen/gen_backend_stubs.py
-    pytorch_root = pathlib.Path(__file__).parent.parent.parent.absolute()
+    pytorch_root = pathlib.Path(__file__).parent.parent.absolute()
     template_dir = os.path.join(pytorch_root, "aten/src/ATen/templates")

     def make_file_manager(install_dir: str) -> FileManager:
```

run_all_fbandroid_tests

Test Plan: sandcastle

Reviewed By: albanD, ngimel

Differential Revision: D35770317

fbshipit-source-id: 153ac4a7fef15b1e750812a90bfafdbc8f1ebcdf
(cherry picked from commit c6d485d1d4648fa1c8a4c14c5bf3d8e899b9b4dd)
2022-04-25 01:38:06 +00:00
Edward Z. Yang
a11c1bbdd0 Run Black on all of tools/
Signed-off-by: Edward Z. Yang <ezyangfb.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76089

Approved by: https://github.com/albanD
2022-04-20 17:29:41 +00:00
Michael Suo
d8374efb53 [lint] fix spurious annotations on formatting linters
We would for some reason report formatting-based lints as showing up at
line 1 column 1. This removes them for now. Maybe eventually we can
recover better line numbers from the formatting diff and post messages
for each diff cluster, but that requires actual changes to the linting
engine.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75928

Approved by: https://github.com/janeyx99
2022-04-16 04:05:30 +00:00
Peter Bell
702c7f00e2 Exclude mobile TorchScript models from linter checks
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75906

Approved by: https://github.com/suo
2022-04-16 00:04:49 +00:00
Michael Suo
3e0e137555 [lint] add test ownership lint to lintrunner
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75898

Approved by: https://github.com/seemethere, https://github.com/janeyx99
2022-04-15 20:20:40 +00:00
Michael Suo
123297a8c0 [lint] use python to run flake8 and mypy in linter
Previously we were just using whatever version the shell picked up, but
malfet reported that this can (and is) overridden on some machines.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75858

Approved by: https://github.com/malfet
2022-04-15 04:22:45 +00:00
Michael Suo
356f1478d8 [lint] add actionlint to lintrunner
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75857

Approved by: https://github.com/malfet
2022-04-15 04:03:54 +00:00
Michael Suo
cbbb96c271 [lint] add shellcheck to lintrunner
As title

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75856

Approved by: https://github.com/malfet
2022-04-15 04:03:54 +00:00
Michael Suo
d2e7e4e2e4 [lint] add back some omitted clangtidy folders
as title, some more inclusions were added.

tested by confirming that the following command is clean:
```
lintrunner --paths-cmd='git grep -Il .' --take CLANGTIDY
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75814

Approved by: https://github.com/seemethere
2022-04-15 02:23:44 +00:00
Michael Suo
1c60b9aaa5 [ci] use lintrunner in CI
This changes our lint workflows to use lintrunner for the linters that
are currently supported

+ some random fixes to make things lint clean on master
+ changes to Makefile to use lintrunner

Pull Request resolved: https://github.com/pytorch/pytorch/pull/68460

Approved by: https://github.com/t10-13rocket, https://github.com/seemethere, https://github.com/janeyx99
2022-04-15 00:08:21 +00:00
PyTorch MergeBot
db6165215e Revert "[ci] use lintrunner in CI"
This reverts commit 4c3ee53522.

Reverted https://github.com/pytorch/pytorch/pull/68460 on behalf of https://github.com/malfet
2022-04-14 23:27:27 +00:00
Michael Suo
4c3ee53522 [ci] use lintrunner in CI
This changes our lint workflows to use lintrunner for the linters that
are currently supported

+ some random fixes to make things lint clean on master
+ changes to Makefile to use lintrunner

Pull Request resolved: https://github.com/pytorch/pytorch/pull/68460

Approved by: https://github.com/t10-13rocket, https://github.com/seemethere, https://github.com/janeyx99
2022-04-14 17:43:41 +00:00
Michael Suo
fe1e6de73a [lint] fixes to mypy linter
I thought I landed this already, but:
- Don't run one mypy instance per file, run one per config
- Do the same for flake8
- Properly handle stub files

Pull Request resolved: https://github.com/pytorch/pytorch/pull/68479

Approved by: https://github.com/janeyx99
2022-04-13 17:14:24 +00:00
Sergii Dymchenko
e3f546af13 Remove flake8 pre-commit hook
Fixes #69500
See the issue for details.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75385
Approved by: https://github.com/seemethere, https://github.com/malfet
2022-04-07 19:01:30 +00:00
mikey dagitses
60729d02f1 remove unused nn_path from generate_code (#74563)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74563

This is used inconsistently in all the generate_code program
invocations. Nevertheless, nothing consumes this flag, so we can
safely remove it.

This was removed in #25353.
ghstack-source-id: 152249818

Test Plan: Should be a no-op, rely on CI.

Reviewed By: malfet

Differential Revision: D35053096

fbshipit-source-id: 3ad19e83ca14649b514dc163c3caff6cbd118e14
(cherry picked from commit a43f05bb43553249caac3c3479986cbc45d286ae)
2022-03-31 18:35:30 +00:00
Nikita Shulga
ce700da7f4 [Deploy] Change numModules type to unsigned (#74978)
Summary:
As it should never be negative, should it?
Also, add `torch/csrc/deploy` to the list of clang-format checked folders (as they are internally)

Last but not least: clang-tidy correctly identifies `totNumModules <= SIZE_MAX / sizeof(struct _frozen) - 1` as unneeded always true check (as `totNumModules` is int32, while SIZE_MAX is int64 and `sizeof(sturct_frozen)` is less than 4Gb ;) )

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74978

Reviewed By: suo, tugsbayasgalan

Differential Revision: D35261476

Pulled By: malfet

fbshipit-source-id: 8a3432d2d9e96ded3f08baee14ccb43d2635a67d
(cherry picked from commit 21f6c33166c8e4e16dcac0248cb9006f69e222a1)
2022-03-31 07:22:54 +00:00
Nikita Shulga
3eea311c0c [Lint] Clang-format ios folder
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74938

Approved by: https://github.com/osalpekar, https://github.com/linbinyu
2022-03-30 15:38:26 +00:00
Shubhorup Biswas
e505f06a79 More folders in clang-tidy (#74908)
Summary:
1. Added folders torch/csrc/onnx and torch/csrc/cuda to clang-tidy.
2. Fixed clang-tidy violations in torch/csrc/cuda
3. Fixed(added Python import paths) in clang-tidy Python runner

Fixes some of https://github.com/pytorch/pytorch/issues/62011

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74908

Reviewed By: atalman

Differential Revision: D35221843

Pulled By: shahofblah

fbshipit-source-id: f0d1f066550b383aa48449b12d194009977c0bd8
(cherry picked from commit 830186a673f432c9f3558f3e9cf1cd4294fa0fb0)
2022-03-29 22:59:16 +00:00
PyTorch MergeBot
ea44645c9a Revert "Allow specifying tags for aten operators in native_functions.yaml"
This reverts commit 1dab71ab25.

Reverted https://github.com/pytorch/pytorch/pull/72549 on behalf of https://github.com/malfet
2022-03-28 18:04:38 +00:00
anjali411
1dab71ab25 Allow specifying tags for aten operators in native_functions.yaml
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72549

Approved by: https://github.com/ezyang
2022-03-25 21:17:52 +00:00
Han Qi
75d6cbe605 [4/5]Testing jit module in flatbuffer in Python. (#74387)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74387

Make temporary python bindings for flatbuffer to test ScriptModule save / load.

(Note: this ignores all push blocking failures!)

Test Plan: unittest

Reviewed By: iseeyuan

Differential Revision: D34968080

fbshipit-source-id: d23b16abda6e4b7ecf6b1198ed6e00908a3db903
(cherry picked from commit 5cbbc390c5f54146a1c469106ab4a6286c754325)
2022-03-24 23:29:47 +00:00
Will Constable
3547f20872 Land remaining parts of Torchscript Lazy Tensor backend (#74111)
Summary:
Also enables bazel build to run lazy codegen.  Bazel (oss) build feeds off the same filelists as cmake/buck (build_variables.bzl), so enabling it is easier than keeping it disabled.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74111

Test Plan: Run CI and verify test_lazy_ops is running via OSS cmake builds

Reviewed By: bdhirsh

Differential Revision: D34772403

fbshipit-source-id: 8a63f58b9536e6ac1be530667932176ef2549496
(cherry picked from commit e807ffb1918853d10b924fdc24f85ee5b1a39021)
2022-03-22 23:14:03 +00:00
Han Qi
3e556efc29 regenerate flatbuffer header (#73810)
Summary:
Update flatbuffer generated header and add it to ignore for clang format

Pull Request resolved: https://github.com/pytorch/pytorch/pull/73810

Test Plan: CI

Reviewed By: iseeyuan

Differential Revision: D34652217

Pulled By: qihqi

fbshipit-source-id: fe281afd25d618d2e4852d6b76b813e2fbee0ddc
(cherry picked from commit 095ee360b573506ac946de142bd266b8d3bac58e)
2022-03-11 20:21:56 +00:00
Peter Bell
4829dcea09 Codegen: Generate seperate headers per operator (#68247)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68247

This splits `Functions.h`, `Operators.h`, `NativeFunctions.h` and
`NativeMetaFunctions.h` into seperate headers per operator base name.
With `at::sum` as an example, we can include:
```cpp
<ATen/core/sum.h>         // Like Functions.h
<ATen/core/sum_ops.h>     // Like Operators.h
<ATen/core/sum_native.h>  // Like NativeFunctions.h
<ATen/core/sum_meta.h>    // Like NativeMetaFunctions.h
```

The umbrella headers are still being generated, but all they do is
include from the `ATen/ops' folder.

Further, `TensorBody.h` now only includes the operators that have
method variants. Which means files that only include `Tensor.h` don't
need to be rebuilt when you modify function-only operators. Currently
there are about 680 operators that don't have method variants, so this
is potentially a significant win for incremental builds.

Test Plan: Imported from OSS

Reviewed By: mrshenli

Differential Revision: D32596272

Pulled By: albanD

fbshipit-source-id: 447671b2b6adc1364f66ed9717c896dae25fa272
2021-12-14 06:40:08 -08:00
Yanan Cao
17f3179d60 Back out "[pytorch][PR] Add ability for a mobile::Module to save as flatbuffer" (#69796)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69796

(Note: this ignores all push blocking failures!)

Test Plan: External CI + Sandcastle

Reviewed By: zhxchen17

Differential Revision: D33032671

fbshipit-source-id: dbf6690e960e25d6a5f19043cbe792add2acd7ef
2021-12-10 21:29:53 -08:00
Han Qi
d3649309e6 [pytorch][PR] Add ability for a mobile::Module to save as flatbuffer (#69306)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69306

Included functions:

save_mobile_module -> saves a mobile::Module to flatbuffer
load_mobile_module_from_file -> loads a flatbuffer into mobile::Module
parse_mobile_module -> parses from bytes or deserialized flatbuffer
Module object

Test Plan: unittests

Reviewed By: gmagogsfm

Differential Revision: D32806835

fbshipit-source-id: 71913c6650e225634f878946bd16960d377a7f57
2021-12-09 14:53:31 -08:00
Alban Desmaison
00ebbd5ef6 Revert D32010095: [pytorch][PR] Add ability for a mobile::Module to save as flatbuffer
Test Plan: revert-hammer

Differential Revision:
D32010095 (41d35dc201)

Original commit changeset: d763b0557780

fbshipit-source-id: bf746a0389135c9f5f67f00f449435ce08fb5f6d
2021-12-02 06:41:40 -08:00
Han Qi
41d35dc201 Add ability for a mobile::Module to save as flatbuffer (#67351)
Summary:
Included functions:

* save_mobile_module -> saves a mobile::Module to flatbuffer
* load_mobile_module_from_file -> loads a flatbuffer into mobile::Module
* parse_mobile_module -> parses from bytes or deserialized flatbuffer
      Module object

Fixes #{issue number}

Pull Request resolved: https://github.com/pytorch/pytorch/pull/67351

Reviewed By: iseeyuan

Differential Revision: D32010095

Pulled By: qihqi

fbshipit-source-id: d763b0557780f7c2661b6485105b045e41a5e8f1
2021-12-01 23:58:15 -08:00
Michael Suo
24b60b2cbf [lint] lintrunner fixes/improvements (#68292)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68292

- noqa was typo-d to be the same as type: ignore
- generalize clang-tidy initialization and use it for clang_format as well
- Add a script that lets you update the binaries in s3 relatively easily

Test Plan: Imported from OSS

Reviewed By: malfet

Differential Revision: D32403934

Pulled By: suo

fbshipit-source-id: 4e21b22605216f013d87d636a205707ca8e0af36
2021-11-15 11:08:26 -08:00
Michael Suo
9571eb599c [lint] fix up clangtidy lintrunner integration (#68192)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68192

- Run on exactly the same stuff as the existing linter checks.
- Exclude deploy interpreter headers from being reported.

Test Plan: Imported from OSS

Reviewed By: janeyx99

Differential Revision: D32364023

Pulled By: suo

fbshipit-source-id: c27eca4a802534875d609d004fa9f6fca59ae6a5
2021-11-11 14:53:28 -08:00
Michael Suo
b473ca999b [lint] add cmakelint to lintrunner (#68191)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68191

+ fix filename of exec_linter

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32364022

Pulled By: suo

fbshipit-source-id: 740892d9580edc348c3e818664fd37f145669fda
2021-11-11 12:19:01 -08:00
Michael Suo
726e2ed715 [lint] add more lints to lintrunner (#68069)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68069

- executable bit
- cub include
- raw CUDA API usage

Test Plan: Imported from OSS

Reviewed By: janeyx99

Differential Revision: D32286559

Pulled By: suo

fbshipit-source-id: 21d58e259c951424f9c6cbf1dac6d79fe7236aa4
2021-11-09 12:48:56 -08:00
Michael Suo
8e2528132b [lint] small updates to .lintrunner.toml (#67942)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67942

- Change "name" to "code" for consistency with linttool and LintMessage
format.
- Change "args" and "init_args" to "command" and "init_command" for
consistency with internal representation.

Test Plan: Imported from OSS

Reviewed By: H-Huang

Differential Revision: D32250606

Pulled By: suo

fbshipit-source-id: 557fef731bab9adca7ab1e7cc41b996956076b05
2021-11-08 09:45:26 -08:00
Michael Suo
d201102d36 [lint] Add the rest of the grep linters (#67932)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67932

Also various improvements to grep_linter.py, including the ability to
specify a replacement pattern.

Test Plan: Imported from OSS

Reviewed By: H-Huang

Differential Revision: D32250603

Pulled By: suo

fbshipit-source-id: e07eb182e9473a268e2b805a68a859b91228bfbb
2021-11-08 09:45:20 -08:00
Michael Suo
53f118c800 [lint] improve mypy lintrunner config (#67936)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67936

- Add the strict config
- Make the patterns exactly match the current CI
- Add init_args

Test Plan: Imported from OSS

Reviewed By: H-Huang

Differential Revision: D32250605

Pulled By: suo

fbshipit-source-id: a71d434bf6024db4462260a460a1bc2d9ac66a32
2021-11-08 09:45:14 -08:00
Michael Suo
419c58ea9c [lint] add newlines linter to lintrunner (#67894)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67894

As title. Confirmed that the code base passes by running:

```
lintrunner --paths-cmd='git grep -Il ""' --take NEWLINE
```

and seeing that it pases

Test Plan: Imported from OSS

Reviewed By: H-Huang

Differential Revision: D32250604

Pulled By: suo

fbshipit-source-id: de9bcba635d21f8832bb25147b19b7b2e8802247
2021-11-08 09:45:07 -08:00
Michael Suo
4b021280ad [lint] add nativefunctions to lintrunner (#67890)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67890

Adding another linter. I also added a generic initializer that installs
the right pip packages (you can invoke it by running `lintrunner init`).

Differential Revision:
D32197366
D32197366

Test Plan: Imported from OSS

Reviewed By: driazati

Pulled By: suo

fbshipit-source-id: 82844e78f1ee3047220d8444874eab41d7cc0e9e
2021-11-08 09:44:59 -08:00
Michael Suo
5bb5bfccf7 [lint] add lintrunner support for circleci_linter (#67872)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67872

As title. This demonstrates some of the nice features of lintrunner:
- Uniform error reporting means you get a nice diff of the changes for
free
- Can run with -a to just accept the changes (don't need to tell people
to run a special regenerate command since the linter adaper already knows how.)

Differential Revision:
D32187386
D32187386

Test Plan: Imported from OSS

Reviewed By: driazati

Pulled By: suo

fbshipit-source-id: 71de6b042730be80ff6794652039e9bc655a72b1
2021-11-08 09:43:25 -08:00
Peter Bell
fe91906ad7 Remove Declarations.yaml dependency from gen_autograd (#67496)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67496

gen_autograd.py doesn't use `Declarations.yaml` any more, and removing
the dependency allows it to run in parallel with
`tools/codegen/gen.py`.

Test Plan: Imported from OSS

Reviewed By: dagitses, ejguan

Differential Revision: D32027251

Pulled By: albanD

fbshipit-source-id: 2cc0bbe36478e6ec497f77a56ab8d01c76145703
2021-11-03 13:19:24 -07:00