repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
pytorch
pytorch-main/test/distributed/elastic/utils/data/cycling_iterator_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest from torch.distributed.elastic.utils.data imp...
1,479
29.833333
71
py
pytorch
pytorch-main/test/distributed/elastic/agent/server/test/local_elastic_agent_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import json import multiprocessing as mp import os import shut...
47,895
36.683714
128
py
pytorch
pytorch-main/test/distributed/elastic/agent/server/test/api_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import signal import unittest import uuid from typing import...
23,224
38.498299
88
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/etcd_rendezvous_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import unittest import uuid from torch.distributed.elastic.rendezvous impo...
2,481
29.268293
84
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/api_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Dict, SupportsInt, Tuple, cast from unittest import TestCase...
9,979
35.15942
101
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/c10d_rendezvous_backend_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import tempfile from base64 import b64encode from datetime import timedel...
10,019
37.098859
118
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/static_rendezvous_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest from contextlib import closing from torch.distributed.elastic.rendez...
3,156
29.650485
72
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/rendezvous_backend_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from abc import ABC, abstractmethod from typing import Any, Callable, Optional, Tupl...
3,387
30.962264
97
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/dynamic_rendezvous_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import copy import os import pickle import socket import threading import time from ...
48,560
31.967413
102
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/utils_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import threading import time import socket from datetime import timedelta from typin...
13,189
32.224181
100
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/etcd_rendezvous_backend_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import subprocess from base64 import b64encode from typing import ClassVar, cast fro...
4,623
31.794326
115
py
pytorch
pytorch-main/test/distributed/elastic/rendezvous/etcd_server_test.py
# Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import unittest import etcd from torch.distributed.elastic.rendezvous.etcd...
1,704
28.396552
74
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_deferred_batch_norm.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from copy import deepcopy from itertools import chain ...
5,536
26.685
85
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_checkpoint.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from functools import partial import pytest import to...
4,293
24.86747
114
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_worker.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import threading import pytest import torch from tor...
3,428
28.307692
85
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_transparency.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import torch from torch import nn from torch.distribu...
1,286
24.235294
94
py
pytorch
pytorch-main/test/distributed/pipeline/sync/conftest.py
# Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import tempfile import pytest import torch import torch.distributed as dist @pytest.fixtu...
1,450
24.017241
71
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_pipeline.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from torch.distributed.pipeline.sync.pipeline import _...
991
25.810811
71
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_balance.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import time import pytest import torch from torch imp...
6,746
28.207792
101
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_phony.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import torch from torch.distributed.pipeline.sync.pho...
1,565
26
71
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_bugs.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch import nn import...
4,481
29.910345
84
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_dependency.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import weakref import pytest import torch from torch...
3,196
20.032895
77
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_stream.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch.distributed.pip...
6,058
29.913265
91
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_inplace.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch import nn from ...
2,452
30.050633
85
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_copy.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch.distributed.pip...
2,309
29.394737
121
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_pipe.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from collections import OrderedDict from copy import d...
24,011
28.035067
107
py
pytorch
pytorch-main/test/distributed/pipeline/sync/test_microbatch.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch import torch.cuda from tor...
3,139
20.216216
84
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_leak.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch import nn from ...
4,133
29.850746
92
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_api.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import copy from torch import nn from torch.distribu...
1,161
20.924528
76
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_tracker.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from queue import Queue import threading import pytes...
4,266
30.607407
116
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_stash_pop.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch import nn from ...
3,210
21.298611
86
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_inspect_skip_layout.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from torch import nn from torch.distributed.pipeline....
3,140
25.394958
83
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_gpipe.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch import nn from ...
3,792
31.698276
106
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_portal.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest import torch from torch.distributed.pip...
4,966
29.472393
74
py
pytorch
pytorch-main/test/distributed/pipeline/sync/skip/test_verify_skippables.py
# Owner(s): ["oncall: distributed"] # Copyright 2019 Kakao Brain # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import pytest from torch import nn from torch.distrib...
3,823
22.9
114
py
pytorch
pytorch-main/test/distributed/checkpoint/test_checkpoint.py
# Owner(s): ["oncall: distributed"] import sys from typing import Optional, List, cast from torch.distributed.checkpoint.storage import WriteResult from torch.distributed.checkpoint import ( StorageReader, StorageWriter, CheckpointException, load_state_dict, save_state_dict, ) import torch import...
13,090
32.310433
122
py
pytorch
pytorch-main/test/distributed/checkpoint/test_dedup_tensors.py
# Owner(s): ["oncall: distributed"] import dataclasses import torch from torch.distributed.checkpoint._dedup_tensors import dedup_tensors from torch.distributed.checkpoint.planner import SavePlan, WriteItemType from torch.distributed.checkpoint.planner_helpers import ( _create_write_item_for_tensor, ) from torch.t...
1,525
32.173913
83
py
pytorch
pytorch-main/test/distributed/checkpoint/test_dtensor_checkpoint.py
# Owner(s): ["oncall: distributed"] from typing import Dict, Union import torch import torch.distributed as dist import torch.distributed.checkpoint as dist_cp from torch.distributed._tensor import ( DeviceMesh, DTensor, Replicate, Shard, distribute_tensor, zeros, ) from torch.testing._internal...
9,636
33.916667
103
py
pytorch
pytorch-main/test/distributed/checkpoint/test_2d_fsdp_dt_checkpoint.py
# Owner(s): ["oncall: distributed"] import torch import torch.distributed as dist import torch.distributed.checkpoint as dist_cp import torch.distributed.distributed_c10d as distributed_c10d import torch.nn.functional as F from torch.distributed._tensor import DeviceMesh, DTensor from torch.distributed.checkpoint.def...
7,219
30.528384
78
py
pytorch
pytorch-main/test/distributed/checkpoint/test_fsspec.py
# Owner(s): ["oncall: distributed"] import shutil import tempfile from functools import wraps from typing import Any, Callable, Dict, Optional, Tuple import torch import torch.distributed as dist import torch.distributed.checkpoint as dcp import torch.nn as nn from torch.distributed.checkpoint._fsspec_filesystem impo...
6,088
30.225641
78
py
pytorch
pytorch-main/test/distributed/checkpoint/test_fsdp_model_state.py
# Owner(s): ["oncall: distributed"] import torch from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.fully_sharded_data_parallel import StateDictType import torch.distributed.checkpoint as dist_cp import torch.distributed as dist from torch.distributed.checkpoint.default_p...
3,308
32.424242
80
py
pytorch
pytorch-main/test/distributed/checkpoint/test_file_system_checkpoint_cpu.py
# Owner(s): ["oncall: distributed"] import sys import tempfile from typing import Dict import torch import torch.distributed as dist from torch.distributed._shard import sharded_tensor from torch.distributed._shard.sharded_tensor import ( ShardedTensor, state_dict_hook, ) from torch.distributed._shard.shardin...
16,750
32.43513
126
py
pytorch
pytorch-main/test/distributed/checkpoint/test_planner.py
# Owner(s): ["oncall: distributed"] import sys import torch from torch.distributed.checkpoint.planner import LoadItemType, WriteItemType from torch.distributed._shard.sharded_tensor import ( Shard, ShardMetadata, ShardedTensor, ShardedTensorMetadata, ) from torch.distributed._shard.sharded_tensor.met...
13,932
42.540625
128
py
pytorch
pytorch-main/test/distributed/checkpoint/test_file_system_checkpoint.py
# Owner(s): ["oncall: distributed"] import os import sys import shutil import tempfile from typing import Dict import torch import torch.distributed as dist from torch.distributed._shard import sharded_tensor from torch.distributed._shard.sharded_tensor import ( ShardedTensor, state_dict_hook, ) from torch.di...
17,458
32.066288
126
py
pytorch
pytorch-main/test/distributed/checkpoint/test_traverse.py
# Owner(s): ["oncall: distributed"] from collections import OrderedDict import torch import torch.distributed.checkpoint._traverse as _traverse from torch.distributed.checkpoint.metadata import STATE_DICT_TYPE from torch.testing._internal.common_utils import run_tests, TestCase # TODO: add comments for TestTraverse...
5,440
29.740113
79
py
pytorch
pytorch-main/test/distributed/checkpoint/test_nested_dict.py
# Owner(s): ["oncall: distributed"] import torch from torch.testing._internal.common_utils import run_tests, TestCase from torch.distributed.checkpoint._nested_dict import ( flatten_state_dict, unflatten_state_dict, ) class TestFlattening(TestCase): def test_flattening_round_trip(self) -> None: s...
1,944
29.873016
109
py
pytorch
pytorch-main/test/distributed/checkpoint/test_fsdp_optim_state.py
# Owner(s): ["oncall: distributed"] import torch from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.fully_sharded_data_parallel import StateDictType import torch.distributed.checkpoint as dist_cp import torch.distributed as dist from torch.distributed.checkpoint.default_p...
3,699
33.579439
78
py
pytorch
pytorch-main/test/distributed/checkpoint/test_utils.py
# Owner(s): ["oncall: distributed"] import sys import torch from torch.distributed._shard.sharded_tensor import ( Shard, ShardMetadata, ShardedTensor, ShardedTensorMetadata, ) from torch.distributed._shard.sharded_tensor.metadata import TensorProperties from torch.testing._internal.common_utils impo...
4,443
33.71875
110
py
pytorch
pytorch-main/test/distributed/_tools/test_memory_tracker.py
# Owner(s): ["oncall: distributed"] import os from torch.testing._internal.common_cuda import TEST_CUDA from torch.testing._internal.common_utils import ( TestCase, run_tests, ) import torch import torch.nn as nn from torch.distributed._tools import MemoryTracker import unittest class TestMemoryTracker(Tes...
2,446
32.067568
81
py
pytorch
pytorch-main/test/distributed/algorithms/test_join.py
# Owner(s): ["oncall: distributed"] import contextlib import os import sys from typing import Any, Optional import torch import torch.distributed as dist if not dist.is_available(): print("Distributed not available, skipping tests", file=sys.stderr) sys.exit(0) from torch.distributed.algorithms.join import ...
16,875
31.896686
94
py
pytorch
pytorch-main/test/distributed/algorithms/ddp_comm_hooks/test_ddp_hooks.py
# Owner(s): ["oncall: distributed"] import os import sys import torch from torch import nn import torch.distributed as dist if not dist.is_available(): print("Distributed not available, skipping tests", file=sys.stderr) sys.exit(0) from torch.distributed.algorithms.ddp_comm_hooks import ( DDPCommHookTyp...
7,743
30.868313
92
py
pytorch
pytorch-main/test/distributed/algorithms/quantization/test_quantization.py
# Owner(s): ["oncall: distributed"] import torch import os import torch.cuda import sys import torch.distributed as dist import torch.distributed.algorithms._quantization.quantization as quant from torch.distributed.algorithms._quantization.quantization import DQuantType from torch.testing._internal.common_distributed...
11,580
36.11859
88
py
pytorch
pytorch-main/test/distributed/optim/test_named_optimizer.py
# Owner(s): ["oncall: distributed"] # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest import torch import torch.nn as nn from torch.distribute...
14,993
34.03271
94
py
pytorch
pytorch-main/test/distributed/optim/test_zero_redundancy_optimizer.py
# Owner(s): ["oncall: distributed"] # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import copy import os import sys import unittest from contextlib import nullcontext ...
53,725
36.257975
88
py
pytorch
pytorch-main/test/distributed/optim/test_apply_optimizer_in_backward.py
# Owner(s): ["oncall: distributed"] # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest from copy import deepcopy import torch import torch.nn a...
4,821
33.442857
84
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_view_sharding_dim_change.py
# Copyright (c) Meta Platforms, Inc. and affiliates # Owner(s): ["oncall: distributed"] import torch from torch.distributed._tensor import DeviceMesh, DTensor, Shard from torch.distributed.tensor.parallel._view_with_dim_change import ( _view_with_sharding_dim_change, ) from torch.testing._internal.common_utils imp...
1,068
33.483871
80
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_tp_style.py
# Copyright (c) Meta Platforms, Inc. and affiliates # Owner(s): ["oncall: distributed"] import torch import torch.distributed as dist from torch.distributed._tensor import DeviceMesh, distribute_tensor, Replicate, Shard from torch.distributed.tensor.parallel.style import ( ColwiseParallel, make_input_replicate...
9,122
39.189427
93
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_tp_examples.py
# Copyright (c) Meta Platforms, Inc. and affiliates # Owner(s): ["oncall: distributed"] import torch import torch.distributed as dist import torch.nn as nn from torch.distributed._tensor import DeviceMesh, DTensor, Replicate from torch.distributed.algorithms._checkpoint.checkpoint_wrapper import ( checkpoint_wrapp...
15,125
35.186603
111
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_parallelize_api.py
# Owner(s): ["oncall: distributed"] from collections import OrderedDict import torch from torch.distributed._tensor import DeviceMesh, DTensor, Replicate from torch.distributed.tensor.parallel._utils import _create_1d_device_mesh from torch.distributed.tensor.parallel.api import ( _parallelize_linear, _paralle...
10,200
35.826715
87
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_tp_random_state.py
# Owner(s): ["oncall: distributed"] import torch import torch.distributed._tensor.random as random from torch.distributed._tensor import DeviceMesh from torch.distributed.tensor.parallel.api import parallelize_module from torch.distributed.tensor.parallel.style import ( ColwiseParallel, make_input_replicate_1d...
5,339
42.414634
101
py
pytorch
pytorch-main/test/distributed/tensor/parallel/test_2d_parallel.py
# Owner(s): ["oncall: distributed"] from typing import Any import torch import torch.distributed as dist import functools import torch.distributed.distributed_c10d as distributed_c10d import torch.nn.functional as F from torch.distributed._shard.sharded_tensor.api import ShardedTensor from torch.distributed._tensor ...
9,450
33.367273
129
py
pytorch
pytorch-main/test/distributed/_spmd/test_data_parallel.py
# Owner(s): ["oncall: distributed"] from copy import deepcopy import torch import torch.nn as nn from torch.distributed._spmd.api import compile from torch.distributed._spmd.parallel_mode import DataParallel from torch.distributed._tensor import Replicate from torch.nn.parallel import DistributedDataParallel as DD...
8,734
31.715356
83
py
pytorch
pytorch-main/test/distributed/_spmd/test_graph_utils.py
# Owner(s): ["oncall: distributed"] import os from torch.distributed._spmd.graph_utils import dump_graphs_to_files from torch.testing._internal.common_utils import run_tests from torch.testing._internal.distributed._tensor.common_dtensor import DTensorTestBase class GraphUtilsTest(DTensorTestBase): @property ...
1,297
29.904762
86
py
pytorch
pytorch-main/test/distributed/_spmd/test_transformation.py
# Owner(s): ["oncall: distributed"] import unittest from copy import deepcopy from functools import wraps from unittest.mock import MagicMock import torch import torch.nn as nn from torch._inductor.utils import has_triton from torch.distributed._spmd.api import compile from torch.distributed._spmd.gm_transformation i...
10,636
29.654179
88
py
pytorch
pytorch-main/test/distributed/_spmd/test_tracing.py
# Owner(s): ["oncall: distributed"] from copy import deepcopy from functools import wraps from typing import Any, List, Type import torch import torch.distributed as dist import torch.fx as fx import torch.nn as nn from torch.distributed._spmd.api import compile, COMPILED_OBJECT_KEY, Override from torch.distributed._...
32,635
32.819689
88
py
pytorch
pytorch-main/test/distributed/launcher/api_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import multiprocessing as mp import os import shutil import si...
13,520
32.8025
113
py
pytorch
pytorch-main/test/distributed/launcher/run_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import multiprocessing as mp import os import runpy import shu...
21,091
34.21202
98
py
pytorch
pytorch-main/test/distributed/launcher/launch_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import shutil import tempfile import unittest from c...
2,769
30.477273
79
py
pytorch
pytorch-main/test/distributed/launcher/bin/test_script_is_torchelastic_launched.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """ This is a test script that launches as part of the test c...
1,414
30.444444
91
py
pytorch
pytorch-main/test/distributed/launcher/bin/test_script_init_method.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import argparse import os import torch import torch.distribu...
1,955
23.45
90
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_exec_order.py
# Owner(s): ["oncall: distributed"] import sys import warnings from contextlib import nullcontext import torch from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.fully_sharded_data_parallel import ShardingStrategy from torch.testing._i...
8,155
36.585253
87
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_dtensor_state_dict.py
# Owner(s): ["oncall: distributed"] import io from copy import deepcopy import torch import torch.nn as nn from torch.distributed._shard.sharded_tensor import ShardedTensor from torch.distributed._tensor import DTensor from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.ap...
6,408
35.005618
92
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_state_dict.py
# Owner(s): ["oncall: distributed"] import io import itertools import sys from contextlib import nullcontext from copy import deepcopy from functools import partial from typing import Any, Dict import torch import torch.nn as nn from torch import distributed as dist from torch.distributed._shard.sharded_tensor import...
45,781
39.230228
106
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_memory.py
# Owner(s): ["oncall: distributed"] import sys import torch import torch.nn as nn import torch.optim as optim from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._internal.c...
8,731
36.157447
102
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_checkpoint.py
# Owner(s): ["oncall: distributed"] import contextlib import sys from copy import deepcopy from functools import partial import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.algorithms._checkpoint.checkpoint_wrapper import ( checkpoint_wrapper, offload_wrapper, ) from tor...
12,479
32.638814
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_uneven.py
# Owner(s): ["oncall: distributed"] import sys import torch from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.nn import Linear from torch.optim import SGD from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._inte...
2,336
32.869565
83
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_ignored_modules.py
# Owner(s): ["oncall: distributed"] import sys import torch import torch.distributed.fsdp._traversal_utils as traversal_utils import torch.nn as nn from torch import distributed as dist from torch.distributed._composable import fully_shard from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch...
17,746
37.41342
89
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_overlap.py
# Owner(s): ["oncall: distributed"] import sys import time from statistics import mean from unittest.mock import patch import torch import torch.nn as nn from torch import distributed as dist from torch.cuda import Event from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.testing._internal....
8,959
34
105
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_fx.py
# Owner(s): ["oncall: distributed"] import torch from torch.distributed.fsdp._trace_utils import _ExecOrderTracer from torch.testing._internal.common_utils import ( instantiate_parametrized_tests, run_tests, TestCase, ) class Model(torch.nn.Module): def __init__(self) -> None: super().__init_...
4,603
36.129032
86
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_fine_tune.py
# Owner(s): ["oncall: distributed"] import copy import sys from unittest import mock import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.fsdp.fully_sharded_data_parallel import ( FullyShardedDataParallel as FSDP, ShardingStrategy, ) from torch.distributed.fsdp.wrap impor...
6,600
34.875
87
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_core.py
# Owner(s): ["oncall: distributed"] import contextlib import functools import itertools import sys from typing import Any, Callable, Dict, List, Optional from unittest import mock import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.fsdp import CPUOffload, MixedPrecision from tor...
18,789
35.771037
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_input.py
# Owner(s): ["oncall: distributed"] import sys import torch from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.nn import Linear, Module from torch.optim import SGD from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testi...
2,133
26.714286
87
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_tp_integration.py
# Owner(s): ["oncall: distributed"] import copy import sys from collections import OrderedDict from typing import Any, Dict, List, Optional, Tuple import torch from torch import distributed as dist from torch.distributed._shard.sharded_tensor.api import ShardedTensor from torch.distributed._shard.sharding_spec import ...
13,815
37.592179
110
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_clip_grad_norm.py
# Owner(s): ["oncall: distributed"] import itertools import sys from typing import Union import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp import ShardingStrategy from torch.distributed.fsdp.fully_sharded_data_parallel import ( CPUOffload, FullyShardedDataPar...
12,683
35.765217
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_traversal.py
# Owner(s): ["oncall: distributed"] import sys from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._internal.common_fsdp import ( CUDAInitMode, FSDPInitMode, FSD...
1,734
27.442623
83
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_unshard_params.py
# Owner(s): ["oncall: distributed"] import contextlib import itertools import math import sys from typing import Any, Dict, List, Optional, Union import torch import torch.distributed.fsdp._traversal_utils as traversal_utils import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp import...
27,742
37.964888
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_hybrid_shard.py
# Owner(s): ["oncall: distributed"] import contextlib import sys from collections import Counter from enum import auto, Enum from functools import partial import torch import torch.distributed as dist import torch.distributed.fsdp._traversal_utils as traversal_utils import torch.nn as nn from torch.distributed.distr...
13,925
35.84127
96
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_comm_hooks.py
# Owner(s): ["oncall: distributed"] import sys from typing import Optional import torch import torch.nn as nn import torch.nn.functional as F from torch import distributed as dist from torch.distributed.algorithms._comm_hooks import default_hooks from torch.distributed.distributed_c10d import _get_default_group from ...
16,876
35.68913
118
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_use_orig_params.py
# Owner(s): ["oncall: distributed"] import copy import functools import itertools import os import sys import unittest from typing import Any, Dict, List, Optional, Tuple, Type import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp import ( BackwardPrefetch, CPUOf...
53,969
39.066815
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_distributed_checkpoint.py
# Owner(s): ["oncall: distributed"] import sys import tempfile import torch from torch import distributed as dist from torch.distributed.checkpoint import ( FileSystemReader, FileSystemWriter, load_state_dict, save_state_dict, ) from torch.distributed.fsdp import FullyShardedDataParallel as FSDP, Stat...
3,165
30.979798
87
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_freezing_weights.py
# Owner(s): ["oncall: distributed"] import sys from enum import Enum import torch import torch.nn as nn import torch.optim as optim from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.nn.parallel import DistributedDataParallel from torch.testing._intern...
5,381
30.109827
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_pure_fp16.py
# Owner(s): ["oncall: distributed"] import sys import torch import torch.distributed.fsdp._traversal_utils as traversal_utils from torch import distributed as dist from torch.distributed.fsdp import ( CPUOffload, FullyShardedDataParallel as FSDP, MixedPrecision, ) from torch.testing._internal.common_distr...
5,452
33.08125
84
py
pytorch
pytorch-main/test/distributed/fsdp/test_wrap.py
# Owner(s): ["oncall: distributed"] import functools import os import tempfile import unittest from enum import auto, Enum from typing import Callable, Union import torch import torch.nn as nn import torch.nn.functional as F from torch.distributed.fsdp.fully_sharded_data_parallel import ( BackwardPrefetch, CP...
25,739
38.059181
111
py
pytorch
pytorch-main/test/distributed/fsdp/test_shard_utils.py
# Owner(s): ["oncall: distributed"] import torch import torch.distributed as dist from torch.distributed._tensor import DTensor from torch.distributed._tensor.placement_types import Shard from torch.distributed.distributed_c10d import _get_default_group from torch.distributed.fsdp._shard_utils import ( _create_ch...
3,143
31.412371
83
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_sharded_grad_scaler.py
# Owner(s): ["oncall: distributed"] import functools import itertools import sys import unittest from typing import Optional import torch from torch import distributed as dist from torch.cuda.amp.common import amp_definitely_not_available from torch.distributed.fsdp import CPUOffload, MixedPrecision from torch.distri...
7,807
37.087805
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_meta.py
# Owner(s): ["oncall: distributed"] import itertools import sys from typing import Union import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.fsdp import FullyShardedDataParallel as FSDP, MixedPrecision from torch.distributed.fsdp.wrap import ( always_wrap_policy as always_w...
14,600
33.355294
83
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_optim_state.py
# Owner(s): ["oncall: distributed"] import bisect import sys from copy import deepcopy from enum import auto, Enum from typing import Any, Callable, Dict, List, Optional, Tuple, Type import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.algorithms._checkpoint.checkpoint_wrapp...
76,065
38.679708
99
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_comm.py
# Owner(s): ["oncall: distributed"] import sys from contextlib import nullcontext from enum import auto, Enum from typing import Optional from unittest.mock import patch import torch from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.f...
10,719
36.222222
85
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_flatten_params.py
# Owner(s): ["oncall: distributed"] import sys import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp.flat_param import ( FlatParamHandle, FlatParamShardMetadata, HandleShardingStrategy, ) fro...
20,418
34.885764
88
py
pytorch
pytorch-main/test/distributed/fsdp/test_fsdp_apply.py
# Owner(s): ["oncall: distributed"] import sys import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._internal.common_fsdp import ( CUDAInitM...
3,378
31.805825
87
py