Commit graph

188 commits

Author SHA1 Message Date
Andrey Talman
6c4437118b Deprecating Python 3.6 (#70493)
Summary:
Deprecating python 3.6 from documentation and from cmake

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

Reviewed By: suo

Differential Revision: D33433118

Pulled By: atalman

fbshipit-source-id: c3adc7b75714efdb5b6acda5d4cddc068fb4a145
2022-01-05 11:46:32 -08:00
Michael Suo
1adb70c6f0 Revert D33409880: [pytorch][PR] Deprecating Python 3.6
Test Plan: revert-hammer

Differential Revision:
D33409880 (d95be99561)

Original commit changeset: 4f9123398960

Original Phabricator Diff: D33409880 (d95be99561)

fbshipit-source-id: 32dc1c3c07ef99a04fab7d0fb742cf4e6c4b718a
2022-01-04 16:37:09 -08:00
Andrey Talman
d95be99561 Deprecating Python 3.6 (#70493)
Summary:
Deprecating python 3.6 from documentation and from cmake

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

Reviewed By: malfet

Differential Revision: D33409880

Pulled By: atalman

fbshipit-source-id: 4f912339896096be95b344724a4d9ae88cdf1a8f
2022-01-04 14:41:27 -08:00
Peter Bell
b08d64202a Remove THGeneral (#69041)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69041

`TH_CONCAT_{N}` is still being used by THP so I've moved that into
it's own header but all the compiled code is gone.

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32872477

Pulled By: ngimel

fbshipit-source-id: 06c82d8f96dbcee0715be407c61dfc7d7e8be47a
2021-12-13 16:14:28 -08:00
Peter Bell
e279963eef Remove remaining THC code (#69039)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69039

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32872476

Pulled By: ngimel

fbshipit-source-id: 7972aacc24aef9450fb59b707ed6396c501bcb31
2021-12-08 12:18:08 -08:00
Jan-Hendrik Ewers
81246ed01c Markdown was linking to repo rather than pytorch.org website (#68937)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68937

Reviewed By: samdow

Differential Revision: D32707264

Pulled By: soulitzer

fbshipit-source-id: c534f008087def33784dde701130769e2058aa9f
2021-11-30 11:51:24 -08:00
MalikIdreesHasanKhan
c541c69e89 Fix minor typo in contributing.md (#67855)
Summary:
Fixes #{issue number}
No issue number, minor change

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

Reviewed By: malfet

Differential Revision: D32186689

Pulled By: driazati

fbshipit-source-id: 7cda19f66ff1312296d8310922bb0d221df81e46
2021-11-04 14:38:48 -07:00
Peter Bell
c66847afbe Add workaround for nvcc header dependecies bug (#62550)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62550

I noticed that running the build twice in a row resulted in ~80 CUDA files being
rebuilt. Running `ninja -d explain` shows
```
ninja explain: TH/generic/THStorage.h is dirty
ninja explain: TH/generic/THStorageCopy.h is dirty
ninja explain: THC/generic/THCStorage.h is dirty
ninja explain: THC/generic/THCStorageCopy.h is dirty
ninja explain: TH/generic/THTensor.h is dirty
ninja explain: THC/generic/THCTensor.h is dirty
ninja explain: THC/generic/THCTensorCopy.h is dirty
ninja explain: THC/generic/THCTensorMath.h is dirty
ninja explain: THC/generic/THCTensorMathMagma.h is dirty
ninja explain: THC/generic/THCTensorMathPairwise.h is dirty
ninja explain: THC/generic/THCTensorScatterGather.h is dirty
```

considering `ninja` is working relative to the `build` folder, these files don't
actually exist. I traced this back to the output of `nvcc -MD` containing
paths relative to the include directory, instead of being absolute.

This adds a little script to launch the compiler then resolve any relative paths
in the `.d` file before `ninja` looks at it. To use it, I run the build with
```
export CMAKE_CUDA_COMPILER_LAUNCHER="python;`pwd`/tools/nvcc_fix_deps.py;ccache"
```

There are some possible pit-falls here. The same relative path might work for
two include directories, and the compiler could pick a different one. Or,
the compiler might have additional implicit include directories that are needed
to resolve the path. However, this has worked perfectly in my testing and it's
completely opt-in so should be fine.

Test Plan: Imported from OSS

Reviewed By: ejguan

Differential Revision: D31503351

Pulled By: malfet

fbshipit-source-id: b184c4526679d976b93829b5715cafcb1c7db2ae
2021-10-11 09:07:12 -07:00
Horace He
7e7be526c9 Add TORCH_SHOW_CPP_STACKTRACES to Contributing.md (#64052)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64052

Reviewed By: ezyang

Differential Revision: D31107779

Pulled By: Chillee

fbshipit-source-id: 2ad8ad40cd48e54fe711863c3c74df884a2e2de7
2021-09-22 22:53:19 -07:00
Steven Jin
71ba76b1b5 Fix building docs instructions (#64508)
Summary:
Fixes #{64507}

Removed duplicate instruction and linted the file a bit (consistent spacing around codeblocks/headers, adding code types in codeblocks, remove `$` from bash code blocks when uncecessary).

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

Reviewed By: raghuramank100

Differential Revision: D30791164

Pulled By: mrshenli

fbshipit-source-id: a00db32dcfdd1ecc194c836f31174c806062eb6d
2021-09-07 19:01:52 -07:00
David Riazati
7e88d0b370 Update explicit_ci_jobs to work with GHA (#64598)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64598

This adds a filter option rather than an all-or-nothing so it's easier to iterate on a specific job.

```bash
python tools/testing/explicit_ci_jobs.py --filter-gha '*generated-linux-*gcc5.4*'
```

See #64600 for an example usage

NB: If you regenerate the worfklows you will need to re-run that command to re-delete everything.

Test Plan: Imported from OSS

Reviewed By: janeyx99

Differential Revision: D30788850

Pulled By: driazati

fbshipit-source-id: a32c266bbd876c396665bceef9a0a961b4586564
2021-09-07 15:21:12 -07:00
Ansley Ussery
6831d8e379 Support Union in TorchScript (#64234)
Summary:
This PR is created to replace https://github.com/pytorch/pytorch/pull/53180 PR stack, which has all the review discussions. Reason for needing a replacement is due to a messy Sandcastle issue.

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

Reviewed By: gmagogsfm

Differential Revision: D30656444

Pulled By: ansley

fbshipit-source-id: 77536c8bcc88162e2c72636026ca3c16891d669a
2021-09-03 06:12:24 -07:00
John Clow
b5b9ce146f Small fixes to the Contributing.txt (#63385)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63385

Correcting a mistake for the pytorch uninstall, and
adding an extra note for Darwin.

Test Plan: Imported from OSS

Reviewed By: janeyx99, heitorschueroff

Differential Revision: D30530234

fbshipit-source-id: e0f88a1725eeadabfb4b28c1da11e369ee878ab4
2021-08-25 14:50:37 -07:00
Yi Zhang
73431449b3 update readme and contributing.md (#63843)
Summary:
1. In fact, Visual Studio isn't supported as CMAKE generator
2. I was asked many times why there's error as 'Could NOT find OpenMP'
3. Add Newly added Best Practices link in contributing.md

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

Reviewed By: seemethere, heitorschueroff

Differential Revision: D30514095

Pulled By: janeyx99

fbshipit-source-id: 76715a1d8c049122546e5a7778cafe54e4dfd5d6
2021-08-24 10:52:11 -07:00
Peter Bell
fc47497905 Simplify ccache instructions in CONTRIBUTING.md (#62549)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62549

When building CUDA files with native CMake support, it will respect the
`CMAKE_CUDA_COMPILER_LAUNCHER` setting. So, there's no need for symlinks.

Test Plan: Imported from OSS

Reviewed By: bdhirsh

Differential Revision: D30498488

Pulled By: malfet

fbshipit-source-id: 71c2ae9d4570cfac2a64d777bc95cda3764332a0
2021-08-23 17:47:38 -07:00
Peter Bell
560cd88195 Kill THCUNN (#63429)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63429

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D30441308

Pulled By: ngimel

fbshipit-source-id: 3ae342a2f8d5c7f8827b637c4055c5d1b0a1be26
2021-08-23 12:07:16 -07:00
Nikita Shulga
f2bf0f229f Revert D30359218: [pytorch][PR] [doc] pre-commit fix instructions
Test Plan: revert-hammer

Differential Revision:
D30359218 (4e1d84ae8f)

Original commit changeset: 61771babeac4

fbshipit-source-id: c2ac0a4a7463fafa03ad0b20bfb0701a8c1476c4
2021-08-19 16:48:04 -07:00
Stas Bekman
4e1d84ae8f [doc] pre-commit fix instructions (#61717)
Summary:
fix invalid instruction

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

Reviewed By: zhouzhuojie, driazati

Differential Revision: D30359218

Pulled By: malfet

fbshipit-source-id: 61771babeac4d34425a61ce49f38a7099b521eec
2021-08-18 11:42:25 -07:00
Peter Bell
f70b9ee5de Advertise USE_PRECOMPILED_HEADERS in CONTRIBUTING.md (#62827)
Summary:
This option was added in https://github.com/pytorch/pytorch/issues/61940 and fits with this section's theme of improving build times.

I've also changed it to a `cmake_dependent_option` instead of `FATAL_ERROR`ing for older CMake versions.

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

Reviewed By: astaff

Differential Revision: D30342102

Pulled By: malfet

fbshipit-source-id: 3095b44b7085aee8a884ec95cba9f8998d4442e7
2021-08-17 10:14:40 -07:00
Richard Zou
da36bbcd35 Add section to CONTRIBUTING.md explaining developer docs (#63228)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63228

It is a quick summary and links to a page on the Developer Wiki that has
more detail.

Test Plan: Imported from OSS

Reviewed By: SplitInfinity

Differential Revision: D30347109

Pulled By: zou3519

fbshipit-source-id: a6242986d275e5279ca3f61ade2294a132d268c4
2021-08-16 15:44:10 -07:00
Natalia Gimelshein
720a7a0d81 [hackathon] fix benchmarking script in CONTRIBUTING (#63199)
Summary:
[skip ci]
Per title

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

Reviewed By: mruberry

Differential Revision: D30305487

Pulled By: ngimel

fbshipit-source-id: 2704c4f08ab976a55c9f8c2fe54cd4f3f39412cf
2021-08-13 09:50:48 -07:00
Gao, Xiang
a4af91b2fe Cleanup CUDA 10.1 and 10.0 support on CI (#62597)
Summary:
10.1 is removed in https://github.com/pytorch/pytorch/pull/56056

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

Reviewed By: walterddr

Differential Revision: D30053902

Pulled By: seemethere

fbshipit-source-id: deb148e5e44c12b08c267a36fbd4a1afa138e6e4
2021-08-02 14:42:25 -07:00
Elton Leander Pinto
2a83f24027 Enable macos clang-tidy installs (#62214)
Summary:
This PR enables installing our custom MacOS clang-tidy binaries. It also updates related documentation.

The binaries are produced by [this CI job](https://github.com/pytorch/test-infra/blob/master/.github/workflows/clang-tidy-macos.yml), and are published to S3.

This PR does not handle versioning of the downloaded binaries as this is being worked on separately. See https://github.com/pytorch/test-infra/issues/73

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

Test Plan:
On a MacOS machine, run
```bash
python3 -m tools.linter.install.clang_tidy
.clang-tidy-bin/clang-tidy --checks="*" --list-checks | grep "misc-max-tokens"
```

Reviewed By: janeyx99, mruberry

Differential Revision: D29917728

Pulled By: 1ntEgr8

fbshipit-source-id: 98d0d8b7a57bdebf0ebcdc83228ef391e8c6629e
2021-07-26 13:43:29 -07:00
Masaki Kozuki
7136a62b56 Add expecttest to CONTRIBUTING.md (#61163)
Summary:
Now expecttest is an independent library but `CONTRIBUTING.md` and `requirements.txt` do not mention the need of the library.

Related: https://github.com/pytorch/pytorch/pull/60658

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

Reviewed By: heitorschueroff

Differential Revision: D29660296

Pulled By: ezyang

fbshipit-source-id: e2e86d42526c83bec7cdf7221e19fe83d9686103
2021-07-12 09:11:12 -07:00
Antonio Cuni
93d98ecef7 update the pytorch-gdb example so that it works on current master (#61175)
Summary:
As pointed out by https://github.com/pytorch/pytorch/pull/54339#issuecomment-872827580, the `pytorch-gdb` example is currently broken because the code has been refactored.

This PR updates the example so that it works again.

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

Reviewed By: heitorschueroff

Differential Revision: D29660336

Pulled By: ezyang

fbshipit-source-id: 8bcd32fc583c0b28a705ef37203ce7ad4d636732
2021-07-12 08:57:18 -07:00
zhouzhuojie
6107cf3750 Add --jobs 0 for git submodule update (#61311)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61311

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

Some related docs about `submodule.fetchJobs`
https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulefetchJobs

```
time git submodule update --init --recursive
________________________________________________________
Executed in  243.20 secs    fish           external
   usr time   49.64 secs  213.00 micros   49.64 secs
   sys time   29.27 secs  795.00 micros   29.27 secs
```

```
time git submodule update --init --recursive --jobs 4
________________________________________________________
Executed in  143.04 secs    fish           external
   usr time   51.06 secs  246.00 micros   51.06 secs
   sys time   30.96 secs  742.00 micros   30.96 secs
```

```
time git submodule update --init --recursive --jobs 8
________________________________________________________
Executed in  124.64 secs    fish           external
   usr time   51.76 secs  264.00 micros   51.76 secs
   sys time   30.49 secs  739.00 micros   30.49 secs

```

```
time git submodule update --init --recursive --jobs 0 # use all online cpus
 ________________________________________________________
Executed in  129.75 secs    fish           external
   usr time   51.64 secs  181.00 micros   51.64 secs
   sys time   31.49 secs  781.00 micros   31.49 secs

```

Test Plan: Imported from OSS

Reviewed By: 1ntEgr8

Differential Revision: D29560875

Pulled By: zhouzhuojie

fbshipit-source-id: 556027dffe744c66428075a8a1bf64683930aaaf
2021-07-07 16:28:18 -07:00
Elton Leander Pinto
a1ad28da10 Refactor clang_tidy.py (#61119)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61119

This change spilts the clang-tidy CI job into smaller steps and uses a
refactored version of the clang_tidy.py script.

The new folder structure is as follows:
```
tools/linter/clang_tidy
|_ __main__py
|_ requirements.txt
|_ run.py
|_ setup.sh
```

`__main__.py`

This script will run `tools/linter/clang_tidy/setup.sh` if a `build`
directory doesn't exist, mimicing what used to be done as a separate
step in the CI job.

After that, it will invoke `clang-tidy` with default arguments being
declared in the script itself (as opposed to declaring them in
lint.yml).

The reasoning behind this approach is two-fold:

- Make it easier to run `clang-tidy` locally using this script
- De-duplicate the option passing

`requirements.txt`

Contains a list of additional python dependencies needed by the
`clang-tidy` script.

`setup.sh`

If a build directory doesn't exist, this command will run the necessary
codegen and build commands for running `clang-tidy`

Example usage:
```
python3 tools/linter/clang_tidy --parallel
```
Notice that we don't have to put the `.py` at the end of `clang_tidy`.

Test Plan:
Run the following command:
```
python3 tools/linter/clang_tidy --paths torch/csrc/fx --parallel
```

Reviewed By: walterddr, janeyx99

Differential Revision: D29568582

Pulled By: 1ntEgr8

fbshipit-source-id: cd6d11c5cb8ba9f1344a87c35647a1cd8dd45b04
2021-07-06 16:02:11 -07:00
driazati
a0a9ea6598 Fix documentation preview instructions (#61080)
Summary:
People don't need to self host these anymore since we do it automatically in PRs

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

Reviewed By: VitalyFedyunin, janeyx99

Differential Revision: D29506465

Pulled By: driazati

fbshipit-source-id: 45875cb229f8cc565a9a1405f52cef198ee0e687
2021-07-01 12:17:34 -07:00
Rong Rong (AI Infra)
7e619b9588 First step to rearrange files in tools folder (#60473)
Summary:
Changes including:
- introduced `linter/`, `testing/`, `stats/` folders in `tools/`
- move appropriate scripts into these folders
- change grepped references in the pytorch/pytorch repo

Next step
- introduce `build/` folder for build scripts

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

Test Plan:
- CI (this is important b/c pytorch/test-infra also rely on some script reference.
- tools/tests/

Reviewed By: albanD

Differential Revision: D29352716

Pulled By: walterddr

fbshipit-source-id: bad40b5ce130b35dfd9e59b8af34f9025f3285fd
2021-06-24 10:13:58 -07:00
H1Gdev
d7d0fa2069 Fix typo. (#58728)
Summary:
Fix typo in docs and comments.

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

Reviewed By: mruberry

Differential Revision: D28603612

Pulled By: H-Huang

fbshipit-source-id: b3cd8f6f19354201d597254d0b3cb4e2062471ab
2021-05-21 11:45:10 -07:00
Ansley Ussery
e8981e7c5d Improve CONTRIBUTING.md (#58396)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58396

Test Plan: Imported from OSS

Reviewed By: samestep

Differential Revision: D28476510

Pulled By: ansley

fbshipit-source-id: 3f45bee93dfeda06a44570305f9699bcafc45d2e
2021-05-17 12:36:38 -07:00
driazati
e385aa863a Add tools/ script to limit circleci to a set of jobs (#58001)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58001

Adds a script so that devs can generate a commit (at the base of a stack) that removes all CI jobs but the set that they care about. See CONTRIBUTING.md changes for usage

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D28359910

Pulled By: driazati

fbshipit-source-id: 2741570f2bab2c28f4a9d7aef727b1b2399d0ce1
2021-05-11 11:58:35 -07:00
Yi Zhang
cb1272a846 update doc in build section (#56686)
Summary:
Why:
To keep VS version always updated in README
1. update VS version link in CI. It's more convenient for my PR robot to update the version in README once the VS in CI is updated. and permlink isn't stable.
2. Move `building on legacy code` to development tips. The table is big and it looks the REAMD not updated at the first sight.

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

Reviewed By: janeyx99

Differential Revision: D28272060

Pulled By: samestep

fbshipit-source-id: 4bb879ea2914cc8bcd68343a9ed230418e1f9268
2021-05-06 17:35:56 -07:00
davidriazati@fb.com
5e4dfd0140 Add quicklint make target (#56559)
Summary:
This queries the local git repo for changed files (any changed files, not just committed ones) and sends them to mypy/flake8 instead of the default (which is the whole repo, defined the .flake8 and mypy.ini files). This brings a good speedup (from 15 seconds with no cache to < 1 second from my local testing on this PR).

```bash
make quicklint -j 6
```

It should be noted that the results of this aren’t exactly what’s in the CI, since mypy and flake8 ignore the `include` and `exclude` parts of their config when an explicit list of files is passed in.
](https://our.intern.facebook.com/intern/diff/27901577/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56559

Pulled By: driazati

Reviewed By: malfet

Differential Revision: D27901577

fbshipit-source-id: 99f351cdfe5aba007948aea2b8a78f683c5d8583
2021-04-21 13:47:25 -07:00
driazati
43eb21bff3 [skip ci] Add simple local actions runner (#56439)
Summary:
This pulls out shell scripts from an action and runs them locally as a first pass at https://github.com/pytorch/pytorch/issues/55847. A helper script extracts specific steps in some order and runs them:

```bash
$ time -p make lint -j 5  # run lint with 5 CPUs
python scripts/actions_local_runner.py \
        --file .github/workflows/lint.yml \
        --job 'flake8-py3' \
        --step 'Run flake8'
python scripts/actions_local_runner.py \
        --file .github/workflows/lint.yml \
        --job 'mypy' \
        --step 'Run mypy'
python scripts/actions_local_runner.py \
        --file .github/workflows/lint.yml \
        --job 'quick-checks' \
        --step 'Ensure no trailing spaces' \
        --step 'Ensure no tabs' \
        --step 'Ensure no non-breaking spaces' \
        --step 'Ensure canonical include' \
        --step 'Ensure no unqualified noqa' \
        --step 'Ensure no direct cub include' \
        --step 'Ensure correct trailing newlines'
python scripts/actions_local_runner.py \
        --file .github/workflows/lint.yml \
        --job 'cmakelint' \
        --step 'Run cmakelint'
quick-checks: Ensure no direct cub include
quick-checks: Ensure canonical include
quick-checks: Ensure no unqualified noqa
quick-checks: Ensure no non-breaking spaces
quick-checks: Ensure no tabs
quick-checks: Ensure correct trailing newlines
cmakelint: Run cmakelint
quick-checks: Ensure no trailing spaces
mypy: Run mypy
Success: no issues found in 1316 source files
Success: no issues found in 56 source files
flake8-py3: Run flake8
./test.py:1:1: F401 'torch' imported but unused
real 13.89
user 199.63
sys 6.08
```

Mypy/flake8 are by far the slowest, but that's mostly just because they're wasting a bunch of work linting the entire repo.

In followup, we could/should:
* Improve ergonomics (i.e. no output unless there are errors)
* Speed up lint by only linting files changes between origin and HEAD
* Add clang-tidy

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

Reviewed By: samestep

Differential Revision: D27888027

Pulled By: driazati

fbshipit-source-id: d6f2a59a45e9d725566688bdac8e909210175996
2021-04-20 12:17:55 -07:00
Can Balioglu
2587a28bbd Improve the instructions on how to build the docs (#56018)
Summary:
This PR includes:

- A formatting change to make katex installation instructions more visible for Facebook employees.
- A short tip about how to start a lightweight HTTP server on a remote machine to browse the doc build artifacts.

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

Reviewed By: H-Huang

Differential Revision: D27765157

Pulled By: cbalioglu

fbshipit-source-id: 67663de0ba7b742e0deb5358d1e45eea9edd840f
2021-04-14 08:47:43 -07:00
Yukio Siraichi
93bf0ae6fc Remove legacy constructor calls from pytorch codebase. (#54142)
Summary:
Follow up from https://github.com/pytorch/pytorch/issues/53889
Related to https://github.com/pytorch/pytorch/issues/47112

Removing every occurrence of the legacy constructor call present in PyTorch at:
- _docs_
- _benchmarks_
- _test_
- _caffe2_
- _CONTRIBUTING.md_

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

Reviewed By: ngimel

Differential Revision: D27699450

Pulled By: mruberry

fbshipit-source-id: 530aa3f5746cc8bc1407d5d51b2bbd8075e30546
2021-04-11 15:45:17 -07:00
Your Name
fc45ff8177 [skip ci] Document '[skip ci]' (#55418)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55418

Test Plan: Imported from OSS

Reviewed By: janeyx99

Differential Revision: D27609269

Pulled By: driazati

fbshipit-source-id: 6ce562950ee35e029f0bfa3d0fffbbcc28265a7a
2021-04-08 15:36:29 -07:00
Ansley Ussery
0eba63ec93 Improve testing documentation in CONTRIBUTING.md (#54904)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54904

Test Plan: Imported from OSS

Reviewed By: samestep

Differential Revision: D27407009

Pulled By: ansley

fbshipit-source-id: ae69d8387b55f714fd105efe7c4ecbdd69674f65
2021-04-01 10:18:34 -07:00
Sam Estep
a74b10def9 Keep Markdown ToCs up to date (#54974)
Summary:
This PR uses [markdown-toc](https://github.com/jonschlinkert/markdown-toc#cli) to [automatically update the table of contents for `README.md` and `CONTRIBUTING.md`](https://github.com/pytorch/pytorch/pull/54904#issuecomment-809682134) in CI.

This keeps the same format already used in `README.md`. While it does slightly change the format for the ToC in `CONTRIBUTING.md`, the new format is actually just the same as the old format that was already being used prior to https://github.com/pytorch/pytorch/issues/51458.

Race condition with https://github.com/pytorch/pytorch/issues/54904.

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

Test Plan: The new "Lint / toc" job in GitHub Actions [succeeds](https://github.com/pytorch/pytorch/pull/54974/checks?check_run_id=2238739005) on this PR, and [fails](https://github.com/pytorch/pytorch/pull/54976/checks?check_run_id=2238784022) on https://github.com/pytorch/pytorch/issues/54976 with an understandable error message.

Reviewed By: malfet

Differential Revision: D27468390

Pulled By: samestep

fbshipit-source-id: 14a73f42ed546d4310140b94ded14e099185d0e0
2021-03-31 10:36:09 -07:00
Sam Estep
eafa235582 Clarify and document commit choice for CI jobs (#54967)
Summary:
PRs https://github.com/pytorch/pytorch/issues/53652 and https://github.com/pytorch/pytorch/issues/54693 attempted to increase the consistency of our choice of commit (head vs merge) for CI on PRs, and have so far been unsuccessful. This PR takes a less ambitious approach to the problem by clarifying the choice in one specific way (see the following paragraph) and documenting it in `CONTRIBUTING.md`.

In addition to documentation, this PR also removes the current behavior of our GHA jobs that checkout the PR tip instead of the merge commit. At first glance, this behavior seems to increase consistency (by eliminating the special-case for `ghstack` PRs), but in reality, it actually just means that for non-`ghstack` PRs, the question "Which commit is used in CI?" has *two* answers instead of just one; see the description of https://github.com/pytorch/pytorch/issues/53652 for more details.

Once merged, this PR will unblock other PRs that add modify our GHA workflows in breaking ways, such as https://github.com/pytorch/pytorch/issues/54737.

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

Test Plan: None.

Reviewed By: walterddr, seemethere

Differential Revision: D27435913

Pulled By: samestep

fbshipit-source-id: 405fb419cf015cf88107d5eb2498cfb5bcb7ce33
2021-03-30 11:47:40 -07:00
Antonio Cuni
21a9a93eb4 gdb special command to print tensors (#54339)
Summary:
This is something which I wrote because it was useful during my debugging sessions, but I think it might be generally useful to other people as well so I took the liberty of proposing an official `pytorch-gdb` extension.

`pytorch-gdb` is a gdb script written in python. Currently, it contains only one command: `torch-tensor-repr`, which prints a human-readable repr of an `at::Tensor` object. Example:
```
Breakpoint 1, at::native::neg (self=...) at [...]/pytorch/aten/src/ATen/native/UnaryOps.cpp:520
520     Tensor neg(const Tensor& self) { return unary_op_impl(self, at::neg_out); }
(gdb) # the default repr of 'self' is not very useful
(gdb) p self
$1 = (const at::Tensor &) 0x7ffff72ed780: {impl_ = {target_ = 0x5555559df6e0}}
(gdb) torch-tensor-repr self
Python-level repr of self:
tensor([1., 2., 3., 4.], dtype=torch.float64)
```

The idea is that by having an official place where to put these things, `pytorch-gdb` will slowly grow other useful features and make the pytorch debugging experience nicer and faster.

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

Reviewed By: bdhirsh

Differential Revision: D27253674

Pulled By: ezyang

fbshipit-source-id: dba219e126cc2fe66b2d26740f3a8e3b886e56f5
2021-03-23 12:30:18 -07:00
Sam Estep
8c798e0622 Forbid trailing whitespace (#53406)
Summary:
Context: https://github.com/pytorch/pytorch/pull/53299#discussion_r587882857

These are the only hand-written parts of this diff:
- the addition to `.github/workflows/lint.yml`
- the file endings changed in these four files (to appease FB-internal land-blocking lints):
  - `GLOSSARY.md`
  - `aten/src/ATen/core/op_registration/README.md`
  - `scripts/README.md`
  - `torch/csrc/jit/codegen/fuser/README.md`

The rest was generated by running this command (on macOS):
```
git grep -I -l ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' | xargs gsed -i 's/ *$//'
```

I looked over the auto-generated changes and didn't see anything that looked problematic.

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

Test Plan:
This run (after adding the lint but before removing existing trailing spaces) failed:
- https://github.com/pytorch/pytorch/runs/2043032377

This run (on the tip of this PR) succeeded:
- https://github.com/pytorch/pytorch/runs/2043296348

Reviewed By: walterddr, seemethere

Differential Revision: D26856620

Pulled By: samestep

fbshipit-source-id: 3f0de7f7c2e4b0f1c089eac9b5085a58dd7e0d97
2021-03-05 17:22:55 -08:00
Rong Rong (AI Infra)
718e4b110b add git submodule troubleshoot to CONTRIBUTING.md (#51458)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/51355.

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

Reviewed By: janeyx99

Differential Revision: D26176233

Pulled By: walterddr

fbshipit-source-id: 758e4203e11c81489234bbca812d1a3738504148
2021-02-01 14:30:00 -08:00
Jane Xu
4954417163 CONTRIBUTING.md: add instructions on how to remote desktop into Windows CI (#50841)
Summary:
Adds a link to existing instructions in CONTRIBUTING.md, so those instructions are more visible to contributors.

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

Reviewed By: samestep

Differential Revision: D25983089

Pulled By: janeyx99

fbshipit-source-id: 0b777ec760765153c607515ab09441dd0cfddf3c
2021-01-20 18:46:56 -08:00
Sam Estep
1ea39094a8 Link to mypy wiki page from CONTRIBUTING.md (#50540)
Summary:
Addresses one of the documentation points in https://github.com/pytorch/pytorch/issues/50513 by making it easier to find our `mypy` wiki page. Also updates the `CONTRIBUTING.md` table of contents and removes some trailing whitespace.

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

Reviewed By: janeyx99

Differential Revision: D25912366

Pulled By: samestep

fbshipit-source-id: b305f974700a9d9ebedc0c2cb75c92e72d84882a
2021-01-14 10:05:48 -08:00
Stas Bekman
5171bd94d7 [lint doc] how to fix flake errors if pre-commit hook wasn't there (#49345)
Summary:
This PR adds instructions on what to do if one committed into a PR branch w/o having a pre-commit hook enabled and having CI report flake8 errors.

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

Reviewed By: cpuhrsch

Differential Revision: D25683167

Pulled By: soumith

fbshipit-source-id: 3c45c866e1636c116d2cacec438d62c860e6b854
2020-12-23 09:17:40 -08:00
Jane Xu
71ca600af9 Renaming CAFFE2_API to TORCH_API (#49496)
Summary:
Since caffe2 and torch have been consolidated, CAFFE2_API should be merged with TORCH_API. Addresses a TODO.

Manually edited some references of the removed `CAFFE2_API`:
* `CONTRIBUTING.md`
* `caffe2/proto/CMakeLists.txt`
* `cmake/ProtoBuf.cmake`
* `c10/macros/Export.h`
* `torch/csrc/WindowsTorchApiMacro.h`

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

Reviewed By: malfet, samestep

Differential Revision: D25600726

Pulled By: janeyx99

fbshipit-source-id: 7e068d959e397ac183c097d7e9a9afeca5ddd782
2020-12-18 10:54:50 -08:00
Jane (Yuan) Xu
86cf1e1358 Add another way to verify ccache in CONTRIBUTING.md (#49337)
Summary:
In the case people are confused how to make sure ccache is working, I added another sentence in the documentation for how to check that the symlinks are correctly set up in addition to waiting for 2 clean builds of PyTorch.

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

Reviewed By: walterddr

Differential Revision: D25535659

Pulled By: janeyx99

fbshipit-source-id: 435696255f517c074dd0d9f96534d22b60f795b2
2020-12-14 13:19:40 -08:00
Sam Estep
d1fb4b4ffc Put Flake8 requirements into their own file (#49032)
Summary:
This PR moves the list of Flake8 requirements/versions out of `.github/workflows/lint.yml` and into its own file `requirements-flake8.txt`. After (if) this PR is merged, I'll modify the Flake8 installation instructions on [the "Lint as you type" wiki page](https://github.com/pytorch/pytorch/wiki/Lint-as-you-type) (and its internal counterpart) to just say to install from that new file, rather than linking to the GitHub Actions YAML file and/or giving a command with a set of packages to install that keeps becoming out-of-date.

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

Test Plan:
Either look at CI, or run locally using [act](https://github.com/nektos/act):
```sh
act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 -j flake8-py3
```

Reviewed By: janeyx99

Differential Revision: D25404037

Pulled By: samestep

fbshipit-source-id: ba4d1e17172a7808435df06cba8298b2b91bb27c
2020-12-08 13:29:10 -08:00
Sam Estep
ccc53901bd Update CONTRIBUTING and gitignore for docs build (#47539)
Summary:
This PR tries to make building the docs less confusing for new contributors:

- `npm` is discouraged on devservers for Facebook employees, so I added another way to install `katex`
- the path to `check-doxygen.sh` was wrong, so I fixed it
- while generating the CPP docs, it created two new folders that weren't ignored by Git, so I added those to `.gitignore`
- I wasn't able to get the SSH tunnel to work, so I added instructions to use `scp` as an alternative

I'm not entirely sure how the `docs/cpp/source/{html,latex}/` directories were created since I haven't been able to reproduce them.

I also think that it would be better to use the SSH tunnel since `scp` is so much slower, but I just wasn't able to figure it out; I followed the instructions from `CONTRIBUTING.md` and then ran a [Python `http.server`](https://docs.python.org/3/library/http.server.html) on my devserver:
```bash
python -m http.server 8000 --bind 127.0.0.1 --directory build/html
```
but my browser failed to connect and my (local) terminal printed error messages (presumably from the SSH command).

If anyone knows how to properly set up the SSH tunnel and HTTP server, I add those more detailed instructions to `CONTRIBUTING.md` and remove the `scp` instructions from this PR.

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

Reviewed By: malfet

Differential Revision: D24806833

Pulled By: samestep

fbshipit-source-id: 456691018a76efadde28fa5eb783b0895582e72d
2020-11-10 11:04:34 -08:00
Jane Xu
3510f19c5f added some more details + debugging steps to CONTRIBUTING.md (#45903)
Summary:
When attempting to install PyTorch locally on my Macbook, I had some difficulty running the setup steps and understanding what I was really doing. I've added some clarifications and summarized some debugging steps about `python setup.py develop` to lower the barrier of entrance for new contributors.

I'm seeking a lot of review here since I am not sure if what I wrote is entirely the most useful or accurate. Thank you!

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

Reviewed By: albanD

Differential Revision: D24140343

Pulled By: janeyx99

fbshipit-source-id: a5e40d1bc804945ae7db2b95ab18cf7fe169e68a
2020-10-06 10:40:17 -07:00
Michael Suo
18253f4a48 Fix BUILD_CAFFE2 if FBGEMM and NNPACK are not built (#45610)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45610

Also add to the usual documentation places that this option exists.

Test Plan: Imported from OSS

Reviewed By: gmagogsfm

Differential Revision: D24058199

Pulled By: suo

fbshipit-source-id: 81574fbd042f47587e2c7820c726fac0f68af2a7
2020-10-01 14:58:55 -07:00
Antonio Cuni
ced8727d88 Fix a broken link in CONTRIBUTING.md (#44701)
Summary:
as the title says :)

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

Reviewed By: ngimel

Differential Revision: D23724919

Pulled By: mrshenli

fbshipit-source-id: 5ca5ea974ee6a94ed132dbe7892a9b4b9c3dd9be
2020-09-16 11:30:05 -07:00
Oscar Sandoval
a044c039c0 updated documentation to streamline setup (#42850)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/42850

Reviewed By: mrshenli

Differential Revision: D23449055

Pulled By: osandoval-fb

fbshipit-source-id: 6db695d4fe5f6d9b7bb2895c85c855db4779516b
2020-09-01 08:25:48 -07:00
Ralf Gommers
ebc0fc4dfc Polish the nightly.py docs in CONTRIBUTING a little (#43494)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/43494

Reviewed By: mruberry

Differential Revision: D23296032

Pulled By: ngimel

fbshipit-source-id: c85a6d4c39cbb60644f79136a6f21fd49c813b61
2020-08-25 12:13:27 -07:00
Anthony Scopatz
35351ff409 Fix ToC Link (#43427)
Summary:
CC ezyang - no code here

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

Reviewed By: albanD

Differential Revision: D23273866

Pulled By: mrshenli

fbshipit-source-id: ca07d286410f367cc78549828e517510a86d63ec
2020-08-22 19:51:24 -07:00
Anthony Scopatz
a2ae2d3203 Nightly Pull (#43294)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/40829

This addresses remaining issues/improvements in https://github.com/pytorch/pytorch/issues/40829 that were brought up prior to https://github.com/pytorch/pytorch/issues/42635 being merged.  Namely, this changes the name of the script and adds separate `checkout` and `pull` subcommands. I have tested it locally and everything appears to work.  Please let me know if you encounter any issues. I hope that this supports a more natural workflow.

CC ezyang rgommers

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

Reviewed By: pbelevich

Differential Revision: D23241849

Pulled By: ezyang

fbshipit-source-id: c24556024d7e5d14b9a5006e927819d4ad370dd7
2020-08-20 08:34:18 -07:00
Anthony Scopatz
21823aa680 Nightly checkout tool (#42635)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/40829

This is cross-platform but I have only tried it on linux, personally. Also, I am not fully certain of the usage pattern, so if there are any additional features / adjustments / tests that you want me to add, please just let me know!

CC ezyang rgommers

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

Reviewed By: zhangguanheng66

Differential Revision: D23078663

Pulled By: ezyang

fbshipit-source-id: 5c8c8abebd1d462409c22dc4301afcd8080922bb
2020-08-13 20:07:18 -07:00
Ralf Gommers
03186a86d9 Add test dependencies to CONTRIBUTING.md (#41799)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/41799

Reviewed By: zhangguanheng66

Differential Revision: D22645323

Pulled By: zou3519

fbshipit-source-id: 0a695bffb57b29024461472dd1c8518a9a0d1d3b
2020-07-21 11:29:38 -07:00
Cloud Han
2da2b5c081 update CONTRIBUTING.md for ccache (#41619)
Summary:
ccache now use cmake for building, update installation script.

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

Reviewed By: zhangguanheng66

Differential Revision: D22644594

Pulled By: malfet

fbshipit-source-id: f894dd408822231f8aab36efbce188f06f004057
2020-07-21 09:43:30 -07:00
Alphons Jaimon
ce443def01 Grammar patch 1 (.md) (#41599)
Summary:
A minor spell check!
I have gone through a dozen of .md files to fix the typos.
zou3519 take a look!

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

Reviewed By: ezyang

Differential Revision: D22601629

Pulled By: zou3519

fbshipit-source-id: 68d8f77ad18edc1e77874f778b7dadee04b393ef
2020-07-20 10:19:08 -07:00
Donny Greenberg
bacca663ff Fix Broken Link in CONTRIBUTING.md (#41066)
Summary:
Spotted a broken link, and while I was at it, fixed a few little language and formatting nits.

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

Reviewed By: mruberry

Differential Revision: D22415371

Pulled By: dongreenberg

fbshipit-source-id: 7d11c13235b28a01886063c11a4c5ccb333c0c02
2020-07-07 20:02:47 -07:00
Kurt Mohler
5ee2302349 Add links to more subdir READMEs in CONTRIBUTING.md (#38049)
Summary:
I think it would be nice to have these extra README links here so they're easier to find. There are even more READMEs throughout the source tree that I didn't include, but most of them seem to have pretty minimal information.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38049

Differential Revision: D21470749

Pulled By: ezyang

fbshipit-source-id: aa164a3776ab90f2453634082eeae20c0dd002ce
2020-05-07 19:37:33 -07:00
Shawn Zhong
cae77fa351 [doc] Fix broken links in the TOC of CONTRIBUTING.md (#37131)
Summary:
Some links in the TOC of CONTRIBUTING.md is broken since GitHub removes the invalid characters (e.g., `+` in C++) in the anchor link, while the existing TOC uses `-` for replacement.

This PR uses `-` instead of `*` and `+` for the bullet lists to make it consistent with README.md.
b889e0da8a/README.md (L11-L18)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37131

Differential Revision: D21231299

Pulled By: zou3519

fbshipit-source-id: 8e7bb61550827ce97378d3428542e43612bac8e1
2020-04-24 10:56:10 -07:00
Kurt Mohler
0912284830 CI failure tips (#36507)
Summary:
Finding out how to ssh into a CircleCI job to debug a failure is a challenge because, as far as I know, there isn't any concise documentation about it. I figured it might be nice to include this in CONTRIBUTING.md.

Maybe there are some other tips about non-CircleCI jobs that could be added in the future as well.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36507

Differential Revision: D21006526

Pulled By: ezyang

fbshipit-source-id: 0a544ecf37bf9550e9b2f07595332dc5f394bb9e
2020-04-13 17:39:47 -07:00
Richard J. Knight
21ecb8d870 Fix reference to NO_CUDA and NO_DISTRIBUTED (#34831)
Summary:
- replace the old build variables NO_CUDA and NO_DISTRIBUTED in CONTRIBUTING.md with the new USE_CUDA and USE_DISTRIBUTED versions.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34831

Differential Revision: D20512659

Pulled By: colesbury

fbshipit-source-id: 2d6cb6fd35886eec0b4b1c94f568b5137407c551
2020-03-23 10:42:01 -07:00
Hong Xu
49921cad28 Minimum build should also exclude XNNPACK (#34110)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34110

Differential Revision: D20228129

Pulled By: ezyang

fbshipit-source-id: 24e1482f6a6ff423de966bb7a7a45ad3815791e9
2020-03-03 12:51:37 -08:00
xiaobing.zhang
b678256bfb Move glu to Aten(CPU) (#33179)
Summary:
This PR move glu to Aten(CPU).
Test script:
```
import torch
import torch.nn.functional as F
import time

torch.manual_seed(0)

def _time():
    if torch.cuda.is_available():
        torch.cuda.synchronize()
    return time.time()

device = "cpu"

#warm up
for n in [10, 100, 1000, 10000]:
    input = torch.randn(128, n, requires_grad=True, device=device)
    grad_output = torch.ones(128, n // 2, device=device)
    for i in range(1000):
        output = F.glu(input)
        output.backward(grad_output)

for n in [10, 100, 1000, 10000]:
    fwd_t = 0
    bwd_t = 0
    input = torch.randn(128, n, requires_grad=True, device=device)
    grad_output = torch.ones(128, n // 2, device=device)
    for i in range(10000):
        t1 = _time()
        output = F.glu(input)
        t2 = _time()
        output.backward(grad_output)
        t3 = _time()
        fwd_t = fwd_t + (t2 -t1)
        bwd_t = bwd_t + (t3 - t2)
    fwd_avg = fwd_t / 10000 * 1000
    bwd_avg = bwd_t / 10000 * 1000
    print("input size(128, %d) forward time is %.2f (ms); backwad avg time is %.2f (ms)."
          % (n, fwd_avg, bwd_avg))
```
Test device: **skx-8180.**
Before:
```
input size(128, 10) forward time is 0.04 (ms); backwad avg time is 0.08 (ms).
input size(128, 100) forward time is 0.06 (ms); backwad avg time is 0.14 (ms).
input size(128, 1000) forward time is 0.11 (ms); backwad avg time is 0.31 (ms).
input size(128, 10000) forward time is 1.52 (ms); backwad avg time is 2.04 (ms).
```
After:
```
input size(128, 10) forward time is 0.02 (ms); backwad avg time is 0.05 (ms).
input size(128, 100) forward time is 0.04 (ms); backwad avg time is 0.09 (ms).
input size(128, 1000) forward time is 0.07 (ms); backwad avg time is 0.17 (ms).
input size(128, 10000) forward time is 0.13 (ms); backwad avg time is 1.03 (ms).
```
Fix https://github.com/pytorch/pytorch/issues/24707, https://github.com/pytorch/pytorch/issues/24708.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33179

Differential Revision: D19839835

Pulled By: VitalyFedyunin

fbshipit-source-id: e4d3438556a1068da2c4a7e573d6bbf8d2a6e2b9
2020-02-28 14:54:38 -08:00
Nathan Goldbaum
139afd0ea7 Fix link to py-spy content in contribution guide TOC (#31760)
Summary:
The extra dashes are breaking the link here
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31760

Differential Revision: D19697301

Pulled By: ezyang

fbshipit-source-id: 65de026b9016dc8689c9dac9efb8aafd00b535cd
2020-02-11 20:27:35 -08:00
Yang Yang
48eff08256 Fix the level of headers in pytorch/CONTRIBUTING.md (#28412)
Summary:
**Running Clang-Tidy**, **Pre-commit Tidy/Linting Hook**, **Building PyTorch with ASAN** shouldn't belong to **Windows development tips**.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28412

Differential Revision: D19700228

Pulled By: ezyang

fbshipit-source-id: 39d999c68e4bd9264f4ae1fdab517871c883a663
2020-02-03 11:50:25 -08:00
davidriazati
09a22f3301 Remove C++ docs contributing page (#31908)
Summary:
Stacked PRs
 * **#31908 - Remove C++ docs contributing page**
 * #31905 - Add doc previewing instructions

We should have 1 source of truth for contribution instructions (CONTRIBUTING.md).
This PR moves the instructions from the C++ doc pages there instead of having its
own separate page.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31908

Pulled By: driazati

Differential Revision: D19296366

fbshipit-source-id: c1daf004259342bd09e09dea3b80e34db47066ec
2020-01-08 15:37:35 -08:00
davidriazati
8c59d48281 Add doc previewing instructions (#31905)
Summary:
Stacked PRs
 * #31908 - Remove C++ docs contributing page
 * **#31905 - Add doc previewing instructions**

This adds some instructions on how to get started with Github pages you can show reviewers your documentation changes. Hopefully we can delete this eventually and build docs automatically on relevant PRs in CI.
](https://our.intern.facebook.com/intern/diff/19296364/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31905

Pulled By: driazati

Differential Revision: D19296364

fbshipit-source-id: df47fa1a8d7be029c3efcf6521298583ad9f7a95
2020-01-08 15:37:31 -08:00
Sebastian Messmer
5554e5b793 Docs: c++11 -> c++14 (#30530)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30530

Switch some mentions of "C++11" in the docs to "C++14"
ghstack-source-id: 95812049

Test Plan: testinprod

Differential Revision: D18733733

fbshipit-source-id: b9d0490eb3f72bad974d134bbe9eb563f6bc8775
2019-12-17 14:09:02 -08:00
Sebastian Messmer
bc2e6d10fa Back out "Revert D17908478: Switch PyTorch/Caffe2 to C++14"
Summary: Original commit changeset: 775d2e29be0b

Test Plan: CI

Reviewed By: mruberry

Differential Revision: D18775520

fbshipit-source-id: a350b3f86b66d97241f208786ee67e9a51172eac
2019-12-03 14:33:43 -08:00
davidriazati
19b7d49fac Add TOC to CONTRIBUTING.md (#29671)
Summary:
This TOC is manually generated but `CONTRIBUTING.md` seems like its
stable enough for that to be okay
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29671

Pulled By: driazati

Differential Revision: D18771604

fbshipit-source-id: 0d6c9c6cf1083d3be413219d3cead79c2fe5050b
2019-12-02 16:47:59 -08:00
Sebastian Messmer
a2ed50c920 Revert D17908478: Switch PyTorch/Caffe2 to C++14
Test Plan: revert-hammer

Differential Revision:
D17908478

Original commit changeset: 6e340024591e

fbshipit-source-id: 775d2e29be0bc3a0db64f164c8960c44d4877d5d
2019-11-27 14:57:05 -08:00
Sebastian Messmer
d0acc9c085 Switch PyTorch/Caffe2 to C++14 (#30406)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30406

ghstack-source-id: 94642238

Test Plan: waitforsandcastle

Differential Revision: D17908478

fbshipit-source-id: 6e340024591ec2c69521668022999df4a33b4ddb
2019-11-27 10:47:31 -08:00
Nathan Goldbaum
211e39fd1c add docs for profiling PyTorch with py-spy (#30166)
Summary:
This adds developer documentation for profiling PyTorch using py-spy. In my work on `__torch_function__` I found its ability to profile native code and dump flame graphs extremely useful. I'm not aware of another Python sampling profiler with similar functionality.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30166

Differential Revision: D18625133

Pulled By: ezyang

fbshipit-source-id: cf1b851564a07c9f12fcf1338ac4527f4a3c61c0
2019-11-20 15:09:40 -08:00
Hong Xu
2a23654880 Switch to official releases of katex and update doc for installing katex. (#27758)
Summary:
katex is a deprecated package in Ubuntu and has been removed in recent
releases of Debian. Use npm instead.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27758

Differential Revision: D17891039

Pulled By: ezyang

fbshipit-source-id: 53de6e14b2638298e5b61996dcd7ba8de02420a3
2019-10-11 17:20:06 -07:00
Nathan Goldbaum
15bec0970c Add instructions for setting up ccache from conda (#27481)
Summary:
I was unable to use the existing instructions since I don't have sudo privileges on my GPU development machine and couldn't easily install `ccache` or the build dependencies for `ccache`.

However, I was able to get it working by installing `ccache` with `conda` and then creating symlinks to shadow my compilers as in the build-from-source installation instructions. I figure this might be generally useful as others might not have sudo privileges on their pytorch development machine.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27481

Differential Revision: D17831556

Pulled By: ezyang

fbshipit-source-id: c5373d8739ad910015e677e7ad48bd91b770f842
2019-10-09 08:49:51 -07:00
Dmytro Dzhulgakov
bac11d1002 Tweak docs on building docs
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/27364

Differential Revision: D17777402

Pulled By: dzhulgakov

fbshipit-source-id: 304c678e5c80d7f8c779d65c11f9bf1b0facdb52
2019-10-04 22:14:37 -07:00
David Riazati
5cc353482d Add doc building instructions
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26553

Differential Revision: D17551426

Pulled By: driazati

fbshipit-source-id: 53ce05882091aca4617586bc53944ee4c8b3a622
2019-09-24 10:38:23 -07:00
Sebastian Messmer
cb022d7bec Fix AliasAnalysisKind::PURE on MSVC (#25375)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25375

Either MSVC or the Windows headers have a PURE macro defined and will replace
any occurrences of the PURE token in code with an empty string. Replace
AliasAnalysisKind::PURE with AliasAnalysisKind::PURE_FUNCTION.

Note: this is bc breaking.
ghstack-source-id: 89202222

Test Plan: unit tests

Differential Revision: D17107743

fbshipit-source-id: 899a20651ba32d50691956b5424b351586c21cec
2019-08-29 09:42:41 -07:00
Michael Suo
aa66146974 Add ASAN instructions to CONTRIBUTING.md
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/24848

Test Plan: Imported from OSS

Differential Revision: D16896673

Pulled By: suo

fbshipit-source-id: 32e58abe9fd79a8217cecbc7832e436684edaf80
2019-08-21 19:16:21 -07:00
Hong Xu
fb8725fdbd Update doc about subsequent builds: options can be changed in build/CMakeCache.txt
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23331

Test Plan: Imported from OSS

Differential Revision: D16517622

Pulled By: ezyang

fbshipit-source-id: d2d15b8bb2599b3b9abb7a1aa6bc91bfc0d8e5d0
2019-07-26 08:50:32 -07:00
Kexuan Sun
89d6e88042 Add environment variables used in CONTRIBUTING example (#22736)
Summary:
Some other environment variables can be added to speed things up for development.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22736

Differential Revision: D16200904

Pulled By: soumith

fbshipit-source-id: 797ef91a863a244a6c96e0adf64d9f9b4c9a9582
2019-07-11 04:15:51 -07:00
Hong Xu
80e2fab952 Deprecate and set a date for removing NO_* and WITH_* (user) build options (#22474)
Summary:
Currently specifying different build options in respect to the "USE_"
series is in quite a disarray. There are a lot of build options that
accept three variants: USE_OPTION, WITH_OPTION, and NO_OPTION. Some
build options only accept USE_ and NO_ variant. Some accept only USE_.
This inconsistency is quite confusing and hard to maintain.

To resolve this inconsistency, we can either let all these build options
support all three variants, or we only support the USE_ variant.

This commit makes a step to the latter choice, i.e., deprecates and sets
a date for removing the NO_ and WITH_ variants and keeps only the
USE_ variant. This is likely better than the former solution because:

- NO_ and WITH_ variants are not documented.
- CMakeLists.txt only has the USE_ variants for relevant build options
  defined. It would be a surprise that when user pass these variables to
  CMake during rebuild and find them ineffective.
- Multiple variants are difficult to maintain.
- The behavior is confusing if more than one variant is passed. For
  example, what to be expected if one sets "NO_CUDA=1 USE_CUDA=1"?

The downside is that this will break backward compatibility for existing
build scripts in the future (if they used the undocumented build
options).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22474

Differential Revision: D16149396

Pulled By: ezyang

fbshipit-source-id: 7145b88ad195db2051772b9665dd708dfcf50b7d
2019-07-08 08:22:08 -07:00
Hong Xu
299ea84a70 Use latest stable flake8-bugbear in CI and fix B011 flake8 error. (#21944)
Summary:
- PyCQA/flake8-bugbear#53 has been fixed (but not yet closed on their side) and a new version of flake8-bugbear has been released on Mar 28, 2019. Switch CI to use the latest stable version.
- Fix the new B011 errors that flake8-bugbear catches in the current codebase.

 ---

B011: Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21944

Differential Revision: D15974842

Pulled By: soumith

fbshipit-source-id: de5c2c07015f7f1c50cb3904c651914b8c83bf5c
2019-06-24 20:48:15 -07:00
Syed Tousif Ahmed
95eb9339c1 Adds CUDA C++11 and Profiling Notes (#21386)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21386
ghimport-source-id: 9430c7640b90d9add38d9bf2f1bd0c8f62b7f239

Differential Revision: D15640102

Pulled By: ezyang

fbshipit-source-id: 98a5efdea9b1de05207ebd3624cb20acda9fe96b
2019-06-04 19:18:55 -07:00
Michael Suo
ca32563999 add suggestion to use lld to CONTRIBUTING.md (#21334)
Summary:
I found this significantly speeds up incremental builds.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21334

Differential Revision: D15632994

Pulled By: suo

fbshipit-source-id: bb4af90f4400bffa90d168d82ff30fece5e3835c
2019-06-04 15:40:49 -07:00
Stas Bekman
f9a56d4af2 CUDA_NVCC_EXECUTABLE is not needed, as nvcc is in PATH (#18958)
Summary:
As indicated by f0k: https://github.com/pytorch/pytorch/pull/18495#issuecomment-480178763
nvcc via ccache is already first in the PATH in the instructions I provided, so CUDA_NVCC_EXECUTABLE is not needed.

I re-built to test that it's so.

Thank you!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18958

Differential Revision: D14810732

Pulled By: ezyang

fbshipit-source-id: 3758ae2253c745c5d7cfccedd49fa00cc4629965
2019-04-05 13:07:05 -07:00
Edward Yang
6841537933 Delete duplicated technical content from contribution_guide.rst (#18628)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18628
ghimport-source-id: d94b81a6f303883d97beaae25344fd591e13ce52

Stack from [ghstack](https://github.com/ezyang/ghstack):
* #18629 Provide flake8 install instructions.
* **#18628 Delete duplicated technical content from contribution_guide.rst**

There's useful guide in contributing_guide.rst, but the
technical bits were straight up copy-pasted from CONTRIBUTING.md,
and I don't think it makes sense to break the CONTRIBUTING.md
link.  Instead, I deleted the duplicate bits and added a cross
reference to the rst document.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14701003

fbshipit-source-id: 3bbb102fae225cbda27628a59138bba769bfa288
2019-03-31 19:13:22 -07:00
Edward Yang
35bc83524d Provide flake8 install instructions. (#18629)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18629
ghimport-source-id: 66a8871c56ffcfa7d4bfdf601e180fae99194e28

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18629 Provide flake8 install instructions.**
* #18628 Delete duplicated technical content from contribution_guide.rst

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14701004

fbshipit-source-id: b64292f0ef01b7894cf6b9ff8d5fd9e921c8d162
2019-03-31 18:59:18 -07:00
Soumith Chintala
81b73951f1 note on updating existing source (#18409)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/18388
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18409

Differential Revision: D14597666

Pulled By: soumith

fbshipit-source-id: 156104c0cd19da06f6f96a225228d1e8cf831af1
2019-03-29 16:14:47 -07:00
Stas Bekman
45ec4920e3 how to use the ccache package on Ubuntu (#18495)
Summary:
Added full instructions for how to use the `ccache` package. Thanks.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18495

Differential Revision: D14635351

Pulled By: ezyang

fbshipit-source-id: 158e1052bae580e95f73644252fdbddcc0213128
2019-03-26 20:08:09 -07:00
Edward Yang
8f1db1c6c1 Copy-edit CONTRIBUTING and update. (#18131)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18131
ghimport-source-id: 473dae70f6c236d317bec77d894310c0aa0376ec

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18131 Copy-edit CONTRIBUTING and update.**

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14505049

fbshipit-source-id: 02aeae33c0049889243c56dd0d761487dac2351e
2019-03-20 07:40:59 -07:00
Karl Ostmo
b21e9e4dae update ccache guide (#17938)
Summary:
closes #17937
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17938

Differential Revision: D14435791

Pulled By: kostmo

fbshipit-source-id: b1d0db8902f78bde51150606e2a67fb9ddfe7812
2019-03-12 21:48:17 -07:00
Elias Ellison
549eb9e9bc add reference to flake8-mypy in contributing.md
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17759

Differential Revision: D14376813

Pulled By: eellison

fbshipit-source-id: cca1128e967ef7368633b94a3fa3c8e76a4a16f4
2019-03-07 15:28:59 -08:00
Michael Suo
15840e30dc add pointer to windows FAQ in contributing.md (#17450)
Summary:
" ProTip! Great commit summaries contain fewer than 50 characters. Place extra information in the extended description."
lol
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17450

Differential Revision: D14206500

Pulled By: suo

fbshipit-source-id: af7ffe299f8c8f04fa8e720847a1f6d576ebafc1
2019-02-24 23:03:00 -08:00