Commit Graph

13 Commits

Author SHA1 Message Date
jjsjann123 7b419e8513 [NVFuser] Upstream push 1026 (#87779)
Syncing nvfuser devel branch to upstream master. https://github.com/csarofeen/pytorch/

Codegen changes include:

* codegen improvement:
    i. allow non-root trivial reductions, allow empty/no-op fusion
    ii. fixes vectorization checks and size calculation
    iii. bank conflict handle improvement
    iv. enables transpose scheduler

* misc:
    i. CI tests failure fixes
    ii. cpp tests file clean up
    iii. trivial forwarding supports added in codegen runtime
    iv. added factory methods support in codegen

Commits that's in this PR from the devel branch:

```
7117a7e37e patching nvfuser conv cudnn test numerics mismatch (#2048)
65af1a4e70 Inserting sync for redundant parallel types is already done at the (#2023)
6ac74d1816 Fix sync map (#2047)
f5bca33335 Bank conflict checker improvements (#2032)
d2ca7e3fd2 Minor update on cp.async code generation. (#1901)
d36cf61f55 Test file cleanup (#2040)
0b8e83f49c Allow non-root trivial reductions (#2037)
a2dfe40b27 Fix vectorize size calculation (#2035)
e040676a31 Use withPredicate to replace setPredicate to maintain Exprs immutable (#2025)
197221b847 removing ci workflow (#2034)
40e2703d00 Reduction rand like patch (#2031)
bc772661cb Add utility for checking bank conflict of shared memory (#2029)
ddd1cf7695 Add back FusionReductionWithTrivialReduction_CUDA (#2030)
fbd97e5ef1 Revert "Cleanup trivial reduction workarounds (#2006)" (#2024)
bca20c1dfb Cleanup trivial reduction workarounds (#2006)
e4b65850ee Trivial forwarding (#1995)
1a0e355b50 Fix contiguity analysis of predicates to match updated contiguity. (#1991)
a4effa6a5f Enable output allocation cache (#2010)
35440b7953 Patching bn inference (#2016)
0f9f0b4060 Add matmul benchmark (#2007)
45045cd05e Enable tests previously disabled due to an aliasing bug (#2005)
967aa77d2c Contiguous indexing for View operations (#1990)
a43cb20f48 Make inlining even more modular (#2004)
dc458358c0 Test util cleanup (#2003)
3ca21ebe4d More strict validation (#2000)
a7a7d57331 Fix build problem (#1999)
fc235b064e Just fixes comments (#1998)
482386c050 cleanup (#1997)
4cbe0db655 Improve divisible split detection (#1970)
42ccc52bdc Minor build fix. (#1996)
fcf8c091f7 Cleanup of lower_utils.cpp: Isolate out GpuLower usage (#1989)
15f2f6dba8 Move ConcretizedBroadcastDomains to shared_ptr in GpuLower. (#1988)
8f1c7f5267 Minor cleanup lower_unroll.cpp (#1994)
1d9858c803 Minor cleanup (#1992)
f262d9cab5 Add support for uniform RNG (#1986)
eb1dad10c7 Remove non-const functions, remove GpuLower instance on build, pass in ca_map. (#1987)
634820c5e3 Add support for some empty fusion (#1981)
eabe8d844a Segment self mapping fusions (#1954)
e96aacfd9c Enable Transpose operation (#1882)
425dce2777 Add a null scheduler that helps segmenting away no-op schedules (#1835)
306d4a68f1 Fix canScheduleCompileTime check of transpose scheduler (#1969)
b1bd32cc1b Minor fix (#1967)
bd93578143 Enable transpose scheduler (#1927)
b7a206e93b Move scheduler vectorize utilities into their own file (#1959)
d9420e4ca0 View scheduling (#1928)
c668e13aea Upstream push ci fixes (#1965)
c40202bb40 Fix dump effective bandwidth (#1962)
93505bcbb9 WAR on index mapping when exact and permissive maps differ (#1960)
45e95fd1d3 Allow splitting inner-most ID to create virtual innermost ID in transpose scheduler (#1930)
a3ecb33944 Improve the comments at the beginning of index_compute.h (#1946)
f7bc3417cc Remove unused variables (#1955)
df3393adbb Some cleanup (#1957)
7d1d7c8724 TVDomainGuard factory (#1953)
357ba224c0 Fill allocation with nan on tests (#1956)
8eafc54685 Fix detection of unmappable root domains (#1952)
90a51f2826 Some indexing cleanups, Add eye support (#1940)
ddc01e4e16 Exclude unsupported data types (#1951)
992e17c068 test the groups the same order as they are merged (#1949)
208262b75d Move detection of self mapping IDs to IterDomainGraph from (#1941)
ac4de38c6e Merge pull request #1945 from csarofeen/master_merge_0828
631094891a Add full, full_like, zeros, zeros_like, ones, ones_like (#1943)
aab10bce45 Merge remote-tracking branch 'upstream/viable/strict' into HEAD
4c254c063b Fix arange when step is negative (#1942)
89330aa23a Tensor factories must set the output shape as its input (#1939)
```

RUN_TORCHBENCH: nvfuser

Differential Revision: [D40869846](https://our.internmc.facebook.com/intern/diff/D40869846)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87779
Approved by: https://github.com/davidberard98
2022-11-04 20:04:34 +00:00
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 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
Nikita Shulga 80ea6955af Add cuda-11.3+clang9 build workflow (take 2)
To be able to detect unused captures in GPU code lambdas (as gcc does not support this diagnostic)

Remove unused opts lambda capture in `ProcessGroupMPI.cpp` and `Distributions.cu`

Fix sign-compare in nvfuser benchmark and ignore signed unsigned comparison in nvfuser tests
Fixes https://github.com/pytorch/pytorch/issues/75475 by aliasing CMAKE_CUDA_HOST_COMPILER to C_COMPILER when clang is used
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75293
Approved by: https://github.com/atalman, https://github.com/seemethere
2022-04-11 17:13:01 +00:00
PyTorch MergeBot 8fe43d76d5 Revert "Add cuda-11.3+clang9 build workflow"
This reverts commit 709fcc862e.

Reverted https://github.com/pytorch/pytorch/pull/75293 on behalf of https://github.com/janeyx99
2022-04-11 15:24:59 +00:00
Nikita Shulga 709fcc862e Add cuda-11.3+clang9 build workflow
To be able to detect unused captures in GPU code lambdas (as gcc does not support this diagnostic)

Remove unused opts lambda capture in `ProcessGroupMPI.cpp` and `Distributions.cu`

Fix sign-compare in nvfuser benchmark and ignore signed unsigned comparison in nvfuser tests
Fixes https://github.com/pytorch/pytorch/issues/75475 by aliasing CMAKE_CUDA_HOST_COMPILER to C_COMPILER when clang is used
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75293
Approved by: https://github.com/atalman, https://github.com/seemethere
2022-04-11 14:10:57 +00:00
jjsjann123 873ced7cd0 Nvfuser code bump 030122 (#73627)
Summary:
Things changed in this PR that requires review:

test/forward_backward_compatibility/check_forward_backward_compatibility.py

Our previous function overload extension names were wrong and has been updated in this PR, hence the compatibility list updated.

nvfuser code updates with bug fixes towards failures we encountered in OpInfoTests as well as failures reported by AOTAutograd team.

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

Reviewed By: Chillee

Differential Revision: D34765458

Pulled By: davidberard98

fbshipit-source-id: c81f3d6a1b723fb3a8ba419b7f82227f70440ca7
(cherry picked from commit b6a2c362c3)
2022-03-31 08:18:22 +00:00
jiej 2d110d514f Nvfuser code bump 2_1_2022 (#72127)
Summary:
Things changed in this PR that requires review:
1. aten/src/ATen/core/interned_strings.h
2. torch/csrc/jit/ir/alias_analysis.h : exposing createValue to allow efficient mutation
3. torch/csrc/jit/runtime/symbolic_shape_registry.cpp : added gelu/tanh/erf in registry
4. torch/jit/_script.py : throws scripting model sees autocast as decorator since it's not supported

nvfuser code update:
1. codegen improvements and performance tuning
2. integration bug fixes for shape expression logic
3. kernel segmentation update to address perf regression from horizontal fusion
4. scalar cpu tensor promotion to support inter-device operation between cpu scalar tensor and cuda tensor

Things reverted from local changes:
aten::gelu with approximation (tracked in PR: https://github.com/pytorch/pytorch/pull/61439)

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

Reviewed By: HamidShojanazeri

Differential Revision: D34113233

Pulled By: jbschlosser

fbshipit-source-id: b82cde32b71e324eca0ea57cb8c9f9647278ca74
(cherry picked from commit e009bc5c4e)
2022-02-15 00:43:16 +00:00
CodemodService FBSourceClangFormatLinterBot 143491e0ad [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D32484422

fbshipit-source-id: 5c836dc7d06f12e64cc4bb1e85d8fa4b62a29b85
2021-11-17 07:27:04 -08: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