Skip to content

Commit ad260ae

Browse files
pritamdamaniafacebook-github-bot
authored andcommitted
Disable test_joing_running_workers for TSAN. (pytorch#46966)
Summary: Pull Request resolved: pytorch#46966 These tests had false positives in TSAN for modifying thread local variables: ``` WARNING: ThreadSanitizer: data race (pid=5364) Write of size 8 at 0x7b2c0004ff70 by thread T2: #0 free <null> (libtools_build_sanitizers_tsan-py.so+0xde6ad) #1 __GI__dl_deallocate_tls Previous write of size 1 at 0x7b2c0004ff71 by thread T3: #0 at::GradMode::set_enabled(bool) caffe2/aten/src/ATen/core/grad_mode.cpp:20 (libcaffe2_ATen-core.so+0x40e013) #1 torch::autograd::set_grad_enabled(_object*, _object*) caffe2/torch/csrc/autograd/init.cpp:143 (libcaffe2__C_impl_cuda.so+0x115ef0e) pytorch#2 _PyMethodDef_RawFastCallKeywords Thread T3 (tid=5385, finished) created by main thread at: #0 pthread_create <null> (libtools_build_sanitizers_tsan-py.so+0xc5a86) #1 PyThread_start_new_thread ``` ghstack-source-id: 115330433 Test Plan: waitforbuildbot Reviewed By: mrshenli Differential Revision: D24584411 fbshipit-source-id: e35f704dfcb7b161a13a4902beaf8b1e41ccd596
1 parent 9fefb40 commit ad260ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/distributed/_pipeline/sync/test_worker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from torch.distributed._pipeline.sync.microbatch import Batch
1414
from torch.distributed._pipeline.sync.stream import CPUStream
1515
from torch.distributed._pipeline.sync.worker import Task, spawn_workers
16+
from torch.testing._internal.common_utils import TEST_WITH_TSAN
1617

1718

1819
class fake_device:
@@ -24,6 +25,7 @@ class fake_device:
2425
index = None
2526

2627

28+
@pytest.mark.skipif(TEST_WITH_TSAN, reason="False positive in TSAN")
2729
def test_join_running_workers():
2830
count = 0
2931

@@ -47,6 +49,7 @@ def call_in_worker(i, f):
4749
assert count == 10
4850

4951

52+
@pytest.mark.skipif(TEST_WITH_TSAN, reason="False positive in TSAN")
5053
def test_join_running_workers_with_exception():
5154
class ExpectedException(Exception):
5255
pass

0 commit comments

Comments
 (0)