• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ContinualAI / avalanche / 4993189103

pending completion
4993189103

Pull #1370

github

Unknown Committer
Unknown Commit Message
Pull Request #1370: Add base elements to support distributed comms. Add supports_distributed plugin flag.

258 of 822 new or added lines in 27 files covered. (31.39%)

80 existing lines in 5 files now uncovered.

15585 of 21651 relevant lines covered (71.98%)

2.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.0
/tests/distributed/distributed_test_utils.py
1
import contextlib
4✔
2
import os
4✔
3

4
import torch
4✔
5

6
from avalanche.distributed import DistributedHelper
4✔
7

8

9
def common_dst_tests_setup():
4✔
NEW
10
    use_gpu_in_tests = os.environ.get('USE_GPU', 'false').lower() in [
×
11
        '1', 'true']
NEW
12
    use_gpu_in_tests = use_gpu_in_tests and torch.cuda.is_available()
×
NEW
13
    DistributedHelper.init_distributed(1234, use_cuda=use_gpu_in_tests)
×
NEW
14
    return use_gpu_in_tests
×
15

16

17
def check_skip_distributed_test() -> bool:
4✔
18
    return os.environ.get('DISTRIBUTED_TESTS', 'false').lower() \
4✔
19
        not in ['1', 'true']
20

21

22
def check_skip_distributed_slow_test() -> bool:
4✔
23
    return check_skip_distributed_test() or \
4✔
24
        os.environ.get('FAST_TEST', 'false').lower() in ['1', 'true']
25

26

27
@contextlib.contextmanager
4✔
28
def suppress_dst_tests_output():
3✔
NEW
29
    if os.environ['LOCAL_RANK'] != 0:
×
NEW
30
        with contextlib.redirect_stderr(None):
×
NEW
31
            with contextlib.redirect_stdout(None):
×
NEW
32
                yield
×
33
    else:
NEW
34
        yield
×
35

36

37
__all__ = [
4✔
38
    'common_dst_tests_setup',
39
    'check_skip_distributed_test',
40
    'check_skip_distributed_slow_test',
41
    'suppress_dst_tests_output'
42
]
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc