forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the work to add a new expr: unify the structure of exprs #2190
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
c0a5864
save structured expr
zasdfgbnm ee0f43a
save ExprType change
zasdfgbnm b7aedbd
revert
zasdfgbnm 6149751
Merge branch 'devel' of github.com:csarofeen/pytorch into no-expr-type
zasdfgbnm 77be1f4
more
zasdfgbnm cd8817c
one of
zasdfgbnm 0ae70ab
std::type_index
zasdfgbnm 1f9cb3b
more
zasdfgbnm cdee6d0
more
zasdfgbnm 8304b84
more
zasdfgbnm 1e66082
fix
zasdfgbnm 31e61e3
fix reduction
zasdfgbnm 7d5b4f7
isStrictlyOneOf
zasdfgbnm 895b6f0
fix
zasdfgbnm 79017b8
fix
zasdfgbnm 20b5394
fix
zasdfgbnm de37d06
Merge branch 'devel' of github.com:csarofeen/pytorch into structured-…
zasdfgbnm e4e235a
Revert "save structured expr"
zasdfgbnm f8fccd0
Merge branch 'no-expr-type' of github.com:csarofeen/pytorch into stru…
zasdfgbnm 31fc54b
FullOp compiles
zasdfgbnm 0da63b0
ARangeOp
zasdfgbnm 9e57950
TernaryOpType
zasdfgbnm 3fb5d26
RNGOp
zasdfgbnm 73db1ea
BroadcastOp SqueezeOp
zasdfgbnm 1b2bc68
ReductionOp
zasdfgbnm f0e4e75
grouped reduction, welford, grouped welford
zasdfgbnm d7eb2de
runtime time
zasdfgbnm 4afea44
mma transpose expand
zasdfgbnm 00cc231
shift
zasdfgbnm 77f3edf
fixes
zasdfgbnm 2d14b4d
fix
zasdfgbnm 586b29c
add clone
zasdfgbnm 56f2249
Merge branch 'devel' of github.com:csarofeen/pytorch into structured-…
zasdfgbnm 2baafe3
fix
zasdfgbnm 64bd0d8
gather, view as scalar, view, load store
zasdfgbnm 242228e
DEFINE_CLONE
zasdfgbnm 393fa52
Allocate
zasdfgbnm e3f27a2
ForLoop
zasdfgbnm f72d6b6
fix
zasdfgbnm 4338807
GroupedGridReduction
zasdfgbnm 412420b
GridWelford
zasdfgbnm c7b860e
all expr done
zasdfgbnm bfdb742
fix
zasdfgbnm 36ada0e
cleanup
zasdfgbnm 56b03ee
rewrite IrCloner
zasdfgbnm c80587c
rename
zasdfgbnm 522bfdf
Merge branch 'devel' of github.com:csarofeen/pytorch into structured-…
zasdfgbnm 9bd3bc4
save
zasdfgbnm 0987844
fix
zasdfgbnm c23ea6c
save
zasdfgbnm 0971dfe
save
zasdfgbnm 6fd6504
Statement attributes_
zasdfgbnm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,75 +11,6 @@ namespace jit { | |
namespace fuser { | ||
namespace cuda { | ||
|
||
//! Clone an IR node, forwarding the arguments to the IrCloner constructor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved to header file |
||
template <class T> | ||
T* IrBuilder::clone(const T* src, IrCloner* ir_cloner) { | ||
TORCH_INTERNAL_ASSERT( | ||
ir_cloner != nullptr, | ||
"Cannot use create when a cloner object is set. Use clone."); | ||
|
||
TORCH_INTERNAL_ASSERT( | ||
ir_cloner->container() != nullptr, | ||
"Cloner doesn't have a valid container to store cloned object."); | ||
|
||
T* dest = new T(src, ir_cloner); | ||
const Statement* src_stmt = dynamic_cast<const Statement*>(src); | ||
Statement* dest_stmt = dynamic_cast<Statement*>(dest); | ||
|
||
auto dest_container = ir_cloner->container(); | ||
auto src_container = src_stmt->container(); | ||
|
||
dest_container->registerStmt(IrBuilderPasskey(dest_container), dest_stmt); | ||
|
||
if (src_container != dest_container) { | ||
dest_stmt->setName(IrBuilderPasskey(dest_container), src_stmt->name()); | ||
} | ||
|
||
ir_cloner->registerClone(src_stmt, dest_stmt); | ||
|
||
return dest; | ||
} | ||
|
||
#define IR_BUILDER_INSTANTIATE(T) \ | ||
template T* IrBuilder::clone(const T* src, IrCloner* ir_cloner); | ||
|
||
// Vals | ||
IR_BUILDER_INSTANTIATE(IterDomain) | ||
IR_BUILDER_INSTANTIATE(TensorDomain) | ||
IR_BUILDER_INSTANTIATE(TensorView) | ||
IR_BUILDER_INSTANTIATE(Bool) | ||
IR_BUILDER_INSTANTIATE(Float) | ||
IR_BUILDER_INSTANTIATE(Double) | ||
IR_BUILDER_INSTANTIATE(Int) | ||
IR_BUILDER_INSTANTIATE(ComplexDouble) | ||
IR_BUILDER_INSTANTIATE(NamedScalar) | ||
|
||
// Exprs | ||
IR_BUILDER_INSTANTIATE(Split) | ||
IR_BUILDER_INSTANTIATE(Merge) | ||
IR_BUILDER_INSTANTIATE(Swizzle2D) | ||
IR_BUILDER_INSTANTIATE(TransposeOp) | ||
IR_BUILDER_INSTANTIATE(ExpandOp) | ||
IR_BUILDER_INSTANTIATE(ShiftOp) | ||
IR_BUILDER_INSTANTIATE(GatherOp) | ||
IR_BUILDER_INSTANTIATE(ViewAsScalar) | ||
IR_BUILDER_INSTANTIATE(ViewOp) | ||
IR_BUILDER_INSTANTIATE(FullOp) | ||
IR_BUILDER_INSTANTIATE(ARangeOp) | ||
IR_BUILDER_INSTANTIATE(EyeOp) | ||
IR_BUILDER_INSTANTIATE(UnaryOp) | ||
IR_BUILDER_INSTANTIATE(BinaryOp) | ||
IR_BUILDER_INSTANTIATE(TernaryOp) | ||
IR_BUILDER_INSTANTIATE(SelectOp) | ||
IR_BUILDER_INSTANTIATE(RNGOp) | ||
IR_BUILDER_INSTANTIATE(ReductionOp) | ||
IR_BUILDER_INSTANTIATE(GroupedReductionOp) | ||
IR_BUILDER_INSTANTIATE(WelfordOp) | ||
IR_BUILDER_INSTANTIATE(LoadStoreOp) | ||
IR_BUILDER_INSTANTIATE(MmaOp) | ||
IR_BUILDER_INSTANTIATE(BroadcastOp) | ||
IR_BUILDER_INSTANTIATE(SqueezeOp) | ||
|
||
Val* IrBuilder::newResult(DataType dtype) { | ||
switch (dtype) { | ||
case DataType::Bool: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method now is not even virtual