| /external/pytorch/aten/src/ATen/mps/ |
| D | MPSHooks.mm | 3 #include <ATen/mps/MPSAllocatorInterface.h> 4 #include <ATen/mps/MPSDevice.h> 5 #include <ATen/mps/MPSGeneratorImpl.h> 6 #include <ATen/mps/MPSHooks.h> 7 #include <ATen/mps/MPSProfiler.h> 8 #include <ATen/mps/MPSStream.h> 11 namespace at::mps { 14 C10_LOG_API_USAGE_ONCE("aten.init.mps"); 15 // TODO: initialize MPS devices and streams here 19 return at::mps::is_available(); [all …]
|
| D | MPSGuardImpl.h | 8 #include <ATen/mps/MPSStream.h> 9 #include <ATen/mps/MPSEvent.h> 27 namespace at::mps { 34 static constexpr c10::DeviceType static_type = c10::DeviceType::MPS; 39 TORCH_INTERNAL_ASSERT(t == c10::DeviceType::MPS); in MPSGuardImpl() 44 return c10::DeviceType::MPS; in type() 48 return Device(c10::DeviceType::MPS, 0); in exchangeDevice() 52 return Device(c10::DeviceType::MPS, 0); in getDevice() 56 return Device(c10::DeviceType::MPS, 0); in uncheckedGetDevice() 68 return Stream(Stream::DEFAULT, Device(c10::DeviceType::MPS, 0)); in getStream() [all …]
|
| D | EmptyTensor.cpp | 7 #include <ATen/mps/EmptyTensor.h> 8 #include <ATen/mps/MPSDevice.h> 11 #include <ATen/native/mps/Copy.h> 13 #define MPS_ERROR_NOT_COMPILED "PyTorch code is not compiled with MPS enabled" 15 "The MPS backend is supported on MacOS 12.3+.", \ 17 #define MPS_ERROR_DOUBLE_NOT_SUPPORTED "Cannot convert a MPS Tensor to float64 dtype " \ 18 "as the MPS framework doesn't support float64. Please use float32 instead." 32 TORCH_INTERNAL_ASSERT_DEBUG_ONLY(device.type() == DeviceType::MPS); in empty_mps() 36 "only strided tensors are supported on MPS"); in empty_mps() 38 …TORCH_CHECK(size.size() <= 16, "MPS supports tensors with dimensions <= 16, but got ", size.size()… in empty_mps() [all …]
|
| D | MPSDevice.mm | 5 #include <ATen/mps/IndexKernels.h> 6 #include <ATen/mps/MPSAllocatorInterface.h> 7 #include <ATen/mps/MPSDevice.h> 8 #include <ATen/mps/MPSStream.h> 9 #include <ATen/native/mps/MPSGraphSequoiaOps.h> 11 namespace at::mps { 17 …// MPS Advanced Indexing needs at least Metal 2.0 (support for Argument Buffers and function const… 41 …_mtl_indexing_library = [_mtl_device newLibraryWithSource:[NSString stringWithCString:mps::indexin… 78 // Check that MacOS 13.0+ version of MPS framework is available 80 // which is used by MPS backend. [all …]
|
| /external/executorch/backends/apple/mps/ |
| D | setup.md | 1 # Building and Running ExecuTorch with MPS Backend 3 In this tutorial we will walk you through the process of getting setup to build the MPS backend for… 5 …MPS backend device maps machine learning computational graphs and primitives on the [MPS Graph](ht… 8 :::{grid-item-card} What you will learn in this tutorial: 9 :class-card: card-prerequisites 10 … [MobileNet V3](https://pytorch.org/vision/main/models/mobilenetv3.html) model to the MPS delegate. 11 * You will also learn how to compile and deploy the ExecuTorch runtime with the MPS delegate on mac… 13 :::{grid-item-card} Tutorials we recommend you complete before this: 14 :class-card: card-prerequisites 15 * [Introduction to ExecuTorch](intro-how-it-works.md) [all …]
|
| /external/executorch/examples/apple/mps/ |
| D | README.md | 1 This README gives some examples on backend-specific model workflow. 3 # MPS Backend 5 [MPS](https://developer.apple.com/documentation/metalperformanceshaders) is a framework of highly o… 6 **MPS** backend takes advantage of [MPSGraph](https://developer.apple.com/documentation/metalperfor… 11 - [Setting up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup). 12 - [Setting up MPS backend](../../../backends/apple/mps/setup.md). 14 ## Delegation to MPS backend 16 The following command will lower the EdgeIR to MPS delegate: 20 python3 -m examples.apple.mps.scripts.mps_example --model_name="mv2" --bundled 22 To see all the options when exporting a model to MPS delegate, use the following command: [all …]
|
| /external/pytorch/docs/source/notes/ |
| D | mps.rst | 1 .. _MPS-Backend: 3 MPS backend 6 :mod:`mps` device enables high-performance 12 The new MPS backend extends the PyTorch ecosystem and provides existing scripts 15 To get started, simply move your Tensor and Module to the ``mps`` device: 19 # Check that MPS is available 20 if not torch.backends.mps.is_available(): 21 if not torch.backends.mps.is_built(): 22 print("MPS not available because the current PyTorch install was not " 23 "built with MPS enabled.") [all …]
|
| /external/pytorch/aten/src/ATen/native/mps/operations/ |
| D | BinaryOps.mm | 6 #include <ATen/native/mps/OperationUtils.h> 7 #include <ATen/native/mps/operations/BinaryKernel.h> 44 namespace mps { 54 …MPSGraphTensor*(mps::BinaryOpCachedGraph * graph, MPSGraphTensor * primary, MPSGraphTensor * secon… 57 // Convert non-complex types (and cdouble CPU scalars) to cfloat 75 "MPS: ", 78 TORCH_CHECK_TYPE(!isComplexType(self.scalar_type()) || mps::supportsComplex(), 112 newCachedGraph->primaryTensor = 114 newCachedGraph->secondaryTensor = 117 MPSGraphTensor* primaryCastTensor = newCachedGraph->primaryTensor; [all …]
|
| D | UnaryOps.mm | 3 #include <ATen/native/mps/Copy.h> 4 #include <ATen/native/mps/MPSGraphSonomaOps.h> 5 #include <ATen/native/mps/MPSGraphVenturaOps.h> 6 #include <ATen/native/mps/OperationUtils.h> 67 namespace mps { 89 newCachedGraph->inputTensor_ = mpsGraphRankedPlaceHolder(mpsGraph, self); 90 MPSGraphTensor* castTensor = newCachedGraph->inputTensor_; 93 castTensor = castMPSTensor(mpsGraph, newCachedGraph->inputTensor_, output.scalar_type()); 95 newCachedGraph->outputTensor_ = unaryBlock(mpsGraph, castTensor); 98 // If self is non-densely mapped in storage, create a dense output-like representation [all …]
|
| D | GridSampler.mm | 3 #include <ATen/native/mps/MPSGraphVenturaOps.h> 4 #include <ATen/native/mps/OperationUtils.h> 15 namespace mps { 23 using namespace mps; 40 TORCH_CHECK(false, "MPS: Unsupported Border padding mode"); 46 TORCH_CHECK(false, "MPS: Unrecognised Padding Mode: ", padding_mode); 57 TORCH_CHECK(false, "MPS: Unsupported Bicubic interpolation"); 60 TORCH_CHECK(false, "MPS: Unrecognised interpolation mode: ", interpolation_mode); 110 newCachedGraph->inputTensor_ = inputTensor; 111 newCachedGraph->gridTensor_ = gridTensor; [all …]
|
| D | LinearAlgebra.mm | 4 #include <ATen/mps/MPSProfiler.h> 8 #include <ATen/native/mps/MPSGraphSequoiaOps.h> 9 #include <ATen/native/mps/MPSGraphSonomaOps.h> 10 #include <ATen/native/mps/OperationUtils.h> 31 namespace mps { 86 auto device = MPSDevice::getInstance()->device(); 87 …auto matmulPSO = lib.getPipelineStateForFunc("naive_matmul_" + mps::scalarToMetalTypeString(output… 88 dispatch_sync_with_rethrow(stream->queue(), ^() { 91 auto computeEncoder = stream->commandEncoder(); 139 using namespace mps; [all …]
|
| D | Distributions.mm | 4 #include <ATen/mps/MPSGeneratorImpl.h> 8 #include <ATen/native/mps/MPSGraphVenturaOps.h> 9 #include <ATen/native/mps/OperationUtils.h> 31 namespace mps { 44 #define RandomOpFn(graph, randomTensor) MPSGraphTensor*(mps::RandomCachedGraph * graph, MPSGraphTen… 61 …auto mps_gen = get_generator_or_default<MPSGeneratorImpl>(gen, at::mps::detail::getDefaultMPSGener… 68 newCachedGraph->stateTensor = 69 … mpsGraphRankedPlaceHolder(mpsGraph, MPSDataTypeInt32, @[ @(at::mps::detail::PHILOX_STATE_N) ]); 71 // FP16, FP32 and Int32 are the only data types supported for distributions on MPS backend. 100 … stateTensor:newCachedGraph->stateTensor [all …]
|
| D | UpSample.mm | 4 #include <ATen/native/mps/MPSGraphVenturaOps.h> 5 #include <ATen/native/mps/OperationUtils.h> 37 namespace mps { 40 // supported resize_mode: 'nearest' | 'bilinear' | 'nearest-exact' 73 } else if (resize_mode_str == "nearest-exact") { 81 …output_height = output_size.size() > 1 ? output_size[0] : (output.dim() > 2 ? output.size(-2) : 1); 84 const float offset_y = centerResults ? (scale_h - 1.0f) / 2.0f : 0.0f; 85 const float offset_x = centerResults ? (scale_w - 1.0f) / 2.0f : 0.0f; 105 newCachedGraph->inputTensor = mpsGraphRankedPlaceHolder(mpsGraph, input); 106 …newCachedGraph->outputSizeTensor = mpsGraphRankedPlaceHolder(mpsGraph, MPSDataTypeInt32, @[ @(2) ]… [all …]
|
| D | Pad.mm | 3 #include <ATen/native/mps/OperationUtils.h> 25 namespace mps { 58 int dim_h = padding_dim - 1; 59 int dim_d = padding_dim - 2; 71 dim_w--; 72 dim_h--; 73 dim_d--; 75 const int dim_diff = (int)ndims - padding_dim - 1; 77 padding_dim += dim_diff - 1; 103 TORCH_CHECK(output_w >= 1 || output_h >= padding_dim - 1, [all …]
|
| /external/pytorch/test/ |
| D | test_mps.py | 1 # Owner(s): ["module: mps"] 29 import torch.backends.mps 125 # cpu error: grad requires non-empty inputs 161 # Failures due to precision issues (due to fast-math). These has been fixed in MacOS 13.3+ 171 …ss for `sort` both are used (values and indices), thus resulting in a issmatch between CPU and MPS. 190 …ss for `sort` both are used (values and indices), thus resulting in a issmatch between CPU and MPS. 196 # Failures due to lack of implementation of downstream functions on MPS backend 200 # Exception: Caused by sample input at index 3 on MPS 204 def addDecorator(op, d) -> None: 225 if key in MACOS_12_3_XFAILLIST_GRAD and (not torch.backends.mps.is_macos13_or_newer()): [all …]
|
| /external/pytorch/torch/mps/ |
| D | __init__.py | 1 # mypy: allow-untyped-defs 3 This package enables an interface for accessing MPS (Metal Performance Shaders) backend in Python. 4 Metal is Apple's API for programming metal GPU (graphics processor unit). Using MPS means that incr… 19 def _get_default_mps_generator() -> torch._C.Generator: 26 def device_count() -> int: 27 r"""Returns the number of available MPS devices.""" 31 def synchronize() -> None: 32 r"""Waits for all kernels in all streams on a MPS device to complete.""" 36 def get_rng_state(device: Union[int, str, torch.device] = "mps") -> Tensor: 41 Default: ``'mps'`` (i.e., ``torch.device('mps')``, the current MPS device). [all …]
|
| /external/pigweed/pw_bluetooth_proxy/ |
| D | utils_test.cc | 7 // https://www.apache.org/licenses/LICENSE-2.0 30 // Validate the segmentation of `expected_payload` based on every MPS from 2 in TEST() 32 for (size_t mps = 2; mps < expected_payload.size() + 5; ++mps) { in TEST() local 37 std::min(mps, expected_payload.size() + kSduLengthFieldSize); in TEST() 38 // Only if total L2CAP PDU payload bytes to be sent are greater than MPS in TEST() 40 if (mps < pdu_total_length) { in TEST() 41 total_num_segments = pdu_total_length / mps; in TEST() 42 // Account for the final segment, which may be sub-MPS sized and not in TEST() 44 if (pdu_total_length % mps != 0) { in TEST() 46 final_segment_payload_size = pdu_total_length % mps; in TEST() [all …]
|
| /external/executorch/backends/apple/mps/runtime/ |
| D | MPSCompiler.mm | 6 // Obj-C headers 11 // MPS headers 12 #include <executorch/backends/apple/mps/runtime/MPSDevice.h> 13 #include <executorch/backends/apple/mps/runtime/MPSCompiler.h> 14 #include <executorch/backends/apple/mps/runtime/MPSGraphBuilder.h> 15 #include <executorch/backends/apple/mps/schema_generated.h> 28 namespace mps { 37 Builds the mps runtime object using the buffer pointer. The buffer pointer 38 must be a valid pointer to the serialized mps object. 51 new MPSGraphBuilder(buffer_pointer, num_bytes, executor->_mpsGraphTensorToId)); [all …]
|
| /external/pytorch/.github/workflows/ |
| D | mac-mps.yml | 1 name: Mac MPS 6 - ciflow/mps/* 10 …${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_t… 11 cancel-in-progress: true 13 permissions: read-all 16 macos-py3-arm64-build: 17 name: macos-py3-arm64 18 uses: ./.github/workflows/_mac-build.yml 20 sync-tag: macos-py3-arm64-build 21 build-environment: macos-py3-arm64 [all …]
|
| /external/openthread/third_party/mbedtls/repo/library/ |
| D | mps_common.h | 3 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 9 * \brief Common functions and macros used by MPS 20 * \name SECTION: MPS Configuration 25 /*! This flag controls whether the MPS-internal components 26 * (reader, writer, Layer 1-3) perform validation of the 29 * Context: All MPS API functions impose assumptions/preconditions on the 32 * calls to the MPS API which satisfy their preconditions and either succeed, 38 * In addition to state integrity, all MPS structures have a more refined 47 * non-sensical calls or not, and that's what this option is about: 68 /*! This flag enables/disables assertions on the internal state of MPS. [all …]
|
| /external/mbedtls/library/ |
| D | mps_common.h | 3 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 9 * \brief Common functions and macros used by MPS 20 * \name SECTION: MPS Configuration 25 /*! This flag controls whether the MPS-internal components 26 * (reader, writer, Layer 1-3) perform validation of the 29 * Context: All MPS API functions impose assumptions/preconditions on the 32 * calls to the MPS API which satisfy their preconditions and either succeed, 38 * In addition to state integrity, all MPS structures have a more refined 47 * non-sensical calls or not, and that's what this option is about: 68 /*! This flag enables/disables assertions on the internal state of MPS. [all …]
|
| /external/pytorch/torch/backends/mps/ |
| D | __init__.py | 1 # mypy: allow-untyped-defs 12 def is_built() -> bool: 13 r"""Return whether PyTorch is built with MPS support. 15 Note that this doesn't necessarily mean MPS is available; just that 16 if this PyTorch binary were run a machine with working MPS drivers 23 def is_available() -> bool: 24 r"""Return a bool indicating if MPS is currently available.""" 29 def is_macos_or_newer(major: int, minor: int) -> bool: 30 r"""Return a bool indicating whether MPS is running on given MacOS or newer.""" 35 def is_macos13_or_newer(minor: int = 0) -> bool: [all …]
|
| /external/pytorch/docs/source/ |
| D | mps.rst | 1 torch.mps 3 .. automodule:: torch.mps 4 .. currentmodule:: torch.mps 22 MPS Profiler 23 ------------ 32 MPS Event 33 ------------ 43 .. py:module:: torch.mps.event 44 .. py:module:: torch.mps.profiler
|
| D | mps_environment_variables.rst | 3 MPS Environment Variables 8 .. list-table:: 9 :header-rows: 1 11 * - Variable 12 - Description 13 * - ``PYTORCH_DEBUG_MPS_ALLOCATOR`` 14 - If set to ``1``, set allocator logging level to verbose. 15 * - ``PYTORCH_MPS_LOG_PROFILE_INFO`` 16 …- Set log options bitmask to ``MPSProfiler``. See ``LogOptions`` enum in `aten/src/ATen/mps/MPSPro… 17 * - ``PYTORCH_MPS_TRACE_SIGNPOSTS`` [all …]
|
| /external/pigweed/pw_bluetooth_sapphire/host/l2cap/ |
| D | le_dynamic_channel_test.cc | 7 // https://www.apache.org/licenses/LICENSE-2.0 41 LowerBits(payload.mps), in LeConnReq() 42 UpperBits(payload.mps), in LeConnReq() 52 LowerBits(payload.mps), in LeConnRsp() 53 UpperBits(payload.mps), in LeConnRsp() 121 registry()->OpenOutbound( in DoOpenOutbound() 148 sig()->ReceiveExpect( in DoOpenInbound() 168 registry()->CloseChannel(request.src_cid, in DoCloseOutbound() 226 return DynamicChannelRegistry::ServiceInfo(iter->second.channel_params, in OnServiceRequest() 227 iter->second.channel_cb.share()); in OnServiceRequest() [all …]
|