[Fori_loop|While_loop] Enable while_loop/fori_loop, Add linear/MNIST test case#7094
Closed
ManfeiBai wants to merge 383 commits intopytorch:masterfrom
Closed
[Fori_loop|While_loop] Enable while_loop/fori_loop, Add linear/MNIST test case#7094ManfeiBai wants to merge 383 commits intopytorch:masterfrom
ManfeiBai wants to merge 383 commits intopytorch:masterfrom
Conversation
JackCaoG
reviewed
May 22, 2024
| l_in_0 = torch.randn(bs, 1, 28, 28, dtype=torch.float32, device=device) | ||
| l_out = torch.randn(bs, 10, dtype=torch.float32, device=device) | ||
| iteri = torch.tensor(3, dtype=torch.int64, device=device) | ||
| _, _, res = mnist(iteri, l_in_0, l_out) |
Collaborator
There was a problem hiding this comment.
can we init the l_out inside the mnist forward and returns it? This way the only additional output we provide is the count.
Collaborator
Author
There was a problem hiding this comment.
thanks, good idea, due to hard to gain result before finish one run, so current plan would be:
run body_fn with pure python while, get result, then use this result as l_out
before implementation, did quick benchmark for this idea with code:
- iteri = 3:
while_loop(3.675 s), pure while(3.107 s), pure_while_then_while_loop_plan(3.724 s)
- iteri = 10:
while_loop(3.670s), pure while(3.119s), pure_while_then_while_loop_plan(3.932s)
- iteri = 10:
while_loop(3.744 s), pure while(3.110 s), pure_while_then_while_loop_plan(3.749 s)
- iteri = 10:
while_loop(3.878 s), pure while(7.053 s), pure_while_then_while_loop_plan(3.809 s)
so this plan looks like worth to try
JackCaoG
requested changes
May 29, 2024
Collaborator
JackCaoG
left a comment
There was a problem hiding this comment.
only review the test part, left some comments
f3e0200 to
7699d56
Compare
This was referenced May 30, 2024
This was referenced May 30, 2024
Closed
Collaborator
|
@ManfeiBai give me a ping when CI is green |
617d3b2 to
5cf7c9c
Compare
Collaborator
Author
|
fork PR failed, track in #7157 |
Collaborator
Author
|
thanks for review and comments, since CI failed to start, track test result in #7157 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.