Commit Graph

357 Commits

Author SHA1 Message Date
dcafe3f271 Updates to the release notes scripts and documentation (#94560)
# Summary
This PR made some significant changes to the scripts around Release Scripts. At a high level:
- Turned the quips into docs and updated links
- Update the common.categorizes list in the hopes to make this the source of truth for releases- This is hard since the release_notes labels can be changed at will. An alternative would be to poll from github api. However, I think that is overkill. The notebook does a set compare and will show you knew categories. I think we want this to be manual so that the release note engineer will decided how to categorize.
- Create cateogry group from speaking with folks on distributed and AO that told me these different release categories can be merged.
- I am the newest person to Core and don't use ghstack soo made token getting a lil more generic.
- Added a classifier.py file. This file will train a commit categorizer for you, hopefully with decent accuracy. I was able to achieve 75% accuracy. I drop the highest frequency class - "skip" since this creates a more useful cateogrizer.
- I updated the categorize.py script so that the prompt will be what the classifier thinks, gated by a flag.
- Added a readme that will hopefully help future release notes engineers.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94560
Approved by: https://github.com/albanD
2023-03-16 00:09:26 +00:00
dd5e6e8553 [BE]: Merge startswith calls - rule PIE810 (#96754)
Merges startswith, endswith calls to into a single call that feeds in a tuple. Not only are these calls more readable, but it will be more efficient as it iterates through each string only once.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96754
Approved by: https://github.com/ezyang
2023-03-14 22:05:20 +00:00
6a2dcfd738 Move all ONNX test dependencies to Docker (#96590)
Per title.  This is the first one of a two-part process:

[x] Move all ONNX test dependencies to Docker https://github.com/pytorch/pytorch/pull/96590
[ ] Move the test model used by [TestFxToOnnxWithOnnxRuntime.test_gpt2_tiny](https://hud.pytorch.org/failure/FAILED%20test%2Fonnx%2Ftest_fx_to_onnx_with_onnxruntime.py%3A%3ATestFxToOnnxWithOnnxRuntime%3A%3Atest_large_scale_exporter_with_tiny_gpt2%20-%20requests.exceptions.ReadTimeout%3A%20HTTPSConnectionPool(host%3D'huggingface.co'%2C%20port%3D443)%3A%20Read%20timed%20out.%20(read%20timeout%3D10.0))
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96590
Approved by: https://github.com/ZainRizvi
2023-03-14 06:19:00 +00:00
a8d1eb1961 Convenience script for getting correct Triton nightly binary (#96669)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96669
Approved by: https://github.com/ngimel, https://github.com/malfet
2023-03-13 18:58:38 +00:00
b005ec62b9 [BE] Remove dependency on six and future (#94709)
Remove the Python 2 and 3 compatibility library [six](https://pypi.org/project/six) and [future](https://pypi.org/project/future) and `torch._six`. We only support Python 3.8+ now. It's time to retire them.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94709
Approved by: https://github.com/malfet, https://github.com/Skylion007
2023-02-14 09:14:14 +00:00
67d9790985 [BE] Apply almost all remaining flake8-comprehension checks (#94676)
Applies the remaining flake8-comprehension fixes and checks. This changes replace all remaining unnecessary generator expressions with list/dict/set comprehensions which are more succinct, performant, and better supported by our torch.jit compiler. It also removes useless generators such as 'set(a for a in b)`, resolving it into just the set call.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94676
Approved by: https://github.com/ezyang
2023-02-12 01:01:25 +00:00
3d82d8d0ed [BE] Enable more flake8-comprehensions checks (#94601)
I applied some flake8 fixes and enabled checking for them in the linter. I also enabled some checks for my previous comprehensions PR.

This is a follow up to #94323 where I enable the flake8 checkers for the fixes I made and fix a few more of them.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94601
Approved by: https://github.com/ezyang
2023-02-10 23:40:29 +00:00
df13247e67 small bugfixes to release notes script (#94536)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94536
Approved by: https://github.com/drisspg
2023-02-10 01:23:07 +00:00
a229b4526f [BE] Prefer dash over underscore in command-line options (#94505)
Preferring dash over underscore in command-line options. Add `--command-arg-name` to the argument parser. The old arguments with underscores `--command_arg_name` are kept for backward compatibility.

Both dashes and underscores are used in the PyTorch codebase. Some argument parsers only have dashes or only have underscores in arguments. For example, the `torchrun` utility for distributed training only accepts underscore arguments (e.g., `--master_port`). The dashes are more common in other command-line tools. And it looks to be the default choice in the Python standard library:

`argparse.BooleanOptionalAction`: 4a9dff0e5a/Lib/argparse.py (L893-L895)

```python
class BooleanOptionalAction(Action):
    def __init__(...):
            if option_string.startswith('--'):
                option_string = '--no-' + option_string[2:]
                _option_strings.append(option_string)
```

It adds `--no-argname`, not `--no_argname`. Also typing `_` need to press the shift or the caps-lock key than `-`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94505
Approved by: https://github.com/ezyang, https://github.com/seemethere
2023-02-09 20:16:49 +00:00
0ecb071fc4 [BE][CI] change references from .jenkins to .ci (#92624)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/92624
Approved by: https://github.com/ZainRizvi, https://github.com/huydhn
2023-01-30 22:50:07 +00:00
93e71cc2f5 Add helpers for running tests and then putting them in a CSV (#92642)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/92642
Approved by: https://github.com/albanD
2023-01-22 02:00:39 +00:00
ec94cbc66a [Vulkan] Remove GLSL Code Gen (#91912)
@bypass-github-export-checks

GLSL Code Gen is not used, so this diff removes
- GLSL parts of ShaderSource
- Anything enclosed by USE_VULKAN_SHADERC_RUNTIME, as well as the flag itself
- gen_vulkan_glsl script

Plus some additional refactoring

Differential Revision: [D41358861](https://our.internmc.facebook.com/intern/diff/D41358861/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D41358861/)!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91912
Approved by: https://github.com/mcr229
2023-01-10 20:29:47 +00:00
fdbbd20f32 Cache conda and pip for IOS CI (#91359)
Fixes T137630520

Caching for conda and pip dependencies for iOS CI workflow.

- Conda and pip dependencies have been moved from [_ios-build-test.yml](https://github.com/pytorch/pytorch/blob/master/.github/workflows/_ios-build-test.yml) to dedicated requirements files
- Miniconda shell installation has been replaced by `setup-miniconda@main` which supports caching
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91359
Approved by: https://github.com/malfet, https://github.com/huydhn
2022-12-30 17:52:20 +00:00
634555d981 [ONNX] Auto test based on OpInfo (#86182)
This change introduces a mechanism to test onnx export based on sample inputs registered in OpInfo, similar to how MPS and other components of pytorch are tested. It provides test coverage on ops and dtypes previously unattainable with manually created test models. This is the best way for us to discover gaps in the exporter support, especially for ops with partial existing support.

This test is adapted from https://github.com/pytorch/pytorch/blob/master/test/test_mps.py

This PR also

- Update sqrt to support integer inputs to match pytorch behavior
- Add pytest-subtests for unittest subtests support in the new test file

I only enabled very few ops: `t`, `ceil` and `sqrt` because otherwise too many things will fail due to (1) unsupported dtypes in the exporter (2) unimplemented dtype support in onnxruntime (3) unexpected input to verification.verify.

Subsequent PRs should improve `verification.verify` first for it to accept any legal input to a pytorch model, then incrementally fix the symbolic functions to enable more test cases.

Fixes #85363
Design #88118
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86182
Approved by: https://github.com/BowenBao
2022-12-16 14:43:41 +00:00
36ac095ff8 Migrate PyTorch to C++17 (#85969)
With CUDA-10.2 gone we can finally do it!

This PR mostly contains build system related changes, invasive functional ones are to be followed.
Among many expected tweaks to the build system, here are few unexpected ones:
 - Force onnx_proto project to be updated to C++17 to avoid `duplicate symbols` error when compiled by gcc-7.5.0, as storage rule for `constexpr` changed in C++17, but gcc does not seem to follow it
 - Do not use `std::apply` on CUDA but rely on the built-in variant, as it results in test failures when CUDA runtime picks host rather than device function when `std::apply` is invoked from CUDA code.
 - `std::decay_t` -> `::std::decay_t` and `std::move`->`::std::move` as VC++ for some reason claims that `std` symbol is ambigious
 - Disable use of `std::aligned_alloc` on Android, as its `libc++` does not implement it.

Some prerequisites:
 - https://github.com/pytorch/pytorch/pull/89297
 - https://github.com/pytorch/pytorch/pull/89605
 - https://github.com/pytorch/pytorch/pull/90228
 - https://github.com/pytorch/pytorch/pull/90389
 - https://github.com/pytorch/pytorch/pull/90379
 - https://github.com/pytorch/pytorch/pull/89570
 - https://github.com/facebookincubator/gloo/pull/336
 - https://github.com/facebookincubator/gloo/pull/343
 - 919676fb32

Fixes https://github.com/pytorch/pytorch/issues/56055

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85969
Approved by: https://github.com/ezyang, https://github.com/kulinseth
2022-12-08 02:27:48 +00:00
837ca8f344 Remove --retry-all-errors from environment with old curl (#89298)
The version of curl on the `ubuntu-latest` box doesn't support the `--retry-all-errors` param and is breaking periodic builds

Example: https://github.com/pytorch/pytorch/actions/runs/3495466804/jobs/5852265880
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89298
Approved by: https://github.com/huydhn
2022-11-18 19:36:09 +00:00
ab75982d3a Always retry curl downloads (#89157)
Modify our curl commands so that they always retry downloads.

By default, curl only retries what it considers to be "transient" errors, based on the server's response. However, curl's estimate of what's transient is very conservative.  By adding the --retry-all-errors parameter we'll always retry curl commands.

In particular, I'm hoping this mitigates errors where curl fails with the below error ([logs](https://github.com/pytorch/pytorch/actions/runs/3468758110/jobs/5794939941))
`curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to ossci-linux.s3.amazonaws.com:443`

Some of the modified downloads didn't even have retries, so I added them in

More details: https://everything.curl.dev/usingcurl/downloads/retry
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89157
Approved by: https://github.com/kit1980, https://github.com/malfet
2022-11-18 07:03:24 +00:00
c413a32135 Release note script: match topics with spaces or underscores (#87011)
e.g. match "new features" in the category as "new_features"
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87011
Approved by: https://github.com/albanD, https://github.com/soulitzer
2022-10-19 02:28:45 +00:00
06868004b7 Remove codesigning from ios circleci workflows (#85630)
This PR is a follow up to https://github.com/pytorch/pytorch/pull/85597 which removes codesigning from our github action workflows. This is a synonymous change to our circleci workflows. Since we only run TestApp on simulator we don't need to have this codesigning logic. (And more pressingly, these dev cert is expiring at the end of the month and we don't have a replacement)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85630
Approved by: https://github.com/atalman, https://github.com/malfet
2022-09-29 19:49:11 +00:00
747f27a9ad [Mobile] Update build_mobile.sh to allow lite interpreter and tracing based builds (#84647)
Summary: Currently, build_mobile.sh doesn't allow lite interpreter builds or tracing based selective builds. build_mobile.sh is used for host builds of PyTorch for Mobile deployment.

Additionally, certain flags such as `USE_BLAS` were not being respected as they should be. This change addresses that as well.

Test Plan: Build using:

```
cat /tmp/selected_ops.yaml
- aten::add
- aten::sub
```

```
BUILD_PYTORCH_MOBILE_WITH_HOST_TOOLCHAIN=1 USE_LIGHTWEIGHT_DISPATCH=0 BUILD_LITE_INTERPRETER=1 SELECTED_OP_LIST=/tmp/selected_ops.yaml ./scripts/build_mobile.sh
```

```
cat /tmp/main.cpp

int main() {
  auto m = torch::jit::_load_for_mobile("/tmp/path_to_model.ptl");
  auto res = m.forward({});
  return 0;
}
```

Test using:

```
g++ /tmp/main.cpp -L build_mobile/lib/ -I build_mobile/install/include/ -lpthread -lc10 -ltorch_cpu -ltorch -lXNNPACK -lpytorch_qnnpack -lcpuinfo -lclog -lpthreadpool -lgloo -lkineto -lfmt -ldl -lc10
```

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84647
Approved by: https://github.com/JacobSzwejbka, https://github.com/cccclai
2022-09-09 15:02:29 +00:00
e0229d6517 Remove caffe2 mobile (#84338)
We're no longer building Caffe2 mobile as part of our CI, and it adds a lot of clutter to our make files. Any lingering internal dependencies will use the buck build and so wont be effected.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84338
Approved by: https://github.com/dreiss
2022-09-08 01:49:55 +00:00
bf25a140f9 [ONNX] Add runtime type checking to export (#83673)
This PR adds an internal wrapper on the [beartype](https://github.com/beartype/beartype) library to perform runtime type checking in `torch.onnx`. It uses beartype when it is found in the environment and is reduced to a no-op when beartype is not found.

Setting the env var `TORCH_ONNX_EXPERIMENTAL_RUNTIME_TYPE_CHECK=ERRORS` will turn on the feature. setting `TORCH_ONNX_EXPERIMENTAL_RUNTIME_TYPE_CHECK=DISABLED` will disable all checks. When not set and `beartype` is installed, a warning message is emitted.

Now when users call an api with invalid arguments e.g.

```python
torch.onnx.export(conv, y, path, export_params=True, training=False)

# traning should take TrainingModel, not bool
```

they get

```
Traceback (most recent call last):
  File "bisect_m1_error.py", line 63, in <module>
    main()
  File "bisect_m1_error.py", line 59, in main
    reveal_error()
  File "bisect_m1_error.py", line 32, in reveal_error
    torch.onnx.export(conv, y, cpu_model_path, export_params=True, training=False)
  File "<@beartype(torch.onnx.utils.export) at 0x1281f5a60>", line 136, in export
  File "pytorch/venv/lib/python3.9/site-packages/beartype/_decor/_error/errormain.py", line 301, in raise_pep_call_exception
    raise exception_cls(  # type: ignore[misc]
beartype.roar.BeartypeCallHintParamViolation: @beartyped export() parameter training=False violates type hint <class 'torch._C._onnx.TrainingMode'>, as False not instance of <protocol "torch._C._onnx.TrainingMode">.
```

when `TORCH_ONNX_EXPERIMENTAL_RUNTIME_TYPE_CHECK` is not set and `beartype` is installed, a warning message is emitted.

```
>>> torch.onnx.export("foo", "bar", "f")
<stdin>:1: CallHintViolationWarning: Traceback (most recent call last):
  File "/home/justinchu/dev/pytorch/torch/onnx/_internal/_beartype.py", line 54, in _coerce_beartype_exceptions_to_warnings
    return beartyped(*args, **kwargs)
  File "<@beartype(torch.onnx.utils.export) at 0x7f1d4ab35280>", line 39, in export
  File "/home/justinchu/anaconda3/envs/pytorch/lib/python3.9/site-packages/beartype/_decor/_error/errormain.py", line 301, in raise_pep_call_exception
    raise exception_cls(  # type: ignore[misc]
beartype.roar.BeartypeCallHintParamViolation: @beartyped export() parameter model='foo' violates type hint typing.Union[torch.nn.modules.module.Module, torch.jit._script.ScriptModule, torch.jit.ScriptFunction], as 'foo' not <protocol "torch.jit.ScriptFunction">, <protocol "torch.nn.modules.module.Module">, or <protocol "torch.jit._script.ScriptModule">.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/justinchu/dev/pytorch/torch/onnx/_internal/_beartype.py", line 63, in _coerce_beartype_exceptions_to_warnings
    return func(*args, **kwargs)
  File "/home/justinchu/dev/pytorch/torch/onnx/utils.py", line 482, in export
    _export(
  File "/home/justinchu/dev/pytorch/torch/onnx/utils.py", line 1422, in _export
    with exporter_context(model, training, verbose):
  File "/home/justinchu/anaconda3/envs/pytorch/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/home/justinchu/dev/pytorch/torch/onnx/utils.py", line 177, in exporter_context
    with select_model_mode_for_export(
  File "/home/justinchu/anaconda3/envs/pytorch/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/home/justinchu/dev/pytorch/torch/onnx/utils.py", line 95, in select_model_mode_for_export
    originally_training = model.training
AttributeError: 'str' object has no attribute 'training'
```

We see the error is caught right when the type mismatch happens, improving from what otherwise would become `AttributeError: 'str' object has no attribute 'training'`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83673
Approved by: https://github.com/BowenBao
2022-08-25 21:24:37 +00:00
8324cdda35 [ONNX] Add quantized model tests to CI (#80398)
In parallel to #80039, start tracking torchvision quantized model export in CI.

This PR depends on ~~#80393~~#79256, bumping torchvision version in CI, due to PyTorch not backward compatible with vision #74028.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80398
Approved by: https://github.com/justinchuby, https://github.com/AllenTiTaiWang, https://github.com/garymm
2022-07-28 21:25:29 +00:00
34bb3714f0 Remove obsolete onnx_c2 scripts (#82285)
The scripts look completely obsolete.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82285
Approved by: https://github.com/ezyang
2022-07-28 00:10:25 +00:00
4c0000a98e [ONNX] Remove duplicated test run (#81146)
Looks like caused by incorrect (auto) merge conflict resolution. `test_models_onnxruntime.py` script is run twice.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81146
Approved by: https://github.com/justinchuby, https://github.com/AllenTiTaiWang, https://github.com/garymm
2022-07-22 21:43:44 +00:00
3c7044728b Enable Intel® VTune™ Profiler's Instrumentation and Tracing Technology APIs (ITT) to PyTorch (#63289)
More detailed description of benefits can be found at #41001. This is Intel's counterpart of NVidia’s NVTX (https://pytorch.org/docs/stable/autograd.html#torch.autograd.profiler.emit_nvtx).

ITT is a functionality for labeling trace data during application execution across different Intel tools.
For integrating Intel(R) VTune Profiler into Kineto, ITT needs to be integrated into PyTorch first. It works with both standalone VTune Profiler [(https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html](https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html)) and Kineto-integrated VTune functionality in the future.
It works for both Intel CPU and Intel XPU devices.

Pitch
Add VTune Profiler's ITT API function calls to annotate PyTorch ops, as well as developer customized code scopes on CPU, like NVTX for NVidia GPU.

This PR rebases the code changes at https://github.com/pytorch/pytorch/pull/61335 to the latest master branch.

Usage example:
```
with torch.autograd.profiler.emit_itt():
    for i in range(10):
        torch.itt.range_push('step_{}'.format(i))
        model(input)
        torch.itt.range_pop()
```

cc @ilia-cher @robieta @chaekit @gdankel @bitfort @ngimel @orionr @nbcsm @guotuofeng @guyang3532 @gaoteng-git
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63289
Approved by: https://github.com/malfet
2022-07-13 13:50:15 +00:00
3c4c7d3e6b [Release Notes] fix bug with categorize call (#81284)
This was pointed out by @kit1980 in #78190
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81284
Approved by: https://github.com/kit1980
2022-07-12 19:02:15 +00:00
7fd0cf5581 [Release Notes] Add way to export result from Google Sheets to Markdown (#79911)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79911
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
6d4410b8c6 [Release Notes] Simple script to merge categories (#79910)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79910
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
755861063d Adding additional topics to align with github topics list (#79909)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79909
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
770fc74e33 [Release Notes] Add Github PR link to csv export (#79908)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79908
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
ad6328ea51 [Release Notes] Adding CSV Category Export (#78212)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78212
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
62bf807113 Always use the CommitCache, and make it a singleton (#78203)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78203
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
da549f58d5 Adding Author and Accepters information into pytorch release notes gen (#78190)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78190
Approved by: https://github.com/soulitzer, https://github.com/malfet
2022-07-07 22:42:46 +00:00
8549fafd36 Refactoring release not script to use dataclasses and have a shorter test. (#78189)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78189
Approved by: https://github.com/soulitzer
2022-07-07 22:42:46 +00:00
1454515253 Revert "Enable Intel® VTune™ Profiler's Instrumentation and Tracing Technology APIs (ITT) to PyTorch (#63289)"
This reverts commit f988aa2b3ff77d5aa010bdaae4e52c6ee345c04d.

Reverted https://github.com/pytorch/pytorch/pull/63289 on behalf of https://github.com/malfet due to broke trunk, see f988aa2b3f
2022-06-30 12:49:41 +00:00
f988aa2b3f Enable Intel® VTune™ Profiler's Instrumentation and Tracing Technology APIs (ITT) to PyTorch (#63289)
More detailed description of benefits can be found at #41001. This is Intel's counterpart of NVidia’s NVTX (https://pytorch.org/docs/stable/autograd.html#torch.autograd.profiler.emit_nvtx).

ITT is a functionality for labeling trace data during application execution across different Intel tools.
For integrating Intel(R) VTune Profiler into Kineto, ITT needs to be integrated into PyTorch first. It works with both standalone VTune Profiler [(https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html](https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html)) and Kineto-integrated VTune functionality in the future.
It works for both Intel CPU and Intel XPU devices.

Pitch
Add VTune Profiler's ITT API function calls to annotate PyTorch ops, as well as developer customized code scopes on CPU, like NVTX for NVidia GPU.

This PR rebases the code changes at https://github.com/pytorch/pytorch/pull/61335 to the latest master branch.

Usage example:
```
with torch.autograd.profiler.emit_itt():
    for i in range(10):
        torch.itt.range_push('step_{}'.format(i))
        model(input)
        torch.itt.range_pop()
```

cc @ilia-cher @robieta @chaekit @gdankel @bitfort @ngimel @orionr @nbcsm @guotuofeng @guyang3532 @gaoteng-git
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63289
Approved by: https://github.com/malfet
2022-06-30 05:14:03 +00:00
d32ab80c32 Update buck_setup.sh (#80467)
Add a parameter for proxy setup when running this script in devserver

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80467
Approved by: https://github.com/malfet
2022-06-29 01:39:37 +00:00
2d7d5a75aa Cleanup buck_setup.sh a bit (#80198)
Use `curl -L |tar xf` to extract downloadable file right into the folder one wants to use

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80198
Approved by: https://github.com/linbinyu
2022-06-24 15:31:45 +00:00
3507bee7d1 Update buck_setup.sh (#80116)
Remove destination folders if they already exist. Otherwise the copy step will fail. It happens if people tried to run this script several times.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80116
Approved by: https://github.com/kit1980
2022-06-23 05:50:41 +00:00
73f6601cfc [ONNX] Refactor heavy memory usage tests
* Move memory heavy tests from `test_pytorch_onnx_onnxruntime.py` to
  `test_models_onnxruntime.py`. The former is run in parallel in CI,
  while the latter is not. A change is that the moved tests are now
  only covered in default opset export.
* Refactor and create base class for tests that export model to ONNX
  and verify with ONNX Runtime. The new base class are parameterized
  with `opset_version` and `is_script`. Further work can be done to
  refactor existing test classes in `test_pytorch_onnx_onnxruntime.py`.
  See #75630
* Reduce unnecessarily large tensor size in
  `test_pytorch_onnx_onnxruntime.py` to further reduce memory usage
  and test time.

After this PR, the running time for `test_pytorch_onnx_onnxruntime.py`
is reduced from `1338.82s (0:22:18)` to `225.07s (0:03:45)`,
benchmarked on 10900x with `-n 10`.

Fixes #79179

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

Approved by: https://github.com/justinchuby, https://github.com/garymm
2022-06-18 02:28:00 +00:00
44764f131b [ONNX] Move tests in test_onnx_export.py to test_pytorch_onnx_no_runtime.py (#78310)
Fixes #78308
This should be merged after
- #78116

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78310
Approved by: https://github.com/justinchuby, https://github.com/garymm
2022-06-14 06:08:29 +00:00
4750f745bf [ONNX] Disable parallel run for custom op related tests in CI (#78944)
Should fix #78844
Custom op related tests utilize inline cpp extension to build custom
operator from c++ source snippet. Only two test cases become flaky after
parallel run, and both use inline cpp extension. Reverting to run these
tests in single process to try resolve the flakiness.
Reverts test skip added previously #78936.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78944
Approved by: https://github.com/janeyx99, https://github.com/garymm
2022-06-07 01:03:22 +00:00
4220799ea7 scripts: Fix dry run for cut-release-branch.sh
Signed-off-by: Eli Uriegas <eliuriegasfb.com>

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

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Approved by: https://github.com/suo, https://github.com/atalman
2022-06-02 19:23:51 +00:00
cfc968956c [ONNX] Update CI test script to run parallel by default (#78200)
Also update default process count to auto, matching the CI machine
cpu core count.

Fixes #77678

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78200
Approved by: https://github.com/garymm
2022-06-02 00:25:17 +00:00
1f8049566f Re-land BUCK build for pytorch mobile (#77612)
see https://github.com/pytorch/pytorch/pull/76480
fixed most lint errors
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77612
Approved by: https://github.com/kit1980
2022-05-17 00:30:13 +00:00
530481ed69 Revert "[mobile] add buck build for mobile targets (#76480)"
This reverts commit 168dc70faf9764417a7e41a14bf2f4e15a7f3e4a.

Reverted https://github.com/pytorch/pytorch/pull/76480 on behalf of https://github.com/atalman
2022-05-16 16:14:17 +00:00
168dc70faf [mobile] add buck build for mobile targets (#76480)
Create buck targets to replicate internal BUCK build, including
- XNNPACK
- QNNPACK
- C10
- aten_cpu
- torch_mobile_core
- torch_mobile_all_ops
- ptmobile_benchmark

And able to run mobilenet v2 using ptmobile_benchmark (with all ops).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76480
Approved by: https://github.com/seemethere, https://github.com/dreiss
2022-05-15 18:42:41 +00:00
43f6d79e51 update release notes script to automatically grab labels from the PR
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75020

Approved by: https://github.com/albanD, https://github.com/anjali411
2022-05-12 18:39:24 +00:00
5ed7312081 release notes script changes
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72154

Approved by: https://github.com/albanD, https://github.com/anjali411
2022-05-12 18:39:24 +00:00