Skip to content
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

Fix sdpfa_fwd to not assume the presence of DIDs. #3116

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Fix sdpfa_fwd to not assume the presence of DIDs. #3116

merged 3 commits into from
Oct 7, 2024

Conversation

wujingyue
Copy link
Collaborator

@wujingyue wujingyue commented Oct 5, 2024

Similar to #3073, sdpfa_fwd shouldn't assume DIDs are available at definition time. Instead, treat extra preceding dimensions as batch at definition time and check they are device parallel at evaluation time.

This is required to land #3115.

@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue marked this pull request as ready for review October 5, 2024 06:09
@wujingyue
Copy link
Collaborator Author

!build

Copy link
Collaborator

@samnordmann samnordmann left a comment

Choose a reason for hiding this comment

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

LTGM

csrc/ops/composite.cpp Outdated Show resolved Hide resolved
tests/python/test_multidevice.py Show resolved Hide resolved
tests/python/test_multidevice.py Show resolved Hide resolved
self.sched.parallelize(t, 0, nvfuser.ParallelType.mesh_x)

torch.cuda.set_device(mpi_test.local_rank)
torch.manual_seed(0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we make the seed manual for all tests, and put this line in the test's constructor ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes and cc @Priya2698 who briefly mentioned how this should be done which I forgot :) We do have

class NVFuserTest(TestCase):
a "fixture" class used by many Python tests, so we could set seed there. However, I'm under the impression that we are migrating from unittest to pytest, so this will have to be done differently.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We are using this with pytest:

@pytest.mark.skipif(is_pre_volta(), reason="Only supported on Volta and newer devices.")
class TestNvFuserFrontend(NVFuserTest):
.

What do you mean by doing it differently for pytest?

tests/python/test_multidevice.py Outdated Show resolved Hide resolved
@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue merged commit 222315e into main Oct 7, 2024
29 of 30 checks passed
@wujingyue wujingyue deleted the wjy/sdpa branch October 7, 2024 22:56
wujingyue added a commit that referenced this pull request Oct 10, 2024
wujingyue added a commit that referenced this pull request Oct 17, 2024
wujingyue added a commit that referenced this pull request Oct 17, 2024
wujingyue added a commit that referenced this pull request Oct 17, 2024
@wujingyue wujingyue added the bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants