Commit Graph

7 Commits

Author SHA1 Message Date
Richard Barnes b745e5f115 Check all CUDA API calls for errors in benchmarks/cpp/nvfuser (#74920) (#81817)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74920

Test Plan: Sandcastle

Differential Revision: D35194656

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81817
Approved by: https://github.com/malfet
2022-08-24 18:59:05 +00:00
jjsjann123 df741c589f [NVFuser] Upstream push 0809 (#83067)
Syncing nvfuser devel branch to upstream master. https://github.com/csarofeen/pytorch/

Code changes includes:

- codegen improvements:
  1. removes un-necessary sync from redundant thread compute analysis
  2. symmetric API for BestEffortReplay
  3. support merge on trivial reductions
  4. Ampere async copy improvements
- bug fixes:
  1. vectorization bug fixes
  2. type inference patch : fixes upstream #81725
  3. segmenter bug fix with deterministic iteration ordering
- parser update
  1. added leaky_relu
- scheduler
  1. normalization scheduler clean up.
  2. simplifies matmul scheduling with new transform propagator
  3. merge all dimensions in PW scheduler
  4. various gemm related improvements
- debuggability
  1. nsight compute support
  2. debug dump for InlinePropagator
  3. Add `UnaryOpType::Print`

Squashed commits to WAR github API
Commits that's actually in this PR from the devel branch:

```
dfe02f3fae Merge remote-tracking branch 'csarofeen/devel' into HEAD
16173732ec Add `TensorViewBuilder::shape(std::vector<Val*> shape)` (#1884)
7cfb7796bd Merge pull request #1887 from csarofeen/upstream_merge_0803
3399f6de62 Merge remote-tracking branch 'origin/viable/strict' into HEAD
01208f5bba Add `UnaryOpType::Print` which can be helpful for debugging (#1878)
0646522454 Remove redundant TORCH_INTERNAL_ASSERT in lower_magic_zero.cpp (#1881)
7bc76aa219 Fix most inlined propagator for mismatched dims (#1875)
501f4aa270 Nonaffine swizzle formulation ep.2: Loop swizzle variant. (#1826)
d863d690f9 Ampere async copy ep.2: circular buffering extension to support pipelined matmul operand load (#1827)
e0ae11a61c Larger sized mma instructions to support full vectorization (#1824)
9bb4cf7a66 fragment iteration to support fully unrolled mma ops (#1823)
a48270a18d Merge all dims in pointwise scheduler (#1872)
172fb3673f Make MostInlined and BestEffort inline propagation no longer assert replayed (#1868)
a64462a5ac Allow trivial reduction to be merged (#1871)
440102bcda Symmetric API for BestEffortReplay (#1870)
d1caf330c0 Some misc cleanups/refactor split out from #1854 (#1867)
1013eda50b Remove some welford specific logic. (#1864)
51589d36be Some cleanups on tests and heuristics params (#1866)
a6b3e70da5 Segmenter bug fix, and deterministic iteration ordering.  (#1865)
1b665b9b5e Add nullptr checks to IrBuilder (#1861)
1cd9451d74 Simplify matmul scheduling with the new transform propagator.  (#1817)
bbc1fb9b8c Add leaky_relu operation (#1852)
e842a9bab5 Minor cleanup in pointwise scheduler (#1858)
9ee850ca2f Fix stringstream usage (#1857)
20a36c1e4f Improve nsight compute support (#1855)
4059103083 Remove debugging `true ||` from getPointwiseHeuristics (#1822)
01117bfe8f Misc cleanup (#1853)
5cc64943dc Apply the magic-zero protection to each indexed domain individually for predicate indexing (#1846)
92e6f0207e Cleanup normalization scheduler (#1845)
db89c6591a Type inference patch (#1848)
102fe93a46 Add debug dump for InlinePropagator (#1847)
b7a4d93d37 Redundant thread compute analysis to avoid un-necessary sync insertion (#1687)
942be5b256 Upstream ci build fixes (#1842)
0b83645915 Fix vectorization bug introduced in #1831 (#1840)
63630f1ae0 Move MaxProducerPosUpdater into InlinePropagator::tearDown (#1825)
9135a963c0 Fix transpose benchmark dtype (#1839)
2c9a6c0231 Add extra configurability to `parallelizeAllLike` (#1831)
```

RUN_TORCHBENCH: nvfuser

Differential Revision: [D38543000](https://our.internmc.facebook.com/intern/diff/D38543000)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83067
Approved by: https://github.com/davidberard98
2022-08-10 21:02:56 +00:00
jjsjann123 a2802ad0b9 Upstream master bump 0513 (#77471)
Updating nvfuser code base.

This should fix the indexing issue observed in https://github.com/pytorch/vision/issues/6015.

Running tests locally as well. Will update the description here at a later point

@bypass-github-export-checks
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77471
Approved by: https://github.com/seemethere, https://github.com/eellison
2022-05-18 11:48:50 -07:00
jjsjann123 0dc3f829d9 Nvfuser code bump 11 5 (#67943)
Summary:
nvfuser code update:
1. Tuning heuristics on schedulers for reduction/normalization kernels;
2. bfloat16 on IO tensor support;
3. Refactored memory format support, now we can support dimension collapsing with non-coherent input tensors with different memory format. e.g. channels last tensor input to batch normalization. Note that we are currently limiting memory format to only Contiguous and Channels last;
4. Refactored nvfuser graph partitioning in `graph_fuser.cpp`, separated node merge and profile node API. Updated `profiling_record.cpp`.

Things that are reverted from our local branch:
1. changes on some entries in autodiff
2. aten::gelu with approximation
3. native_dropout(_backward)

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

Reviewed By: ngimel

Differential Revision: D32288709

Pulled By: dzhulgakov

fbshipit-source-id: fc9491182ea7e0158bc112c66f096823c588eaf1
2021-11-17 01:22:17 -08:00
jiej 127c9402d0 Revert "Revert D30752939: [pytorch][PR] nvfuser update" (#65137)
Summary:
This reverts commit 03389dc851.

Attempt again for PR: https://github.com/pytorch/pytorch/issues/63745
Fixes the windows build failure.

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

Reviewed By: seemethere, dzhulgakov, heitorschueroff

Differential Revision: D30994556

Pulled By: malfet

fbshipit-source-id: f1925b6c5cc1a1a441a96499667c91e8dfc1b53d
2021-09-22 04:54:51 -07:00
Eli Uriegas 03389dc851 Revert D30752939: [pytorch][PR] nvfuser update
Test Plan: revert-hammer

Differential Revision:
D30752939 (https://github.com/pytorch/pytorch/commit/cfaecaf40bd6cabd3f4e0ef0d8c7252655349b61)

Original commit changeset: ce122e80f01b

fbshipit-source-id: 57685df8f9946032a06eff1de8a3d1498500d2d2
2021-09-15 17:38:47 -07:00
jiej cfaecaf40b nvfuser update (#63745)
Summary:
Syncing nvfuser code base from devel branch, Listing a few of our development since last sync:

- Extends support to normalization and reduction kernels.
- Multiple kernel launch for single `CudaFusionGroup`. Hierarchical caching system has been updated to cache graph segmentation.
- profile_ivalue is enabled to convert dynamic scalar into compile time constants, which are required by the codegen. (e.g. reduction axes).

To keep this PR simple and relatively review-free. We stripped most external changes and submitted them as separate PRs, so this gigantic PR is easier to handle.

internal updates are files located in:
1. updates in nvfuser codegen `torch/csrc/jit/coddgen/cuda`
2. added nvfuser specific benchmarks `benchmarks/cpp/nvfuser`
3. nvfuser jit cpp tests `test/cpp/jit/test_gpu.cpp` `test/cpp/jit/test_gpu_shift.cpp` `test/cpp/jit/test_gpu_validator.h`

updates affecting integration:

1. profile_ivalue enabled for nvfuser. related changes are in `torch/csrc/jit/runtime/*`,
2. exposed a few more symbols `aten/src/ATen/core/*` used by codegen

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

Reviewed By: saketh-are

Differential Revision: D30752939

Pulled By: malfet

fbshipit-source-id: ce122e80f01bcd3865f5bd3c4dfde660665fd84c
2021-09-15 14:42:55 -07:00