| /external/pytorch/aten/src/ATen/native/quantized/ |
| D | library.cpp | 12 TORCH_LIBRARY(quantized, m) { in TORCH_LIBRARY() argument 19 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add(Tensor qa, Tensor qb, float scale, int zero_point) ->… in TORCH_LIBRARY() 20 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add.out(Tensor qa, Tensor qb, Tensor(a!) out) -> Tensor(a… in TORCH_LIBRARY() 21 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add.Scalar(Tensor qa, Scalar b) -> Tensor qc"), {at::Tag:… in TORCH_LIBRARY() 22 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add.Scalar2(Scalar b, Tensor qa) -> Tensor qc"), {at::Tag… in TORCH_LIBRARY() 23 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add.Scalar_out(Tensor qa, Scalar b, Tensor(a!) out) -> Te… in TORCH_LIBRARY() 24 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add_relu(Tensor qa, Tensor qb, float scale, int zero_poin… in TORCH_LIBRARY() 25 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add_relu.Scalar(Tensor qa, Scalar b) -> Tensor qc"), {at:… in TORCH_LIBRARY() 26 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add_relu.Scalar2(Scalar b, Tensor qa) -> Tensor qc"), {at… in TORCH_LIBRARY() 27 …m.def(TORCH_SELECTIVE_SCHEMA("quantized::add_relu.out(Tensor qa, Tensor qb, Tensor(a!) out) -> Ten… in TORCH_LIBRARY() [all …]
|
| D | README.md | 1 The quantized folder holds the implementation of the low-level quantized kernel. 2 The kernels are registered in `torch::_ops` namespace, and operate on the quantized `at::Tensor` da… 3 …arn more about the quantized tensors in the [quantized tensor API wiki](https://github.com/pytorch… 5 This document serves as an entry point for quantized kernel implementation. 7 ## Implementing native quantized ops 9 The new quantized ops are almost always located under the `ATen/native/quantized/cpu` folder. For 10 the sake of an example, let us implement an element-wise quantized [logical XAND](https://en.wiktio… 11 operation under `ATen/native/quantized/cpu/qxand.cpp`. 13 ### Step 0. Implement the quantized function 15 Before writing the quantized kernel and registering it, let us implement a quantized function. [all …]
|
| D | qconv_unpack.cpp | 17 #include <ATen/native/quantized/cpu/fbgemm_utils.h> 18 #include <ATen/native/quantized/cpu/QnnpackUtils.h> 19 #include <ATen/native/quantized/cpu/OnednnUtils.h> 20 #include <ATen/native/quantized/cpu/QuantUtils.h> 21 #include <ATen/native/quantized/PackedParams.h> 67 "quantized::conv2d_unpack (qnnpack): QNNPACK only supports Conv2d " in run() 81 "Didn't find engine for operation quantized::conv2d_unpack ", in run() 122 "Didn't find engine for operation quantized::conv1d_unpack ", in run() 198 TORCH_LIBRARY_IMPL(quantized, CatchAll, m) { in TORCH_LIBRARY_IMPL() argument 202 m.impl(TORCH_SELECTIVE_NAME("quantized::conv_unpack"), TORCH_FN(QConvUnpackWeightsInt8<2>::run)); in TORCH_LIBRARY_IMPL() [all …]
|
| D | qlinear_unpack.cpp | 10 #include <ATen/native/quantized/cpu/fbgemm_utils.h> 11 #include <ATen/native/quantized/PackedParams.h> 12 #include <ATen/native/quantized/cpu/QnnpackUtils.h> 38 "quantized::linear_unpack_fp16 is currently " in run() 50 "quantized.linear_unpack(Tensor) is unsupported! Please " in run() 51 "upgrade your model to use the newer quantized.linear_" in run() 61 "quantized.linear_unpack(Tensor) is unsupported! Please " in run() 62 "upgrade your model to use the newer quantized.linear_" in run() 67 TORCH_LIBRARY_IMPL(quantized, CPU, m) { in TORCH_LIBRARY_IMPL() argument 68 …m.impl(TORCH_SELECTIVE_NAME("quantized::linear_unpack.legacy"), TORCH_FN(QLinearUnpackWeightInt8Le… in TORCH_LIBRARY_IMPL() [all …]
|
| /external/pytorch/test/quantization/eager/ |
| D | test_numeric_suite_eager.py | 6 import torch.ao.nn.quantized as nnq 98 r"""Compare the weights of float and static quantized conv layer""" 100 qengine = torch.backends.quantized.engine 108 self.assertTrue(v["float"].shape == v["quantized"].shape) 120 r"""Compare the weights of float and static quantized linear layer""" 122 qengine = torch.backends.quantized.engine 130 self.assertTrue(v["float"].shape == v["quantized"].shape) 142 r"""Compare the weights of float and dynamic quantized linear layer""" 144 qengine = torch.backends.quantized.engine 152 self.assertTrue(len(v["float"]) == len(v["quantized"])) [all …]
|
| /external/pytorch/torch/ao/nn/quantized/ |
| D | functional.py | 2 r""" Functional interface (quantized).""" 59 See :class:`~torch.ao.nn.quantized.AvgPool2d` for details and output shape. 62 input: quantized input tensor :math:`(\text{minibatch} , \text{in\_channels} , iH , iW)` 77 raise ValueError("Input to 'quantized.avg_pool2d' must be quantized!") 106 input: quantized input tensor :math:`(\text{minibatch} , \text{in\_channels} , iH , iW)` 121 raise ValueError("Input to 'quantized.avg_pool3d' must be quantized!") 135 Applies a 2D adaptive average pooling over a quantized input signal composed 136 of several quantized input planes. 140 See :class:`~torch.ao.nn.quantized.AdaptiveAvgPool2d` for details and output shape. 148 "Input to 'quantized.functional.adaptive_avg_pool2d' must be quantized!" [all …]
|
| /external/executorch/kernels/quantized/test/ |
| D | targets.bzl | 6 op_test("op_quantize_test", kernel_name = "quantized") 7 op_test("op_dequantize_test", kernel_name = "quantized") 8 op_test("op_choose_qparams_test", kernel_name = "quantized") 9 op_test("op_add_test", kernel_name = "quantized", deps = [ 10 "//executorch/kernels/quantized/cpu:op_dequantize", 11 "//executorch/kernels/quantized/cpu:op_quantize", 12 "//executorch/kernels/quantized/cpu:op_add", 13 "//executorch/kernels/quantized:generated_lib_headers", 18 op_test("op_embedding_test", kernel_name = "quantized", deps = [ 19 "//executorch/kernels/quantized/cpu:op_dequantize", [all …]
|
| /external/tensorflow/tensorflow/lite/toco/ |
| D | types.proto | 23 // Float32, not quantized 26 // Uint8, quantized 29 // Int32, not quantized 32 // Int64, not quantized 35 // String, not quantized 38 // Int16, quantized 44 // Complex64, not quantized 47 // Int8, quantized based on QuantizationParameters in schema. 50 // Half precision float, not quantized. 53 // Double precision float, not quantized. [all …]
|
| /external/pytorch/torch/csrc/jit/passes/quantization/ |
| D | quantization_patterns.h | 136 // quant fusion for ops like `quantized::add_scalar`, `quantized::mul_scalar` 290 %w_quant : Tensor, %b : Tensor? = quantized::conv1d_unpack(%packed_params) in quant_fusion_pattern_and_replacements() 300 %w_quant : Tensor, %b : Tensor? = quantized::conv1d_unpack(%packed_params) in quant_fusion_pattern_and_replacements() 311 %w_quant : Tensor, %b : Tensor? = quantized::conv1d_unpack(%packed_params) in quant_fusion_pattern_and_replacements() 318 // quantized::conv1d in quant_fusion_pattern_and_replacements() 321 %r_quant = quantized::conv1d(%a_quant, %packed_params, %r_scale, %r_zero_point) in quant_fusion_pattern_and_replacements() 324 // quantized::conv1d_relu in quant_fusion_pattern_and_replacements() 327 %r_quant = quantized::conv1d_relu(%a_quant, %packed_params, %r_scale, %r_zero_point) in quant_fusion_pattern_and_replacements() 334 %w_quant : Tensor, %b : Tensor? = quantized::conv2d_unpack(%packed_params) in quant_fusion_pattern_and_replacements() 344 %w_quant : Tensor, %b : Tensor? = quantized::conv2d_unpack(%packed_params) in quant_fusion_pattern_and_replacements() [all …]
|
| /external/pytorch/torch/ao/ns/ |
| D | _numeric_suite.py | 5 import torch.ao.nn.quantized as nnq 6 import torch.ao.nn.quantized.dynamic as nnqd 58 r"""Compare the weights of the float module with its corresponding quantized 60 a dictionary with two keys 'float' and 'quantized', containing the float and 61 quantized weights. This dict can be used to compare and compute the quantization 62 error of the weights of float and quantized models. 73 wt_compare_dict[key]['quantized'].dequantize() 79 quantized_dict: state dict of the quantized model 83 a dictionary with two keys 'float' and 'quantized', containing the float and 84 quantized weights [all …]
|
| /external/pytorch/torch/nn/quantized/modules/ |
| D | __init__.py | 1 r"""Quantized Modules. 4 The `torch.nn.quantized` namespace is in the process of being deprecated. 5 Please, use `torch.ao.nn.quantized` instead. 10 # s.a. `from torch.nn.quantized.modules.conv import ...`. 12 from torch.ao.nn.quantized.modules import ( 27 from torch.ao.nn.quantized.modules.activation import ( 37 from torch.ao.nn.quantized.modules.batchnorm import BatchNorm2d, BatchNorm3d 38 from torch.ao.nn.quantized.modules.conv import ( 46 from torch.ao.nn.quantized.modules.dropout import Dropout 47 from torch.ao.nn.quantized.modules.embedding_ops import Embedding, EmbeddingBag [all …]
|
| /external/pytorch/docs/source/ |
| D | quantization.rst | 16 tensors at lower bitwidths than floating point precision. A quantized model 24 speed up inference and only the forward pass is supported for quantized 35 At lower level, PyTorch provides a way to represent quantized tensors and 51 (1). Programmable API for configuring how a model is quantized that can scale to many more use cases 53 …reference quantized model representation that can represent quantized computation with integer ope… 105 1. dynamic quantization (weights quantized with activations read/stored in 106 floating point and quantized for compute) 107 2. static quantization (weights quantized, activations quantized, calibration 109 3. static quantization aware training (weights quantized, activations quantized, 156 quantized ahead of time but the activations are dynamically quantized [all …]
|
| D | quantization-support.rst | 182 Quantized Tensors support a limited subset of data manipulation methods of the 316 then be quantized. 366 torch.ao.nn.intrinsic.quantized 368 .. automodule:: torch.ao.nn.intrinsic.quantized 369 .. automodule:: torch.ao.nn.intrinsic.quantized.modules 372 This module implements the quantized implementations of fused operations 376 .. currentmodule:: torch.ao.nn.intrinsic.quantized 390 torch.ao.nn.intrinsic.quantized.dynamic 392 .. automodule:: torch.ao.nn.intrinsic.quantized.dynamic 393 .. automodule:: torch.ao.nn.intrinsic.quantized.dynamic.modules [all …]
|
| /external/pytorch/test/quantization/ao_migration/ |
| D | test_ao_migration.py | 8 r"""Tests the migration of the torch.nn.quantized.functional""" 33 self._test_function_import("functional", function_list, base="nn.quantized") 69 self._test_function_import("modules", module_list, base="nn.quantized") 81 "activation", function_list, base="nn.quantized.modules" 90 "batchnorm", function_list, base="nn.quantized.modules" 104 self._test_function_import("conv", function_list, base="nn.quantized.modules") 111 "dropout", function_list, base="nn.quantized.modules" 121 "embedding_ops", function_list, base="nn.quantized.modules" 131 "functional_modules", function_list, base="nn.quantized.modules" 139 self._test_function_import("linear", function_list, base="nn.quantized.modules") [all …]
|
| /external/pytorch/torch/ao/quantization/fx/ |
| D | _lower_to_native_backend.py | 7 import torch.ao.nn.intrinsic.quantized as nniq 8 import torch.ao.nn.intrinsic.quantized.dynamic as nniqd 9 import torch.ao.nn.quantized as nnq 10 import torch.ao.nn.quantized.dynamic as nnqd 11 import torch.ao.nn.quantized.reference as nnqr 14 from torch.ao.nn.quantized.modules.utils import WeightedQuantizedModule 32 torch._ops.ops.quantized.hardswish: ["inplace"], 33 torch._ops.ops.quantized.elu: ["inplace"], 34 torch._ops.ops.quantized.dropout: ["inplace"], 35 torch._ops.ops.quantized.instance_norm: [ [all …]
|
| /external/ComputeLibrary/arm_compute/core/ |
| D | QuantizationInfo.h | 38 using qasymm8_signed_t = int8_t; /**< 8 bit signed quantized asymmetric scalar value */ 39 using qasymm8_t = uint8_t; /**< 8 bit quantized asymmetric scalar value */ 40 using qsymm16_t = int16_t; /**< 16 bit quantized symmetric scalar value */ 41 using qasymm16_t = uint16_t; /**< 16 bit quantized asymmetric scalar value */ 216 "quantized type should be either uint8_t or int8_t."); 223 * @return Quantized value 228 const int quantized = support::cpp11::lround(value / qinfo.scale) + qinfo.offset; in quantize() local 229 …_cast<QUANTIZED_TYPE>(arm_compute::utility::clamp<decltype(quantized), QUANTIZED_TYPE>(quantized)); in quantize() 238 * @return Quantized value 248 … const int quantized = arm_compute::round(value / qinfo.scale, rounding_policy) + qinfo.offset; in quantize() local [all …]
|
| /external/pytorch/torch/ao/quantization/experimental/ |
| D | linear.py | 5 from torch.ao.nn.quantized.modules.utils import WeightedQuantizedModule 12 A quantized linear module with quantized tensor as inputs and outputs 21 alpha: `alpha` qparam of output Quantized Tensor, type: Tensor 22 gamma: `gamma` qparam of output Quantized Tensor, type: Tensor 23 quantization_levels: `quantization_levels` qparam of output Quantized Tensor, type: Tensor 24 level_indices: `level_indices` qparam of output Quantized Tensor, type: Tensor 25 weight: APoT quantized tensor from weight2quantize 64 x (Tensor): binary representation of APoT quantized tensor 83 weight_val: list of binary digits representing APoT quantized weight value 84 r: int representing uniformly quantized activation value [all …]
|
| /external/pytorch/aten/src/ATen/native/quantized/cpu/ |
| D | qmul.cpp | 8 #include <ATen/native/quantized/cpu/OnednnUtils.h> 9 #include <ATen/native/quantized/cpu/QnnpackUtils.h> 10 #include <ATen/native/quantized/cpu/QuantUtils.h> 11 #include <ATen/native/quantized/cpu/QuantizedOps.h> 12 #include <ATen/native/quantized/cpu/XnnpackUtils.h> 13 #include <ATen/native/quantized/cpu/init_qnnpack.h> 14 #include <ATen/quantized/Quantizer.h> 322 // all variations of `quantized::mul` is merged into `quantized::mul` 337 // all variations of `quantized::mul` is merged into `quantized::mul` 347 TORCH_LIBRARY_IMPL(quantized, QuantizedCPU, m) { in TORCH_LIBRARY_IMPL() argument [all …]
|
| D | qembeddingbag_unpack.cpp | 4 #include <ATen/native/quantized/cpu/EmbeddingPackedParams.h> 5 #include <ATen/native/quantized/cpu/fbgemm_utils.h> 6 #include <ATen/native/quantized/cpu/qembeddingbag.h> 117 // packed_weights = torch.ops.quantized.embedding_bag_byte_prepack(weights) in qembeddingbag_byte_unpack_out() 119 // unpacked_weights = torch.ops.quantized.embedding_bag_byte_unpack(packed_weights) in qembeddingbag_byte_unpack_out() 226 std::uint8_t quantized = input_row[col / NUM_ELEM_PER_BYTE]; in _qembeddingbag_nbit_unpack_helper() local 227 quantized >>= (col % NUM_ELEM_PER_BYTE) * BIT_RATE; in _qembeddingbag_nbit_unpack_helper() 228 quantized &= (1 << BIT_RATE) - 1; in _qembeddingbag_nbit_unpack_helper() 229 output_row[col] = scale * quantized + zero_point; in _qembeddingbag_nbit_unpack_helper() 238 // The input is expected to first have quantized values, [all …]
|
| /external/pytorch/test/mobile/model_test/ |
| D | coverage.yaml | 662 - quantized::add 663 - quantized::add_relu 664 - quantized::add_scalar 665 - quantized::batch_norm2d 666 - quantized::batch_norm3d 667 - quantized::cat 668 - quantized::conv1d 669 - quantized::conv1d_prepack 670 - quantized::conv1d_relu 671 - quantized::conv1d_unpack [all …]
|
| /external/tensorflow/tensorflow/core/api_def/base_api/ |
| D | api_def_UniformQuantizedDotHybrid.pbtxt | 34 The output data is the original output data itself (Not quantized). 46 The type of rhs (quantized) input Tensor. 67 The min value of the quantized data stored in rhs. 68 For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. 74 The max value of the quantized data stored in rhs. 78 summary: "Perform hybrid quantized dot of float Tensor `lhs` and quantized Tensor `rhs`." 80 Given float `lhs` and quantized `rhs`, internally performs quantization on `lhs`, and then performs… 83 `rhs` must be quantized Tensor, where its data value is quantized using the formula:
|
| D | api_def_QuantizedBatchNormWithGlobalNormalization.pbtxt | 12 The value represented by the lowest quantized input. 18 The value represented by the highest quantized input. 32 The value represented by the lowest quantized mean. 38 The value represented by the highest quantized mean. 52 The value represented by the lowest quantized variance. 58 The value represented by the highest quantized variance. 71 The value represented by the lowest quantized offset. 77 The value represented by the highest quantized offset. 91 The value represented by the lowest quantized gamma. 97 The value represented by the highest quantized gamma. [all …]
|
| /external/pytorch/test/quantization/jit/ |
| D | test_fusion_passes.py | 13 a = torch.ops.quantized.add(x, y, 1.0, 0) 28 # Check quantized add + relu fusion 39 FileCheck().check_not("aten::relu").check("quantized::add_relu").run( 47 a = torch.ops.quantized.add_out(x, y, z) 54 # Check quantized add + relu fusion 64 FileCheck().check_not("aten::relu").check_not("quantized::add_out").check( 65 "quantized::add_relu_out" 72 a = torch.ops.quantized.add_scalar(x, y) 76 # Check quantized add + relu fusion 82 FileCheck().check_not("aten::relu").check_not("quantized::add_scalar(").check( [all …]
|
| /external/pytorch/torch/ao/nn/quantized/dynamic/modules/ |
| D | linear.py | 4 import torch.ao.nn.quantized as nnq 5 from torch.ao.nn.quantized.modules.utils import _quantize_weight 15 A dynamic quantized linear module with floating point tensor as inputs and outputs. 23 weight (Tensor): the non-learnable quantized weights of the module which are of 32 >>> m = nn.quantized.dynamic.Linear(20, 30) 53 Y = torch.ops.quantized.linear_dynamic( 57 Y = torch.ops.quantized.linear_dynamic( 61 Y = torch.ops.quantized.linear_dynamic_fp16( 65 raise RuntimeError("Unsupported dtype on dynamic quantized linear!") 101 r"""Create a dynamic quantized module from a float module or qparams_dict [all …]
|
| /external/pytorch/torch/ao/quantization/ |
| D | quantization_mappings.py | 8 import torch.ao.nn.intrinsic.quantized as nniq 9 import torch.ao.nn.intrinsic.quantized.dynamic as nniqd 12 import torch.ao.nn.quantized as nnq 13 import torch.ao.nn.quantized.dynamic as nnqd 14 import torch.ao.nn.quantized.reference as nnqr 56 # Default map for swapping float module to reference quantized modules 75 # Default map for swapping float module to quantized ones 179 # Default mapping from floating point function or torch ops to quantized ops 182 F.elu: torch.ops.quantized.elu, 183 F.hardswish: torch.ops.quantized.hardswish, [all …]
|