/external/pytorch/aten/src/ATen/ |
D | autocast_mode.h | 13 TORCH_API bool is_autocast_enabled(at::DeviceType device_type); 14 TORCH_API void set_autocast_enabled(at::DeviceType device_type, bool enabled); 15 TORCH_API at::ScalarType get_autocast_dtype(at::DeviceType device_type); 17 at::DeviceType device_type, 63 #define DECLARE_DEPRECATED_AUTOCAST_APIS(name, device_type) … argument 66 … "_enabled() is deprecated. Please use at::autocast::is_autocast_enabled(" #device_type \ 72 … "() is deprecated. Please use at::autocast::is_autocast_enabled(" #device_type \ 74 … return is_autocast_enabled(device_type); \ 79 … "_enabled(enabled) is deprecated. Please use at::autocast::set_autocast_enabled(" #device_type \ 85 … "(enabled) is deprecated. Please use at::autocast::set_autocast_enabled(" #device_type \ [all …]
|
/external/pytorch/torch/amp/ |
D | autocast_mode.py | 28 def is_autocast_available(device_type: str) -> bool: 30 Return a bool indicating if autocast is available on :attr:`device_type`. 33 device_type(str): Device type to use. Possible values are: 'cuda', 'cpu', 'xpu' and so on. 37 return torch._C._is_autocast_available(device_type) 76 with torch.autocast(device_type="cuda"): 91 @torch.autocast(device_type="cuda") 109 with torch.autocast(device_type="cuda"): 131 with torch.autocast(device_type="cpu", dtype=torch.bfloat16): 144 with torch.autocast(device_type="cpu", dtype=torch.bfloat16): 188 with torch.autocast(device_type="cuda"): [all …]
|
/external/pytorch/test/distributed/tensor/parallel/ |
D | test_tp_style.py | 44 mesh = init_device_mesh(self.device_type, (self.world_size,)) 47 tensor = torch.rand(8, 16, device=self.device_type, requires_grad=True) 48 model = nn.Linear(16, 16, device=self.device_type) 85 mesh = init_device_mesh(self.device_type, (self.world_size,)) 88 tensor = torch.arange(8, device=self.device_type).reshape(4, 2) 89 model = nn.Embedding(16, 16, device=self.device_type) 106 mesh = init_device_mesh(self.device_type, (self.world_size,)) 110 8, 16 // self.world_size, device=self.device_type, requires_grad=True 112 model = nn.Linear(16, 16, device=self.device_type) 149 mesh = init_device_mesh(self.device_type, (self.world_size,)) [all …]
|
D | test_parallelize_api.py | 74 inp = torch.rand(*inp_size, device=self.device_type) 101 model = MLPModule(self.device_type) 105 device_mesh = DeviceMesh(self.device_type, torch.arange(self.world_size)) 120 OrderedDict([("dummy_encoder", MLPModule(self.device_type))]) 125 device_mesh = DeviceMesh(self.device_type, torch.arange(self.world_size)) 143 model = torch.nn.Linear(16, 10, device=self.device_type) 147 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 161 model = torch.nn.Linear(10, 16, device=self.device_type) 165 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 173 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) [all …]
|
/external/pytorch/test/distributed/ |
D | test_device_mesh.py | 40 device_type = "cuda" 42 device_type = "cpu" 43 return device_type 60 mesh = init_device_mesh(self.device_type, (self.world_size,)) 76 device_type = _get_device_type(self.world_size) 80 DeviceMesh(device_type, mesh_tensor) 89 device_mesh = DeviceMesh(self.device_type, mesh) 95 self.device_type, mesh_shape, mesh_dim_names=("dp", "tp") 116 self.device_type, mesh_shape, mesh_dim_names=("dp", "tp") 129 self.device_type, mesh_shape, mesh_dim_names=("dp", "tp") [all …]
|
/external/tensorflow/tensorflow/dtensor/python/ |
D | mesh_util.py | 34 device_type: str, mesh: layout.Mesh) -> None: 36 logging.info('Number of global %s devices: %d', device_type.upper(), 48 device_type: Optional[str] = None 52 if device_type is None: 53 device_type = 'CPU' 56 for d in tf_config.list_logical_devices(device_type) 60 if device_type is None: 61 device_type = devices[0].device_type 63 if device_type.upper() != devices[0].device_type.upper(): 65 f'Conflicting devices {str(devices)} and device_type {device_type}') [all …]
|
/external/tensorflow/tensorflow/python/framework/ |
D | device_spec.py | 38 def _as_device_str_or_none(device_type): argument 41 if device_type in ("cpu", "gpu"): 42 return device_type.upper() 43 return _as_str_or_none(device_type) 58 device_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0) 73 device_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0) 86 gpu0_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0) 90 with tf.device(DeviceSpec(device_type="GPU", device_index=1).to_string()): 111 device_type=None, argument 119 device_type: Optional device type string (e.g. "CPU" or "GPU") [all …]
|
D | device_spec_test.py | 40 device_type="CPU", device_index=2) 44 self.assertEqual("CPU", d.device_type) 48 d = device_spec_type(device_type="GPU", device_index=0) 58 d.device_type = "CPU" 64 d.device_type = "GPU" 67 d.device_type = "CPU" 70 d.device_type = None 76 device_type="GPU") 88 d = d.replace(device_type="CPU", device_index=0) 94 d = d.replace(device_type="GPU", device_index=2) [all …]
|
/external/pytorch/torch/csrc/distributed/c10d/ |
D | DMAConnectivity.cpp | 6 c10::DeviceType device_type, in get_detector_key() argument 9 oss << device_type << "/" << connection_type; in get_detector_key() 21 c10::DeviceType device_type, in register_detector() argument 24 auto key = get_detector_key(device_type, connection_type); in register_detector() 29 c10::DeviceType device_type, in detect() argument 31 auto key = get_detector_key(device_type, connection_type); in detect() 43 device_type, in detect() 72 c10::DeviceType device_type, in DMAConnectivity() argument 75 : device_type(device_type), in DMAConnectivity() 80 c10::DeviceType device_type, in register_dma_connectivity_detector() argument [all …]
|
/external/pytorch/torch/csrc/ |
D | Stream.cpp | 27 int64_t device_type = 0; in THPStream_pynew() local 33 "Stream(int64_t stream_id, int64_t device_index, int64_t device_type, *, int64_t priority=0)", in THPStream_pynew() 45 device_type = static_cast<int64_t>(device->type()); in THPStream_pynew() 53 device_type = static_cast<int64_t>( in THPStream_pynew() 56 static_cast<c10::DeviceType>(device_type)}; in THPStream_pynew() 64 device_type = in THPStream_pynew() 87 c10::impl::VirtualGuardImpl impl{static_cast<c10::DeviceType>(device_type)}; in THPStream_pynew() 89 c10::Device(static_cast<c10::DeviceType>(device_type), device_index), in THPStream_pynew() 95 static_cast<c10::DeviceType>(device_type)); in THPStream_pynew() 101 self->device_type = static_cast<int64_t>(stream_opt->device_type()); in THPStream_pynew() [all …]
|
/external/pytorch/test/distributed/_tensor/ |
D | test_dtensor.py | 61 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 98 meta_dtensor = torch.empty_like(meta_dtensor, device=self.device_type) 102 self.assertEqual(meta_dtensor.device.type, self.device_type) 106 meta_dtensor = torch.empty_like(meta_dtensor, device=self.device_type) 108 self.assertEqual(meta_dtensor.device.type, self.device_type) 121 model_tp.to_empty(device=self.device_type) 124 model_regular = DummyMLP(self.device_type) 131 inp = torch.randn(20, 5, device=self.device_type) 144 inp = torch.randn(20, 5, device=self.device_type) 149 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) [all …]
|
D | test_redistribute.py | 30 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 46 input_size, device=self.device_type, requires_grad=True 71 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 73 local_tensor = torch.randn(12, 3, device=self.device_type, requires_grad=True) 99 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 101 local_tensor = torch.randn(12, 3, device=self.device_type, requires_grad=True) 118 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 135 input_size, device=self.device_type, requires_grad=True 170 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 171 partial_local = torch.ones(12, 3, device=self.device_type, requires_grad=True) [all …]
|
D | test_api.py | 45 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 69 self.device_type, torch.arange(self.world_size).reshape(2, 2) 88 new_mesh = DeviceMesh(self.device_type, torch.arange(self.world_size)) 97 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 119 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 121 module_to_shard = MyModel(5 * self.world_size, 20, device=self.device_type) 139 module_to_replicate = MyModel(5, 20, device=self.device_type) 154 module_to_replicate = MyModel(5, 20, device=self.device_type) 171 module_to_distribute = MyModel(5 * self.world_size, 20, device=self.device_type) 182 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) [all …]
|
D | test_optimizers.py | 91 mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 135 mod = MLPModule(self.device_type) 145 inp = torch.ones(8, 10, device=self.device_type) 150 mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 211 mod = MLPModule(self.device_type) 221 inp = torch.ones(8, 10, device=self.device_type) 226 mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 251 mod = MLPModule(self.device_type) 261 inp = torch.ones(8, 10, device=self.device_type) 266 mesh = DeviceMesh(self.device_type, list(range(self.world_size))) [all …]
|
D | test_convolution_ops.py | 49 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 56 self.device_type 60 model_gt = copy.deepcopy(model).to(self.device_type) 69 inp = input_list[i].to(self.device_type).requires_grad_() 72 grad_output = grad_output_list[i].to(self.device_type) 83 inp = input_list[i].to(self.device_type).requires_grad_() 85 grad_output = grad_output_list[i].to(self.device_type) 119 device_mesh = DeviceMesh(self.device_type, list(range(self.world_size))) 126 self.device_type 130 model_gt = copy.deepcopy(model).to(self.device_type) [all …]
|
/external/trusty/arm-trusted-firmware/plat/arm/board/tc/fdts/ |
D | tc_spmc_manifest.dtsi | 33 device_type = "cpu"; 44 device_type = "cpu"; 51 device_type = "cpu"; 58 device_type = "cpu"; 65 device_type = "cpu"; 72 device_type = "cpu"; 79 device_type = "cpu"; 86 device_type = "cpu"; 95 device_type = "memory"; 101 device_type = "ns-memory"; [all …]
|
/external/tensorflow/tensorflow/core/framework/ |
D | device_factory.h | 34 static void Register(const std::string& device_type, 38 static void Register(const std::string& device_type, DeviceFactory* factory, in Register() argument 40 Register(device_type, std::unique_ptr<DeviceFactory>(factory), priority, in Register() 43 static DeviceFactory* GetFactory(const std::string& device_type); 96 // Return the device priority number for a "device_type" string. 108 static int32 DevicePriority(const std::string& device_type); 110 // Returns true if 'device_type' is registered from plugin. Returns false if 111 // 'device_type' is a first-party device. 112 static bool IsPluggableDevice(const std::string& device_type); 124 // implementation) to use for a specific 'device_type', the [all …]
|
/external/pytorch/torch/csrc/utils/ |
D | device_lazy_init.cpp | 15 bool is_device_initialized(at::DeviceType device_type) { in is_device_initialized() argument 17 return is_initialized[static_cast<int>(device_type)]; in is_device_initialized() 20 void device_lazy_init(at::DeviceType device_type) { in device_lazy_init() argument 26 if (is_device_initialized(device_type)) { in device_lazy_init() 36 std::string module_name = "torch." + at::DeviceTypeName(device_type, true); in device_lazy_init() 42 if (device_type == at::DeviceType::PrivateUse1) { in device_lazy_init() 55 is_initialized[static_cast<int>(device_type)] = true; in device_lazy_init() 58 void set_requires_device_init(at::DeviceType device_type, bool value) { in set_requires_device_init() argument 59 is_initialized[static_cast<int>(device_type)] = !value; in set_requires_device_init()
|
/external/autotest/client/common_lib/cros/manual/ |
D | cfm_helper_unittest.py | 36 For these testing purposes, we use the device_type ('cameras', etc.) 43 device_type = DEVICE_TYPES[i] 44 mock = self.create_mock_device_getter({device_type: i + 1}) 45 setattr(cfm_helper.get_usb_devices, 'get_%s' % device_type, mock) 52 device_type = DEVICE_TYPES[i] 53 self.assertEqual(peripherals[device_type], i + 1) 57 for device_type in DEVICE_TYPES: 58 original_func = getattr(get_usb_devices, 'get_%s' % device_type) 59 setattr(cfm_helper.get_usb_devices, 'get_%s' % device_type,
|
/external/tensorflow/tensorflow/core/common_runtime/device/ |
D | device_id_manager_test.cc | 34 DeviceType device_type("GPU"); in TEST() local 37 TF_ASSERT_OK(DeviceIdManager::InsertTfPlatformDeviceIdPair(device_type, key_0, in TEST() 39 EXPECT_EQ(value_0, TfToPlatformDeviceId(device_type, key_0)); in TEST() 42 TF_ASSERT_OK(DeviceIdManager::InsertTfPlatformDeviceIdPair(device_type, key_0, in TEST() 44 EXPECT_EQ(value_0, TfToPlatformDeviceId(device_type, key_0)); in TEST() 49 TF_ASSERT_OK(DeviceIdManager::InsertTfPlatformDeviceIdPair(device_type, key_1, in TEST() 51 EXPECT_EQ(value_1, TfToPlatformDeviceId(device_type, key_1)); in TEST() 55 TF_ASSERT_OK(DeviceIdManager::InsertTfPlatformDeviceIdPair(device_type, key_2, in TEST() 57 EXPECT_EQ(value_1, TfToPlatformDeviceId(device_type, key_2)); in TEST() 61 DeviceIdManager::InsertTfPlatformDeviceIdPair(device_type, key_2, value_0) in TEST() [all …]
|
/external/pytorch/torch/testing/_internal/ |
D | common_device_type.py | 264 # (2) Define the "device_type" attribute of the base to be the 338 device_type: str = "generic_device_type" variable in DeviceTypeTestBase 368 return cls.device_type 401 return test.dtypes.get(cls.device_type, default_dtypes) 511 cls.device_type 512 if cls.device_type != "privateuse1" 546 device_type = "cpu" variable in CPUTestBase 554 device_type = "cuda" variable in CUDATestBase 602 device_type = "lazy" variable in LazyTestBase 621 device_type = "mps" variable in MPSTestBase [all …]
|
/external/pytorch/test/distributed/_tensor/experimental/ |
D | test_local_map.py | 74 device_type=self.device_type, mesh_shape=(self.world_size,) 79 X = torch.randn(16, 8, device=self.device_type, requires_grad=False) 80 W = torch.randn(8, 12, device=self.device_type, requires_grad=False) 129 device_type=self.device_type, mesh_shape=(self.world_size,) 134 X = torch.randn(8, 8, device=self.device_type, requires_grad=False) 135 Y = torch.randn(8, 8, device=self.device_type, requires_grad=False) 152 4 // self.world_size, 4, device=self.device_type, requires_grad=False 154 W = torch.randn(4, 4, device=self.device_type, requires_grad=False) 175 device_type=self.device_type, mesh_shape=(self.world_size,) 180 X = torch.randn(16, 8, device=self.device_type, requires_grad=False) [all …]
|
/external/pytorch/torch/ |
D | random.py | 131 device_type="cuda", argument 146 device_type (str): device type str, default is `cuda`. As for custom device, 150 device_type = torch.device(device_type).type 151 device_mod = getattr(torch, device_type, None) 154 f"torch has no module of `{device_type}`, you should register " 171 f"{device_type.upper()} reports that you have {num_devices} available devices, and " 173 … f"For safety, we initialize *every* {device_type.upper()} device by default, which can " 174 … f"be quite slow if you have a lot of {device_type.upper()}s. If you know that you are only" 175 f" making use of a few {device_type.upper()} devices, set the environment variable " 176 … f"{device_type.upper()}_VISIBLE_DEVICES or the '{_devices_kw}' keyword argument of {_caller} " [all …]
|
/external/tensorflow/tensorflow/core/grappler/optimizers/ |
D | custom_graph_optimizer_registry.cc | 36 // device_type as its key, and an optimizer creator as the value. 46 // device_type as its key, and ConfigList as the value. 114 LOG(INFO) << "Plugin optimizer for device_type " << it->first in CreateOptimizers() 123 const Creator& optimizer_creator, const std::string& device_type, in RegisterPluginOptimizerOrDie() argument 125 auto ret = GetPluginConfigMap()->insert({device_type, configs}); in RegisterPluginOptimizerOrDie() 127 LOG(FATAL) << "PluginGraphOptimizer with device_type " // Crash OK in RegisterPluginOptimizerOrDie() 128 << device_type << " is registered twice."; in RegisterPluginOptimizerOrDie() 130 GetPluginRegistrationMap()->insert({device_type, optimizer_creator}); in RegisterPluginOptimizerOrDie() 138 for (const auto& device_type : device_types) { in PrintPluginConfigsIfConflict() local 139 const auto it = GetPluginConfigMap()->find(device_type); in PrintPluginConfigsIfConflict() [all …]
|
/external/arm-trusted-firmware/plat/arm/board/tc/fdts/ |
D | tc_spmc_manifest.dts | 60 device_type = "cpu"; 71 device_type = "cpu"; 78 device_type = "cpu"; 85 device_type = "cpu"; 92 device_type = "cpu"; 99 device_type = "cpu"; 106 device_type = "cpu"; 113 device_type = "cpu"; 122 device_type = "memory";
|