pytorch/test/cpp
Nick Gibson 76ff557de7 [NNC] add hazard analysis to Bounds Inference (#47684)
Summary:
Adds a helper function to Bounds Inference / Memory Analaysis infrastructure which returns the kind of hazard found between two Stmts (e.g. Blocks or Loops). E.g.
```
for (int i = 0; i < 10; ++i) {
  A[x] = i * 2;
}
for (int j = 0; j < 10; ++j) {
 B[x] = A[x] / 2;
}
```
The two loops have a `ReadAfterWrite` hazard, while in this example:
```
for (int i = 0; i < 10; ++i) {
  A[x] = i * 2;
}
for (int j = 0; j < 10; ++j) {
 A[x] = B[x] / 2;
}
```
The loops have a `WriteAfterWrite` hazard.

This isn't 100% of what we need for loop fusion, for example we don't check the strides of the loop to see if they match.

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

Reviewed By: malfet

Differential Revision: D24873587

Pulled By: nickgg

fbshipit-source-id: 991149e5942e769612298ada855687469a219d62
2020-11-12 11:34:31 -08:00
..
api Add input argument to autograd.backward() cpp api (#47214) 2020-11-04 14:43:59 -08:00
common
dist_autograd Fix Windows build failure after DDP PR merged (#45335) 2020-09-25 12:37:50 -07:00
jit [TorchBind] Support using lambda function as TorchBind constructor (#47819) 2020-11-12 09:29:34 -08:00
rpc [c10d] switch ProcessGroup to be managed by intrusive_ptr (#47343) 2020-11-12 07:36:23 -08:00
tensorexpr [NNC] add hazard analysis to Bounds Inference (#47684) 2020-11-12 11:34:31 -08:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00