-
Notifications
You must be signed in to change notification settings - Fork 276
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
[SDP][Minor] Removing an assert which does not seem always accurate #625
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,9 +262,9 @@ def test_mixed_types(): | |
dist.destroy_process_group() | ||
|
||
|
||
def test_train_eval_change(): | ||
def run_test_train_eval_change(rank, world_size, file): | ||
# Check that ShardedDDP handles the switch from training to eval properly | ||
dist.init_process_group(init_method="file://" + tempfile.mkstemp()[1], backend="gloo", rank=0, world_size=1) | ||
dist.init_process_group(init_method="file://" + file, backend="gloo", rank=rank, world_size=world_size) | ||
|
||
model = _get_mlp() | ||
model.train() | ||
|
@@ -288,6 +288,14 @@ def test_train_eval_change(): | |
dist.destroy_process_group() | ||
|
||
|
||
def test_train_eval_change(): | ||
world_size = 4 | ||
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. making the test case truly distributed, but still not seeing the issue which was reported in a somewhat similar situation. My guess is that there are some changes on the lightning side which make it a little more than just .train()/.eval(), but crashing on users is probably not a good idea in that case. Worst case is a lost step() worth of gradients |
||
temp_file_name = tempfile.mkstemp()[1] | ||
mp.spawn( | ||
run_test_train_eval_change, args=(world_size, temp_file_name), nprocs=world_size, join=True, | ||
) | ||
|
||
|
||
def run_test_device_change(rank, world_size, backend, device, temp_file_name, reduce_buffer_size): | ||
# Check that the wrapped module can change devices | ||
dist.init_process_group(init_method="file://" + temp_file_name, backend=backend, rank=rank, world_size=world_size) | ||
|
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.
unrelated, but master linting was broken because of that