Commit 6e2e7d4
A skeleton implmentation for the expression, IR and visitor dispatchers. (pytorch#33)
To run the test: cmake . && make cpptest && ./expr_test
Refactor the RefHandle class. (pytorch#34)
Add convenience operator for Expr.
clang-format change (pytorch#35)
Adding Var, Let and eval_context support. (pytorch#36)
Add LLVM JIT class for online codegen
Refactor llvm codegen
fix caps of LlvmJit
Generate code for integer arithmetic
Test all arithmetic ops with LLVM
Fix rtti
Compat with llvm 7 and 8
Add support for tensor expressions. (pytorch#38)
Add Casting support so mixed dtypes are supported.
Add basic dtype and logging support. This should be merged with PyTorch during integration.
clang-format fix (pytorch#39)
Extend dtypes to support vector types (pytorch#40)
Support LLVM 9 too
Disambigate dependent type name with template keyword
Remove empty scalar.h
Add basic support for statements. (pytorch#41)
Add support for For, Ramp, Block, Load, Store and Broadcast.
Add support for Buffer.
Adding Stmt evaluation support. (pytorch#42)
Use third_party/googletest from pytorch
Remove nnc/tests/googletest submodule
Move nnc tld to torch/csrc/jit/compiler
Add a README (probably temporary) for jit/compiler
Move from namespace nnc to torch::jit::compiler
Refactor JIT class to isolate no-rtti pieces
Adding comparison operator to Var. (pytorch#43)
Fix typo in README.md
Use absolute imports and pragma once
Use absolute includes in new llvm_jit.h
Build non-LLVM compiler stuff with libtorch
Minimal asmjit codegen from the tensor IR
fix pessimizing moves
IR printer
fix printer bug
Add printer to build system.
Add data structure for schedule support and Split.
clang-format using the new template
Add IRMutator and basic support to substitude Var in Expr and Stmts.
Change the default count of RefCounted as zero.
Merge Expr(node) and Expr::make(node).
Add basic lowering to the tensor expression trees.
fix the schedule_test
fixed lowering
LLVM code generation for simple loops
bugfixes
refcount fixing self-assignment
Make LOG(FATAL) nonreturn
Enable Werror
Adding statement conversion for SplitWithTail
Add a reference tests for Split
clang-format
A functinoal reference chck for schedule tests.
clang-format
Add support for Float immediates.
Get absolute path for ASMJIT_DIR (pytorch#24)
Silence deprecation warnings from LLVM
Include legacy PassManager for debug printing
Set code model to medium to avoid indirect jumps in generated asm
Fix argument type of input float buffers
Add support for Casts in LLVM codegen.
Add a complete tensor+lower+llvm test
Enable the failing test
Enable export of compile_commands.json.
Floating point arithmetic
Test fp32 mul using compute expr
Broadcast add test using compute expr
Update to LLVM 9
Implementation of Broadcast for LLVM.
Add Buffer operator() overload, and some other minor features
Cleanup use of ConstantInt API.
fix accidental experimental changes
Change the Compute interface to bring the dim sizes and names together
clang-format
refactor Buffer into its own files
Add support for vector casts in LLVM CodeGen
Implement masked loads and stores.
Implement vector masked loads and stores.
Add a PaddedBuffer test util
Improve the user interface for SimpleIREvaluator
Add a test for Block codegen.
Fix gtest include path
clang-format
Add expressions and support for Max and Min. (pytorch#5)
Rename compiler to tensorexpr and move files around to be more similar to other pytorch parts. (pytorch#6)
Summary:
1. Move compiler to tensorexpr folder
2. Move files from src and include to the same folder (and remove src and include folders)
3. Rename .cc to .cpp
Add missing include <math.h> (pytorch#7)
Change isnan to std::isnan. It breaks my clang builds. (pytorch#8)
Change the SimpleIREvaluator frontend (pytorch#9)
Add RefHandle for subclass
Make LLVM dependency optional. (pytorch#10)
[wip] Basic fuser pass to select texpr subgraphs
Revert "[wip] Basic fuser pass to select texpr subgraphs"
This reverts commit a9d9919.
Revert changes to the main pytorch CMakeLists.txt (for now).
Add a test for aten::_cast_Float lowering. (pytorch#12)
Hook tensorexp up to the main build, and switch to c10 logging
More ATen op tests. (pytorch#16)
Fix some missing returns
Include tests back to the 'all' target. (pytorch#14)
Even more ATen op tests. (pytorch#18)
Test for relu ATen op. (pytorch#19)
Add intrinsics function support. (pytorch#20)
Remove fmax/fmin, as they are already covered by the Max/Min operators (pytorch#21)
refactor CallNode and BaseCallNode, so we can have a common concrete base class for visitors. (pytorch#22)
This is the first step to add other call types.
Add FunctionCall to use existing tensors (pytorch#23)
Add the ability to use an existing tensor expression in other compute functions. (pytorch#24)
fixing broken compilation on mac/clang
adding IRnode for Compare-Select Ops and their LLVM Codegen
Fix Werror. (pytorch#26)
Add tests for some transcendental ops. (pytorch#27)
Add Allocate and Free support. (pytorch#29)
Add Eval and test basic alloc support.
Add Lowering support for buffer allocation for intermediate tensors.
Tensor expr fuser pass for extremely simple expressions
Make fusion work for arbitrary buffer/tensor combinations of inputs (pytorch#30)
fix Let02 test
Access inputs and intermediates uniformly through Tensors (pytorch#31)
fix Let02 test (pytorch#32)
adding LLVM Codegen for Let
modifying CMakeLists.txt to enable ninja test && minor update for LLVM Codegen for Let (handling XQ's comment)
Adding ComputeInline support. (pytorch#35)
Fix broken tests (pytorch#36)
Make tx fuser work with arbitrary ranks
[fuser] Broadcast args
Improve naming of arg broadcasting function
Test cases for tensorexpr fusion (pytorch#37)
CompareSelct Op: Addressing XQ and Owen's comments
modifying CMakeLists.txt to enable ninja test && minor update for LLVM Codegen for Let (handling XQ's comment)
CompareSelct Op: Addressing XQ and Owen's comments
Sketch sufficient support for constants to get constant alpha working. (pytorch#40)
* Refactor to use a switch statement over Node kinds.
* Sketch sufficient support for constants to get constant alpha working.
Fix indices when inlining non-leaf calls (pytorch#39)
Fixing the inline ordering issue (pytorch#43)
Solve more problems with the inliner
Avoid creating redundant and/or improperly ordered Constant's in fused subgraphs. (pytorch#42)
Move fuser-styled tests to schedule_test (pytorch#44)
Add aten::sub to the new fuser. (pytorch#46)
Refactor CodeGen from SimpleIREval (pytorch#47)
Inline all the things (pytorch#45)
clang-format for atent_test.cpp
Eliminate a ton of warnings for my own sanity. (pytorch#48)
Add support for type promotion/demotion. (pytorch#50)
Flesh out new fuser coverage to several more ops. (pytorch#51)
Adding the first basic CudaCodeGen. (pytorch#52)
aten tests for eq, ge, gt, le, lt
support for aten ops: eq
support for more aten ops: ge, gt, le, lt, ne
Minimal CMake change to link LLVM to libtorch
Fix issues causing assertion failures in llvm debug builds
Fatal on unimplement llvm codegen ops (Allocate, etc.)
Optionally compile tx fuser kernels with llvm
Test for 2D broadcasted with large dims to show vectorization
Updated isSupported for increased op coverage. (pytorch#54)
Refactor LLVMCodeGen to compile kernel in constructor
Cmake integration to PT codebase (pytorch#28)
With this change our code blends with the usual PyTorch code and is built the usual way. I added a cmake option to specify where to look for LLVM, if it's not specified, LLVM is not used.
An example of invocation (from the root of pytorch repo):
```
USE_LLVM=/path/to/llvm9/install python setup.py develop
```
This command will build libtorch.{a,so} and other libraries, and tensorexpr code will be a part of it.
The tests will be built in build/bin/test_tensorexpr (I've ported only one test so far). So, invocation of the tests will be:
```
build/bin/test_tensorexpr
```
Remove old padded_buffer.{cpp,h}. (pytorch#56)
Add support for code generation of Log10 intrinsics with LLVM. (pytorch#57)
Remove tests/test_utils.h: inline what's still used and nuke what's unused. (pytorch#58)
Move Fuser tests (tests/tests.py) to test/test_tensorexpr.py. (pytorch#59)
Remove old CMakeLists and README.txt
Add support for vectorized and unmasked loads and stores with LLVM. (pytorch#62)
Enable CodeGen-level optimizations in LLVM. (pytorch#63)
Add Bind/GPUBlock/GPUThread support. (pytorch#64)
Bind/run interface to CodeGen (pytorch#60)
* Bind/run interface to CodeGen
* Make LLVMCodeGen implement CodeGen interface
* Allow bind/run to be unimplemented for the moment (CUDA)
* Cache compilation result
* Two nasty bugs: forgot virtual dtor, forgot to clear bindings after run()
Fix ambiguity in CreateExtractElementCall (0ull can be a Value*, I guess?) (pytorch#65)
Allow constants as lhs/rhs args (not just alpha) (pytorch#66)
Use correct tensor type for fuser output (pytorch#67)
clang-format
Rename 'compiler' namespace to 'tensorexpr'.
Include all built llvm targets (pytorch#68)
Switch back to linking only the native LLVM target. (pytorch#69)
Virtual dtors for IRVisitor/IRMutator (pytorch#70)
Add semicolon to make nvcc compile (pytorch#71)
Enable NVRTC for the GPU backend. (pytorch#74)
Fix non-CUDA testing. (pytorch#75)
Getting fused (a)Sin(h), (a)Cos(h),(a) Tan(h), abs working with the interpreter (pytorch#73)
* Getting fused (a)Sin(h), (a)Cos(h),(a) Tan(h), abs working with the interpreter
* take the interpreter path only when ENABLE_LLVM is not set
remove the leak tests, as we will get rid of refcounting (pytorch#76)
Implement aten::min, max, and clamp (pytorch#72)
* Implement aten::min, max, and clamp
* Propagate NaNs like std::max/min
* Change NaN propagation in interpreter too
clang-format tensorexpr/tests.h (pytorch#77)
Refactor UniqueNameManager into its own files. (pytorch#79)
refactor cuda_codegen (pytorch#80)
simplify nvrtc major, minor versions (pytorch#81)
Allow CodeGen to take Var args (interpreter support only) (pytorch#78)
* Test demonstrating dynamic shape
* Allow binding of Vars to args in interpreter
* Pass BufferArgs to LLVMCodeGen
* clang-format-diff
[LLVMCodeGen] Refactor kernel constructor to be less sprawling (pytorch#82)
* Member TM to TM_ in LLVMCodeGen
* [LLVMCodeGen] Add helper for getContext
* [LLVMCodeGen] Refactor type support
* [LLVMCodeGen] Refactor kernel emission1 parent 61a2b34 commit 6e2e7d4
File tree
56 files changed
+11599
-1
lines changed- caffe2
- test
- cpp/tensorexpr
- tools
- torch/csrc/jit
- passes
- tensorexpr
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+11599
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
| |||
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
464 | 479 | | |
465 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
466 | 497 | | |
467 | 498 | | |
468 | 499 | | |
| |||
525 | 556 | | |
526 | 557 | | |
527 | 558 | | |
528 | | - | |
529 | 559 | | |
530 | 560 | | |
531 | 561 | | |
| 562 | + | |
| 563 | + | |
532 | 564 | | |
533 | 565 | | |
534 | 566 | | |
| |||
626 | 658 | | |
627 | 659 | | |
628 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
629 | 668 | | |
630 | 669 | | |
631 | 670 | | |
| |||
759 | 798 | | |
760 | 799 | | |
761 | 800 | | |
| 801 | + | |
762 | 802 | | |
763 | 803 | | |
764 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
0 commit comments