Commit Graph

16 Commits

Author SHA1 Message Date
Xiaoqiang Zheng
5e504e83e8 Add sync-point insertions and block/thread local memory allocations (#36563)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36563

Test Plan: Imported from OSS

Differential Revision: D21014238

Pulled By: zheng-xq

fbshipit-source-id: 4d61ff2f76345ea2825f2d5f60a771f65b24ad69
2020-04-20 18:52:30 -07:00
Xiaoqiang Zheng
32bbf12aa7 Make trivial thread-idx for degenerate statements without thread-idx. (#36480)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36480

Test Plan: Imported from OSS

Differential Revision: D20992505

Pulled By: zheng-xq

fbshipit-source-id: 3d4e5401b59b9507b5f2db659e511bd1af53f5ab
2020-04-17 02:31:07 -07:00
Nikita Shulga
6bd6b70a02 Fix clang-format (#36685)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36685

Differential Revision: D21052657

Pulled By: malfet

fbshipit-source-id: b4ec7eba21864108a1108f8c83b5d33cf31ab89e
2020-04-15 17:02:20 -07:00
Xiaoqiang Zheng
dad25ae47d Add the one-block multi-thread global reduction support. (#36306)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36306

Missing __syncthreads between sections.

Differential Revision: D20957254

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Pulled By: zheng-xq

fbshipit-source-id: c988f0205b667174b3ee851c28adeec2dbd089f7
2020-04-15 13:05:11 -07:00
Xiaoqiang Zheng
e80813fae3 Add trivial reduce for Cuda (#36293)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36293

Detect non-read-only loads, and not to use __ldg.
Resubmiting #36092

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D20935933

Pulled By: zheng-xq

fbshipit-source-id: f9280db26aa9c9c8119cea12571bc820f5fbcb61
2020-04-15 13:03:58 -07:00
Mike Ruberry
3570ef6a0f Revert D20876204: [pytorch][PR] Add trivial reduce for Cuda
Test Plan: revert-hammer

Differential Revision:
D20876204

Original commit changeset: a719f3583cc4

fbshipit-source-id: 6d00afb3a24754d283a7b832c0b784ed9fce36e1
2020-04-06 20:17:04 -07:00
Xiaoqiang Zheng
a81be33a4e Add trivial reduce for Cuda (#36092)
Summary:
Detect non-read-only loads, and not to use __ldg.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36092

Reviewed By: ZolotukhinM

Differential Revision: D20876204

Pulled By: zheng-xq

fbshipit-source-id: a719f3583cc4ca30fcfb49d999ca785181354d84
2020-04-06 17:58:50 -07:00
Mikhail Zolotukhin
3ef5ff6012 [TensorExpr] Make Load and Store multi-dimensional. (#35800)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35800

This PR includes the following changes:
* Introduce a new `Expr` type `Buf`: it plays a similar to `Var` role, but also has dimensions.
* Use the new `Buf` class in `Store` and `Load` instead of `Var` for specifying where to store to or load from. `Buf` contains the dimensions info of the buffer we're loading/storing to and hence we are able to keep N-d indexes without flattening them into a 1-d index ([x,y] vs [x+y*W]).
* Flattening of the indexes is now a separate pass that is executed in `LoopNest::prepareForCodegen` - backends still expect indexes to be flattened, and this PR preserves that.
* `Tensor` now contains a `Buf` instead of `Var`, and thus Tensor now has the dimensions info (previously it was a property of a `Function`, not a `Tensor`). This brings us closer to Tensor being a combination of Buffer + Function, where Buffer specifies iteration domain and the Function defines a computation.

TODOs:
* Consider merging `Buffer` with `Buf` or `BufHandle`. It seems that we don't need all of them.
* Harden the logic of how we create buffers in fuser pass. Currently it seems that sometimes we don't set dimensions.
* Use `Buf` in `Allocate` and `Free`.
* Make it clearer that `Function` doesn't "own" dimensions info and that dimensions are a property of a Tensor, not a Function.

Differential Revision: D20789005

Test Plan: Imported from OSS

Reviewed By: zheng-xq

Pulled By: ZolotukhinM

fbshipit-source-id: e04188d1d297f195f1c46669c614557d6bb6cde4
2020-04-02 11:18:28 -07:00
Nikolay Korovaiko
9e22d15f14 Enable tensorexpr cpp tests in CI. try #2 (#35454)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35454

Differential Revision: D20665160

Pulled By: Krovatkin

fbshipit-source-id: e04cbe92b2ee5a3288f3c4e5c83533bfea85bf85
2020-03-27 12:09:55 -07:00
Suraj Menon
aa01a95c6d Revert D20630760: [pytorch][PR] Enable NNC tests vol. i. add test_tensorexpr.py tests [WIP]
Test Plan: revert-hammer

Differential Revision:
D20630760

Original commit changeset: 7d2f27aca6b1

fbshipit-source-id: 28ac92b3390651a4a67061d6ebf208515b9b9463
2020-03-25 20:34:46 -07:00
Nikolay Korovaiko
f3a5081bd4 Enable NNC tests vol. i. add test_tensorexpr.py tests [WIP] (#34897)
Summary:
This  PR add tensorexpr cpp tests to test_jit.py
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34897

Differential Revision: D20630760

Pulled By: Krovatkin

fbshipit-source-id: 7d2f27aca6b1e23e3ffed1c765d8f590688118e3
2020-03-25 17:23:48 -07:00
Mikhail Zolotukhin
ceb4ed3733 [TensorExpr] Methods name cleanup in LoopNest class. (#35174)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35174

Differential Revision: D20585575

Test Plan: Imported from OSS

Pulled By: ZolotukhinM

fbshipit-source-id: 0fa8e1e85e1502b9a86cf34608cb791ffb23d395
2020-03-25 11:51:11 -07:00
Mikhail Zolotukhin
95ad94c75b [TensorExpr] Nuke tensorexpr::schedule namespace. (#35126)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35126

Test Plan: Imported from OSS

Differential Revision: D20569364

Pulled By: ZolotukhinM

fbshipit-source-id: c0d51ecadf411918641cdbdc6d8cb06e207d2c9b
2020-03-20 23:39:14 -07:00
Mikhail Zolotukhin
65cea95777 [TensorExpr] Rename schedule.{cpp,h} to loopnest.{cpp,h}. (#35119)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35119

Differential Revision: D20567927

Test Plan: Imported from OSS

Pulled By: ZolotukhinM

fbshipit-source-id: 1fb6d03bd4c6e66aca62140d2b537692577f261d
2020-03-20 23:37:51 -07:00
Mikhail Zolotukhin
95833a49e6 [TensorExpr] Pull changes from bertmaher/pytorch_fusion. (#34842)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34842

This PR (hopefully the last one of such kind) is merging changes from a
side branch where tensor expessions based fuser work has been done so
far. This PR is is a squashed version of changes in the side branch,
which is available here: https://github.com/bertmaher/pytorch

Differential Revision: D20478208

Test Plan: Imported from OSS

Pulled By: ZolotukhinM

fbshipit-source-id: 21556e009f1fd88099944732edba72ac40e9b9c0
2020-03-17 11:02:48 -07:00
Mikhail Zolotukhin
35e7efeb9a [TensorExpr] Add CUDA codegen. (#34227)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34227

This PR adds a CUDA support to tensor expressions.

Differential Revision: D20251836

Test Plan: Imported from OSS

Pulled By: ZolotukhinM

fbshipit-source-id: ab36a55834cceff30c8371fef6cca1054a32f017
2020-03-16 11:49:29 -07:00