Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import torch
from torch.testing._internal.distributed.multi_threaded_pg import ThreadLocalWorld

from miles.backends.fsdp_utils.monkey_patches.fsdp_param_dtype_patch import apply_param_dtype_map_patch

apply_param_dtype_map_patch()
torch.use_deterministic_algorithms(True)

# torch 2.11's destroy_process_group reads _world.comms, which that release's threaded test world lacks: every thread
# of a threaded test raises in its teardown, and the interpreter has segfaulted while they printed their tracebacks.
if not hasattr(ThreadLocalWorld, "comms"):
ThreadLocalWorld.comms = property(lambda self: [])
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def _run_ported_test(filename, *selectors):
assert result.returncode == 0, result.stdout + result.stderr
# site.py swallows sitecustomize errors, which would run the ported tests unpatched
assert "Error in sitecustomize" not in result.stderr, result.stderr
# a thread that raises outside its test body fails no test; only its traceback shows it
assert "Exception in thread" not in result.stderr, result.stderr


def test_fully_shard_mixed_precision():
Expand Down
Loading