-
Notifications
You must be signed in to change notification settings - Fork 487
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
[Fori_loop|While_loop] Enable fori_loop with add/sub test case #6603
Merged
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
4604027
Update test_fori_loop_with_while_loop_simple_add_dispatch_in_torch.py
ManfeiBai 325341b
Update xla_builder.py
ManfeiBai 021fb49
Update xla_op_registry.py
ManfeiBai ec7b536
Update helpers.cpp
ManfeiBai 40056a7
Update init_python_bindings.cpp
ManfeiBai a4d2b58
Update lowering_context.cpp
ManfeiBai 8955e82
Update lowering_context.h
ManfeiBai cfd1118
Update tensor_methods.cpp
ManfeiBai 6362c07
Update fori_loop.py
ManfeiBai 3436610
clean xla_builder.py
ManfeiBai 70592ad
Update xla_op_registry.py
ManfeiBai c299607
clean helpers.cpp
ManfeiBai 43988b6
Update init_python_bindings.cpp
ManfeiBai 5d80975
clean lowering_context.cpp
ManfeiBai 09eac90
clean lowering_context.h
ManfeiBai 9a72283
clean tensor_methods.cpp
ManfeiBai f3b987f
Update fori_loop.py
ManfeiBai 6e6ebcd
Update tensor_methods.cpp
ManfeiBai 5a0ea18
Update init_python_bindings.cpp
ManfeiBai c1b7c7a
Update lowering_context.cpp
ManfeiBai 7cc755e
format
ManfeiBai 6470ec4
format
ManfeiBai 2cbead2
format
ManfeiBai b05bf08
try torch func in simple case
ManfeiBai 955e658
Update init_python_bindings.cpp
ManfeiBai c568fa2
format
ManfeiBai 1ae51f0
update to clean code
ManfeiBai 6e3457f
wrap in new func
ManfeiBai 0eb1aa4
check for test
ManfeiBai a7621d8
check for test bring back
ManfeiBai 19e977b
Update init_python_bindings.cpp
ManfeiBai 17d2100
Update init_python_bindings.cpp
ManfeiBai 477cdb2
Update fori_loop.py
ManfeiBai acd0caf
Update fori_loop.py
ManfeiBai ed7aa1c
Update init_python_bindings.cpp
ManfeiBai f996c4c
Update init_python_bindings.cpp
ManfeiBai 35878ec
Update fori_loop.py
ManfeiBai abe3067
remove mark_step
ManfeiBai 56f5cb0
Update lowering_context.cpp
ManfeiBai b5714f7
Update lowering_context.h
ManfeiBai e7fa408
Update init_python_bindings.cpp
ManfeiBai 66402ef
Update lowering_context.cpp
ManfeiBai 6b1a570
Update lowering_context.h
ManfeiBai 40d39fa
Update lowering_context.h
ManfeiBai 93638c2
Update fori_loop.py
ManfeiBai 28a3dd7
Update fori_loop.py
ManfeiBai e014c1d
refactor logic of check while_loop
ManfeiBai 4e6f076
update comment
ManfeiBai dafa8fb
format
ManfeiBai 1b952cb
format
ManfeiBai 8ec55c3
format
ManfeiBai aeb0a58
add test case
ManfeiBai 02bf5ba
add test case
ManfeiBai d51e069
add test case
ManfeiBai 5f3af2b
Update test_fori_loop_with_while_loop_simple_add_dispatch_in_torch.py
ManfeiBai cb26670
test case for add and sub
ManfeiBai f37149b
format
ManfeiBai a48a3cf
format
ManfeiBai f30eaab
wrap test situation check
ManfeiBai 1633d8e
wrap test situation check
ManfeiBai 8a3b9fe
wrap test situation check
ManfeiBai f6fdc78
format
ManfeiBai 5c2a2a0
Update test_fori_loop_with_while_loop_simple_add_dispatch_in_torch.py
ManfeiBai 173ff44
nit
ManfeiBai 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,7 +154,13 @@ void LoweringContext::SetResult(size_t index, xla::XlaOp op) { | |
|
||
xla::StatusOr<xla::XlaComputation> LoweringContext::BuildXla() { | ||
xla::StatusOr<xla::XlaComputation> xla; | ||
if (!root_tuple_.empty()) { | ||
|
||
// check whether build for cond/body computation or not, and skip Tuple step | ||
// if yes | ||
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. untuple result of body_fn&cond_fn for xla::while op |
||
if (!root_tuple_.empty() & (root_tuple_.size() == 1) & | ||
((get_name_string() == "condctx") or (get_name_string() == "bodyctx"))) { | ||
xla = builder()->Build(root_tuple_.at(0)); | ||
} else if (!root_tuple_.empty()) { | ||
xla::XlaOp root = xla::Tuple(builder(), root_tuple_); | ||
xla = builder()->Build(root); | ||
} else { | ||
|
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
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.
Good, thanks!