Skip to content

[Fori_loop|While_loop] Enable while_loop/fori_loop, add test case#7157

Merged
ManfeiBai merged 64 commits intomasterfrom
ManfeiBai-patch-87
Jun 18, 2024
Merged

[Fori_loop|While_loop] Enable while_loop/fori_loop, add test case#7157
ManfeiBai merged 64 commits intomasterfrom
ManfeiBai-patch-87

Conversation

@ManfeiBai
Copy link
Copy Markdown
Collaborator

@ManfeiBai ManfeiBai commented May 30, 2024

  • Modify BuildForiLoop for while_loop/fori_loop to meet requirement of xla::While:
    • cond return pred[];
    • body return one element;
    • cond's input, body's input/output and init should be the same shape/type/order;
  • Modify test code for while_loop/fori_loop with simple version
  • Add linear_layer_model and MNIST_model test case
  • Modify fori_loop to use _xla_while_loop with fake tensor inputs to fix miss part of inputs situation

@ManfeiBai ManfeiBai marked this pull request as ready for review May 31, 2024 21:59
@ManfeiBai ManfeiBai changed the title [test non-fork] [Fori_loop|While_loop] Enable while_loop/fori_loop, Add linear/MNIST test case #7094 [Fori_loop|While_loop] Enable while_loop/fori_loop, Add linear/MNIST test case #7094 May 31, 2024
Copy link
Copy Markdown
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you gurantee the order of the input will match with the order in python?

Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread torch_xla/experimental/fori_loop.py Outdated
Comment thread torch_xla/experimental/fori_loop.py
Comment thread torch_xla/experimental/fori_loop.py Outdated
@ManfeiBai ManfeiBai requested a review from JackCaoG June 5, 2024 17:09
@ManfeiBai ManfeiBai force-pushed the ManfeiBai-patch-87 branch 2 times, most recently from 5cfdd02 to 8ba02c9 Compare June 7, 2024 19:06
Comment thread docs/fori_loop.md Outdated
@ManfeiBai ManfeiBai requested a review from JackCaoG June 7, 2024 20:39
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread torch_xla/csrc/init_python_bindings.cpp Outdated
Comment thread torch_xla/experimental/fori_loop.py Outdated
Comment thread torch_xla/experimental/fori_loop.py
@ManfeiBai ManfeiBai force-pushed the ManfeiBai-patch-87 branch from 1fe4f79 to 09330d6 Compare June 10, 2024 08:15
@ManfeiBai ManfeiBai requested a review from JackCaoG June 10, 2024 08:16
@ManfeiBai ManfeiBai force-pushed the ManfeiBai-patch-87 branch 2 times, most recently from c43130d to 7bd94fc Compare June 11, 2024 00:38
Copy link
Copy Markdown
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt like you forgot to push to this branch or something. In a few places you mentioned you made the change but I didn't see them

Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread test/test_while_loop.py Outdated
Comment thread docs/fori_loop.md Outdated
Comment thread docs/fori_loop.md Outdated
Comment thread torch_xla/csrc/init_python_bindings.cpp Outdated
@ManfeiBai ManfeiBai force-pushed the ManfeiBai-patch-87 branch from 42de983 to b5945c1 Compare June 12, 2024 07:27
@ManfeiBai ManfeiBai requested a review from JackCaoG June 12, 2024 08:38
@ManfeiBai ManfeiBai changed the title [Fori_loop|While_loop] Enable while_loop/fori_loop, Add linear/MNIST test case #7094 [Fori_loop|While_loop] Enable while_loop/fori_loop, add test case #7094 Jun 12, 2024
Comment thread docs/fori_loop.md Outdated
Comment thread docs/fori_loop.md Outdated
@ManfeiBai ManfeiBai force-pushed the ManfeiBai-patch-87 branch from 0bc9824 to de70e64 Compare June 17, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants