python_code
stringlengths
0
1.02M
repo_name
stringlengths
9
48
file_path
stringlengths
5
114
# 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...
pytorch-master
test/distributed/pipeline/sync/test_copy.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. # tests/__init__.py makes pytest can import the application without custom sys.path or PYTH...
pytorch-master
test/distributed/pipeline/sync/__init__.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...
pytorch-master
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 pytest import torch import torch.cuda from tor...
pytorch-master
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. from copy import deepcopy from itertools import chain ...
pytorch-master
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. import threading import pytest import torch from tor...
pytorch-master
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 torch from torch.distributed.pipeline.sync.pho...
pytorch-master
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 pytest import torch from torch import nn import...
pytorch-master
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 time import pytest import torch from torch imp...
pytorch-master
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. from collections import OrderedDict from copy import d...
pytorch-master
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 torch.distributed.pipeline.sync.pipeline import _...
pytorch-master
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 functools import partial import pytest import to...
pytorch-master
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. import pytest import torch from torch.distributed.pip...
pytorch-master
test/distributed/pipeline/sync/test_stream.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.
pytorch-master
test/distributed/pipeline/sync/skip/__init__.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 ...
pytorch-master
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. from queue import Queue import threading import pytes...
pytorch-master
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. import pytest from torch import nn from torch.distrib...
pytorch-master
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 import torch from torch.distributed.pip...
pytorch-master
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 import nn from ...
pytorch-master
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 copy from torch import nn from torch.distribu...
pytorch-master
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. from torch import nn from torch.distributed.pipeline....
pytorch-master
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. import pytest import torch from torch import nn from ...
pytorch-master
test/distributed/pipeline/sync/skip/test_gpipe.py
#!/usr/bin/env python3 # 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.
pytorch-master
test/distributed/launcher/__init__.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...
pytorch-master
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 shutil import si...
pytorch-master
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 os import shutil import tempfile import unittest from c...
pytorch-master
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 argparse import os def parse_args(): parser = ar...
pytorch-master
test/distributed/launcher/bin/test_script_local_rank.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...
pytorch-master
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. import argparse import os from pathlib import Path def pars...
pytorch-master
test/distributed/launcher/bin/test_script.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...
pytorch-master
test/distributed/launcher/bin/test_script_init_method.py
pytorch-master
test/distributed/nn/jit/__init__.py
#!/usr/bin/env python3 # Owner(s): ["oncall: distributed"] import pathlib import sys from typing import Tuple import torch from torch import Tensor, 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.dist...
pytorch-master
test/distributed/nn/jit/test_instantiator.py
#!/usr/bin/env python3 # Owner(s): ["oncall: distributed"] # 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. def main(): print("Success, smoke test") if __...
pytorch-master
test/distributed/bin/test_script.py
#!/usr/bin/env python3 # 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.abs
pytorch-master
test/distributed/elastic/metrics/__init__.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.abs import abc import unittest.mock as mock from torch.distrib...
pytorch-master
test/distributed/elastic/metrics/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. import os import tempfile from base64 import b64encode from datetime import timedel...
pytorch-master
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 threading import time import socket from datetime import timedelta from typin...
pytorch-master
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 os import unittest import etcd from torch.distributed.elastic.rendezvous.etcd...
pytorch-master
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 uuid from torch.distributed.elastic.rendezvous impo...
pytorch-master
test/distributed/elastic/rendezvous/etcd_rendezvous_test.py
# 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.
pytorch-master
test/distributed/elastic/rendezvous/__init__.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 ...
pytorch-master
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. from abc import ABC, abstractmethod from typing import Any, Callable, Optional, Tupl...
pytorch-master
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. import subprocess from base64 import b64encode from typing import ClassVar, cast fro...
pytorch-master
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. from typing import Any, Dict, SupportsInt, Tuple, cast from unittest import TestCase...
pytorch-master
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. import unittest from contextlib import closing from torch.distributed.elastic.rendez...
pytorch-master
test/distributed/elastic/rendezvous/static_rendezvous_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 ctypes import os import shutil import sys import tempfi...
pytorch-master
test/distributed/elastic/multiprocessing/redirects_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 io import os import shutil import sys import tempfile i...
pytorch-master
test/distributed/elastic/multiprocessing/tail_log_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 ctypes import multiprocessing import os import shutil i...
pytorch-master
test/distributed/elastic/multiprocessing/api_test.py
#!/usr/bin/env python3 # 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 ctypes import os if __name__ == "__main__": parser = argpars...
pytorch-master
test/distributed/elastic/multiprocessing/bin/echo3.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. # TODO <DELETE_ME>
pytorch-master
test/distributed/elastic/multiprocessing/bin/test_script.py
#!/usr/bin/env python3 # 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 if __name__ == "__main__": parser = argparse.ArgumentPars...
pytorch-master
test/distributed/elastic/multiprocessing/bin/echo2.py
#!/usr/bin/env python3 # 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 sys if __name__ == "__main__": parser = argparse.A...
pytorch-master
test/distributed/elastic/multiprocessing/bin/echo1.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 time if __name__ == "__main__": time.sleep(600) ...
pytorch-master
test/distributed/elastic/multiprocessing/bin/zombie_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] import json import os import shutil import signal import tempfile import unittest from unittest import mock from torch.distributed.elastic.multiprocessing.errors import ( ChildFailedError, ProcessFailure, record, ) from torch.distributed.elastic.multiproc...
pytorch-master
test/distributed/elastic/multiprocessing/errors/api_test.py
#!/usr/bin/env python3 # Owner(s): ["oncall: r2p"] import filecmp import json import os import shutil import tempfile import unittest from unittest.mock import patch from torch.distributed.elastic.multiprocessing.errors.error_handler import ErrorHandler from torch.distributed.elastic.multiprocessing.errors.handlers i...
pytorch-master
test/distributed/elastic/multiprocessing/errors/error_handler_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 multiprocessing as mp import signal import time import unittest import unittes...
pytorch-master
test/distributed/elastic/timer/local_timer_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 logging import multiprocessing as mp import signal impo...
pytorch-master
test/distributed/elastic/timer/local_timer_example.py
# 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.
pytorch-master
test/distributed/elastic/timer/__init__.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 import unittest.mock as mock from torch.distributed.elastic.timer im...
pytorch-master
test/distributed/elastic/timer/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 torch.distributed.elastic.utils.logging as logging from...
pytorch-master
test/distributed/elastic/utils/logging_test.py
#!/usr/bin/env python3 # 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.
pytorch-master
test/distributed/elastic/utils/__init__.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. from unittest import mock import torch.distributed.elastic.u...
pytorch-master
test/distributed/elastic/utils/util_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 socket import s...
pytorch-master
test/distributed/elastic/utils/distributed_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...
pytorch-master
test/distributed/elastic/utils/data/cycling_iterator_test.py
#!/usr/bin/env python3 # 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.
pytorch-master
test/distributed/elastic/utils/data/__init__.py
#!/usr/bin/env python3 # 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.
pytorch-master
test/distributed/elastic/agent/server/test/__init__.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...
pytorch-master
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 signal import unittest import uuid from typing import...
pytorch-master
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.abs import json import logging import unittest from dataclasse...
pytorch-master
test/distributed/elastic/events/lib_test.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 ...
pytorch-master
test/distributed/algorithms/test_join.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...
pytorch-master
test/distributed/algorithms/ddp_comm_hooks/test_ddp_hooks.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...
pytorch-master
test/distributed/algorithms/quantization/test_quantization.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 suppress fro...
pytorch-master
test/distributed/optim/test_zero_redundancy_optimizer.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...
pytorch-master
test/distributed/fsdp/test_fsdp_uneven.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.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._internal.common_fsdp import ( CUDA...
pytorch-master
test/distributed/fsdp/test_fsdp_ignored_modules.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...
pytorch-master
test/distributed/fsdp/test_fsdp_input.py
# Owner(s): ["oncall: distributed"] import random import sys from typing import List import unittest from collections import OrderedDict import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp._utils import _apply_to_tensors from torch.distributed.utils import _replace_by_...
pytorch-master
test/distributed/fsdp/test_utils.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.nn.parallel import DistributedDataParallel from torch.optim import SGD from torch.testing._internal.commo...
pytorch-master
test/distributed/fsdp/test_fsdp_multiple_forward.py
# Owner(s): ["oncall: distributed"] import sys from torch import distributed as dist from torch.distributed.fsdp import CPUOffload from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from torch.testing._internal.common_fsdp import ( CUDAInitMode, FSDPInitMode, FSDPTest, NestedWrapp...
pytorch-master
test/distributed/fsdp/test_fsdp_pure_fp16.py
# Owner(s): ["oncall: distributed"] import sys from math import inf import torch from torch import distributed as dist from torch.distributed.fsdp.fully_sharded_data_parallel import ( FullyShardedDataParallel as FSDP, CPUOffload, _calc_grad_norm, ) from torch.nn import utils as nn_utils from torch.testing...
pytorch-master
test/distributed/fsdp/test_fsdp_clip_grad_norm.py
# Owner(s): ["oncall: distributed"] import itertools import math import sys from copy import deepcopy import torch import torch.nn as nn from torch import distributed as dist from torch.distributed.fsdp import CPUOffload from torch.distributed.fsdp import FullyShardedDataParallel as FSDP from torch.distributed.fsdp im...
pytorch-master
test/distributed/fsdp/test_fsdp_summon_full_params.py
# Owner(s): ["oncall: distributed"] import bisect import sys from enum import Enum, auto from typing import Any, Dict, List, Tuple, Type import torch from torch import distributed as dist from torch.distributed.algorithms._checkpoint.checkpoint_wrapper import ( _CHECKPOINT_PREFIX, apply_activation_checkpointing_w...
pytorch-master
test/distributed/fsdp/test_fsdp_optim_state.py
# Owner(s): ["oncall: distributed"] import sys import warnings from contextlib import suppress 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._inte...
pytorch-master
test/distributed/fsdp/test_fsdp_exec_order.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...
pytorch-master
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.distributed.fsdp.wrap import always_wrap_policy as always_wrap from torch.distributed.fsdp.wrap import wrap, enable_wrap fro...
pytorch-master
test/distributed/fsdp/test_fsdp_meta.py
# Owner(s): ["oncall: distributed"] from typing import Any import torch from torch.distributed.fsdp._symbolic_trace import _init_execution_info, _patch_tracer from torch.testing._internal.common_fsdp import FSDPTest from torch.testing._internal.common_utils import ( instantiate_parametrized_tests, run_tests, ...
pytorch-master
test/distributed/fsdp/test_fsdp_fx.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...
pytorch-master
test/distributed/fsdp/test_fsdp_sharded_grad_scaler.py
# Owner(s): ["oncall: distributed"] import contextlib import itertools import sys from dataclasses import dataclass from typing import List, Optional, Tuple import torch from torch import distributed as dist from torch.distributed.fsdp import CPUOffload from torch.distributed.fsdp import FullyShardedDataParallel as F...
pytorch-master
test/distributed/fsdp/test_fsdp_grad_acc.py
# Owner(s): ["oncall: distributed"] import contextlib import sys from functools import partial from itertools import product from typing import Any, Dict, List import torch import torch.cuda.nccl as nccl import torch.nn as nn import torch.nn.functional as F from torch import distributed as dist from torch.distributed...
pytorch-master
test/distributed/fsdp/test_fsdp_mixed_precision.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...
pytorch-master
test/distributed/fsdp/test_fsdp_freezing_weights.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...
pytorch-master
test/distributed/fsdp/test_fsdp_traversal.py
# Owner(s): ["oncall: distributed"] import sys from contextlib import suppress from enum import Enum, auto 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.full...
pytorch-master
test/distributed/fsdp/test_fsdp_comm.py
# Owner(s): ["oncall: distributed"] import torch from torch.distributed._shard.sharded_tensor import ( init_from_local_shards, Shard, ShardMetadata, ) from torch.distributed._shard.sharding_spec import ( ChunkShardingSpec, EnumerableShardingSpec, ) from torch.distributed.distributed_c10d import _ge...
pytorch-master
test/distributed/fsdp/test_shard_utils.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...
pytorch-master
test/distributed/fsdp/test_fsdp_memory.py
# Owner(s): ["oncall: distributed"] import sys import unittest import torch from torch import distributed as dist from torch.distributed.fsdp.flat_param import FlatParamShardMetadata from torch.distributed.fsdp.flatten_params_wrapper import FlattenParamsWrapper from torch.testing._internal.common_utils import TestCas...
pytorch-master
test/distributed/fsdp/test_flatten_params_wrapper.py
# Owner(s): ["oncall: distributed"] import functools import sys from collections import namedtuple from contextlib import suppress import torch import torch.distributed as dist import torch.nn as nn from torch.distributed.fsdp import FlatParameter from torch.distributed.fsdp import FullyShardedDataParallel as FSDP fr...
pytorch-master
test/distributed/fsdp/test_fsdp_misc.py
# Owner(s): ["oncall: distributed"] import functools import itertools import sys from typing import Any, 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 torch.distributed.fsdp.fully_sh...
pytorch-master
test/distributed/fsdp/test_fsdp_core.py
# Owner(s): ["oncall: distributed"] from copy import deepcopy from functools import partial import torch import torch.nn as nn from torch.distributed.algorithms._checkpoint.checkpoint_wrapper import ( checkpoint_wrapper, apply_activation_checkpointing_wrapper, CheckpointWrapper, CheckpointImpl ) from...
pytorch-master
test/distributed/fsdp/test_checkpoint_wrapper.py
# Owner(s): ["oncall: distributed"] import sys import tempfile import torch from torch import distributed as dist from torch.distributed._shard.checkpoint import ( FileSystemReader, FileSystemWriter, save_state_dict, load_state_dict, ) from torch.distributed.fsdp import ( FullyShardedDataParallel ...
pytorch-master
test/distributed/fsdp/test_distributed_checkpoint.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, Sequential from torch.optim import SGD from torch.testing._internal.common_distributed import skip_if_lt_x_gpu from...
pytorch-master
test/distributed/fsdp/test_fsdp_multiple_wrapping.py