/aosp_15_r20/external/pytorch/torch/ao/quantization/backend_config/ |
H A D | _qnnpack_pt2e.py | 36 # addmm 43 # input - addmm 46 # input - observer - addmm 49 # input - observer - addmm 52 # addmm, bias, act, weight = node_pattern 53 # return addmm 56 …# BackendPatternConfig((torch.ops.aten.addmm.default, MatchAllNode, MatchAllNode, torch.ops.at… 62 BackendPatternConfig(torch.ops.aten.addmm.default)
|
/aosp_15_r20/external/pytorch/test/inductor/ |
H A D | test_pattern_matcher.py | 720 torch.addmm(a, b, c), 721 torch.addmm(b, c, a), 722 torch.addmm(c, a, b), 1123 return torch.ops.aten.addmm(inp, a, b) 1126 FileCheck().check("extern_kernels.addmm(").run(code[0]) 1130 return torch.nn.functional.gelu(torch.ops.aten.addmm(inp, a, b)) 1133 FileCheck().check_not("extern_kernels.addmm(").run(code[0]) 1138 torch.ops.aten.addmm(inp, a, b).unsqueeze(0) 1143 FileCheck().check_not("extern_kernels.addmm(").run(code[0]) 1201 return torch.ops.aten.addmm(inp, a, b) [all …]
|
H A D | test_max_autotune.py | 299 Make sure autotuning addmm in sub processes work without crashes. 304 def addmm(x, a, b): function 305 return torch.addmm(x, a, b) 311 Y_compiled = torch.compile(addmm, dynamic=dynamic)(x, a, b) 312 Y = addmm(x, a, b) 318 Make sure autotuning addmm with zero-size input works without crashes. 321 def addmm(x, a, b): function 322 return torch.addmm(x, a, b) 328 torch.compile(addmm, dynamic=dynamic)(x, a, b) 422 torch.addmm(a, b, c), [all …]
|
H A D | test_pad_mm.py | 177 def addmm(x, a, b): function 178 return torch.addmm(x, a, b) 183 self.assertEqual(torch.compile(addmm)(x, a, b), addmm(x, a, b)) 284 return torch.addmm(a, b, c) 313 return torch.addmm(a, b, c) 348 return torch.ops.aten.addmm(input, x, y) 358 out_eager = torch.ops.aten.addmm(*inps) 368 out_eager = torch.ops.aten.addmm(*inps)
|
H A D | test_cutlass_backend.py | 454 Make sure autotuning addmm in sub processes work without crashes. 462 def addmm(x, a, b, alpha, beta): function 463 return torch.addmm(x, a, b, alpha=alpha, beta=beta) 471 y_expected = addmm(x, a, b, alpha, beta) 473 compiled_fn = torch.compile(addmm, dynamic=dynamic) 655 return torch.addmm(x, a, b, alpha=beta, beta=alpha) 685 assert op_name == "addmm" 702 def addmm(x, a, b, alpha, beta): function 703 return torch.addmm(x, a, b, alpha=alpha, beta=beta) 730 torch.compile(addmm, dynamic=False)(x, a, b, 1.0, 1.0) [all …]
|
/aosp_15_r20/external/executorch/backends/xnnpack/partition/config/ |
H A D | gemm_configs.py | 48 GEMM-like ops like Convolution, Addmm, Linear, mostly behave in the same way, in which we 323 We will handle the legacy form of addmm partitioning which will include 327 target_name = "addmm.default" 363 # if addmm belongs to linear src partition, then partition the 375 from the linear src partition, and plug those in as the addmm node's args. We also 376 take the users of the src partitions output node as the addmm node's users. Finally 378 getting the deps, we return the addmm nodes users and args back. 393 # map addmm's args to the source partition's inputs 411 # map addmm's args to the source partition linear's inputs and users 416 # Reset addmm node back to old args and users
|
/aosp_15_r20/external/pytorch/torch/_inductor/kernel/ |
H A D | mm.py | 128 torch.addmm, "at::addmm_out", op_overload=aten.addmm.default 146 Giving torch.addmm a 1D tensor calls a different (faster) cublasLt 151 return torch.addmm(inp[0], mat1, mat2, out=out, alpha=alpha, beta=beta) 152 return torch.addmm(inp, mat1, mat2, out=out, alpha=alpha, beta=beta) 322 @register_lowering(aten.addmm, type_promotion_kind=None) 348 return autotune_select_algorithm("addmm", choices, [inp, mat1, mat2], layout) 369 # unexpand inp to make sure fused addmm from cublasLt is used 391 # in the linear GEMM epilogue used by addmm. 444 # unexpand inp to make sure fused addmm from cublasLt is used 453 "addmm", choices, [inp_expanded, mat1, mat2], layout
|
/aosp_15_r20/external/executorch/backends/qualcomm/_passes/ |
H A D | convert_to_linear.py | 29 Handle missing quantization tag for addmm op after decomposing 37 addmm = exir_ops.edge.aten.addmm.default variable in ConvertToLinear 42 {view_copy: 2, permute_copy: 1, addmm: 1}, 43 {permute_copy: 1, addmm: 1}, 167 addmm_node = [n for n in partitioned_nodes if n.target == self.addmm][0] 168 # weight -> permute -> input of addmm
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/vulkan/ops/ |
H A D | Lstm.cpp | 9 #include <ATen/ops/addmm.h> 140 at::addmm(b_ii, x, w_ii.t()) + at::addmm(b_hi, h, w_hi.t())); in lstm_input() 142 at::addmm(b_if, x, w_if.t()) + at::addmm(b_hf, h, w_hf.t())); in lstm_input() 144 at::tanh(at::addmm(b_ig, x, w_ig.t()) + at::addmm(b_hg, h, w_hg.t())); in lstm_input() 146 at::addmm(b_io, x, w_io.t()) + at::addmm(b_ho, h, w_ho.t())); in lstm_input()
|
H A D | Gru.cpp | 9 #include <ATen/ops/addmm.h> 111 at::addmm(b_ir, x, w_ir.t()) + at::addmm(b_hr, h, w_hr.t())); in gru_input() 113 at::addmm(b_iz, x, w_iz.t()) + at::addmm(b_hz, h, w_hz.t())); in gru_input() 115 at::addmm(b_in, x, w_in.t()) + r * (at::addmm(b_hn, h, w_hn.t()))); in gru_input()
|
/aosp_15_r20/external/pytorch/test/distributed/_tensor/ |
H A D | test_matrix_ops.py | 40 dist_res = torch.addmm(input, mat1, mat2) 41 local_res = torch.addmm(input_tensor, tensor_to_shard, tensor_to_replicate) 57 dist_res = torch.addmm(inp, mat1, mat2) 58 local_res = torch.addmm(input_tensor, tensor_to_shard, tensor_to_replicate) 75 local_res = torch.addmm(input_tensor, tensor_to_shard1, tensor_to_shard0) 76 dist_res = torch.addmm(input, mat1, mat2) 78 # test if addmm output is a partial
|
/aosp_15_r20/external/pytorch/test/export/ |
H A D | test_experimental.py | 218 …addmm = torch.ops.aten.addmm.default(p_linear_bias, view, permute); p_linear_bias = permute = None 219 view_1 = torch.ops.aten.view.default(addmm, [3]); addmm = None 267 …addmm = torch.ops.aten.addmm.default(p_linear_bias, view, permute); p_linear_bias = permute = None 268 view_1 = torch.ops.aten.view.default(addmm, [3]); addmm = None
|
/aosp_15_r20/external/executorch/backends/cadence/aot/ |
H A D | fuse_ops.py | 51 Fuse X and Y into a single addmm node, after making sure that we can 73 # Our addmm implementation computes (mat1 * mat2 + bias). So the 74 # addmm node in the graph should have three args. We collectively 125 # Create a new addmm node, and insert it before add node. DCE should 130 exir_ops.edge.aten.addmm.default, 133 # Replace all the uses of add node with addmm node, and remove add 138 # As a finishing step, we want to ensure that the output of addmm is 146 # is the shape out of view node T2. However, the fused addmm will 151 # 2. The single successor of addmm is not a view op. 154 # Create a view node that correctly reshapes the output of addmm [all …]
|
/aosp_15_r20/external/pytorch/tools/autograd/ |
H A D | deprecated.yaml | 49 - name: addmm(Scalar beta, Tensor self, Scalar alpha, Tensor mat1, Tensor mat2) -> Tensor 50 aten: addmm(self, mat1, mat2, beta, alpha) 55 - name: addmm(Scalar beta, Tensor self, Scalar alpha, Tensor mat1, Tensor mat2, *, Tensor(a!) out) … 58 - name: addmm(Scalar beta, Tensor self, Tensor mat1, Tensor mat2) -> Tensor 59 aten: addmm(self, mat1, mat2, beta, 1) 64 - name: addmm(Scalar beta, Tensor self, Tensor mat1, Tensor mat2, *, Tensor(a!) out) -> Tensor(a!)
|
/aosp_15_r20/external/executorch/backends/cadence/aot/tests/ |
H A D | test_fusion_ops_passes.py | 51 # Assert that mm and add were fused to addmm 52 self.assertEqual(count_node(graph_module, exir_ops.edge.aten.addmm.default), 1) 73 # Assert that mm and add were fused to addmm 74 self.assertEqual(count_node(graph_module, exir_ops.edge.aten.addmm.default), 1) 93 # Assert that mm and add were fused to addmm 94 self.assertEqual(count_node(graph_module, exir_ops.edge.aten.addmm.default), 1) 116 # Assert that mm and add were not fused to addmm, since z cannot be 138 # Assert that mm and add were not fused to addmm, since add has multiple
|
/aosp_15_r20/external/pytorch/torch/csrc/jit/passes/ |
H A D | peephole.cpp | 341 // z + x.mm(y) == z.addmm(x, y) == x.mm(y) + z in FuseAddMM() 346 // one of them is a scalar, but addmm will throw in that case, so we in FuseAddMM() 401 auto* addmm_node = graph->insertNode(graph->create(aten::addmm, 1)); in FuseAddMM() 437 // ops. However, we rely on seeing the fused version of AddMM for ONNX export, 441 // torch.addmm(a, b, c, out=a). 442 // That's because addmm dispatches internally to gemm, which computes: 444 // but aten::addmm(a, b, c, 1, 1) is really: 447 // explicit add for a copy inside the addmm function. Note that it
|
/aosp_15_r20/external/pytorch/torch/_inductor/fx_passes/ |
H A D | pad_mm.py | 141 return aten.addmm(input, mat1, mat2, beta=beta, alpha=alpha) 147 match, mat1, mat2, torch.ops.aten.addmm, input=input 184 res = aten.addmm(input, mat1, mat2, beta=beta, alpha=alpha) 332 aten.addmm.default, 378 if op is torch.ops.aten.mm or op is torch.ops.aten.addmm: 448 if ori_time is None and op is torch.ops.aten.addmm and input is not None: 449 # realize bias for addmm 492 if op is torch.ops.aten.addmm:
|
H A D | freezing_patterns.py | 188 aten.addmm(b1, inp, w1), 189 aten.addmm(b2, inp, w2), 190 aten.addmm(b3, inp, w3), 196 return aten.addmm(cat_b, inp, cat_w).chunk(3, dim=1)
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/sparse/cuda/ |
H A D | SparseCUDATensorMath.cu | 87 // addmm(Tensor, SparseTensor, Tensor, Scalar, Scalar) [broadcasts] 91 …TORCH_CHECK(t.is_cuda(), "Expected all tensors to be on the same device. addmm: expected 'self' to… in s_addmm_out_sparse_dense_cuda() 92 …TORCH_CHECK(r_.is_cuda(), "Expected all tensors to be on the same device. addmm: expected 'out' to… in s_addmm_out_sparse_dense_cuda() 93 …TORCH_CHECK(sparse_.is_cuda(), "Expected all tensors to be on the same device. addmm: expected 'ma… in s_addmm_out_sparse_dense_cuda() 94 …TORCH_CHECK(dense.is_cuda(), "Expected all tensors to be on the same device. addmm: expected 'mat2… in s_addmm_out_sparse_dense_cuda() 98 TORCH_CHECK(dense.dim() == 2, "addmm: 2D tensor expected, got ", dense.dim(), "D tensor"); in s_addmm_out_sparse_dense_cuda() 99 …TORCH_CHECK(sparse_.sparse_dim() == 2, "addmm: expected first two dims to be sparse (indices has s… in s_addmm_out_sparse_dense_cuda() 108 "addmm: Argument #1 (t): Expected dim 0 size ", m, ", got ", t.size(0)); in s_addmm_out_sparse_dense_cuda() 110 "addmm: Argument #1 (t): Expected dim 1 size ", n, ", got ", t.size(1)); in s_addmm_out_sparse_dense_cuda() 112 "addmm: Argument #3 (dense): Expected dim 0 size ", k, ", got ", dense.size(0)); in s_addmm_out_sparse_dense_cuda() [all …]
|
/aosp_15_r20/external/executorch/backends/apple/mps/runtime/operations/ |
H A D | LinearAlgebra.mm | 54 … name:@"addmm/matmul"]; 63 name:@"addmm/alpha*matmul"]; 73 name:@"addmm/beta*bias"]; 78 … name:@"addmm/beta*bias*alpha*matmul"];
|
/aosp_15_r20/external/pytorch/aten/src/ATen/test/ |
H A D | broadcast_test.cpp | 146 ASSERT_TRUE(a.addmm(b, c).equal(a.expand({5, 7}).addmm(b, c))); in TestExplicitDimBasic() 155 ASSERT_TRUE(aScalar.addmm(b, c).equal(aScalar.expand({5, 7}).addmm(b, c))); in TestExplicitDimWithScalar() 164 ASSERT_ANY_THROW(a.addmm(b, c)); in TestExplicitDimWithMismatchedSizes()
|
/aosp_15_r20/external/pytorch/test/ |
H A D | test_sparse_csr.py | 95 where f is `torch.addmv` or `torch.addmm`. 1473 torch.addmm(s, csr, m2) 1476 torch.addmm(s, csr, m2) 1526 … expected = [torch.addmm(c[i], a, b[i], alpha=alpha, beta=beta) for i in range(c.shape[0])] 1709 …self.run_test_block_addmm_addmv(torch.addmm, c, a, b, op_b, op_out, dtype=dtype, device=device, re… 1710 self.run_test_block_addmm_addmv(make_transposed_addmm_op(torch.addmm), 1845 # TODO: addmm doesn't support strided result for sparse inputs. 1847 res = torch.addmm(t, x, y, beta=beta, alpha=alpha) 1848 expected = torch.addmm(t, x.to_dense(), y.to_dense(), beta=beta, alpha=alpha) 1851 res = torch.addmm(t, x, y) [all …]
|
/aosp_15_r20/external/pytorch/test/xpu/ |
H A D | test_gemm.py | 137 self._test_addmm_impl(torch.addmm, None, device, dtype) 666 fns = ["baddbmm", "addbmm", "addmm", "addmv", "addr"] 687 elif fn == "addmm": 792 self._test_addmm_addmv(torch.addmm, M, m1, m2) 799 lambda: torch.addmm(M, m1, m2), 890 torch.addmm(M, m2.t(), m1) 895 torch.addmm(M, m2, m1) 923 # mm, addmm 936 self.assertEqual((0, 0), fn(torch.addmm, (0, 0), (0, 0), (0, 0)).shape) 937 self.assertEqual((0, 1), fn(torch.addmm, (1,), (0, 17), (17, 1)).shape) [all …]
|
/aosp_15_r20/external/executorch/backends/xnnpack/partition/ |
H A D | configs.py | 65 exir_ops.edge.aten.addmm.default, # TODO(T163877189) add constraint for addmm 101 exir_ops.edge.aten.addmm.default, # TODO(T163877189) add constraint for addmm
|
/aosp_15_r20/external/executorch/backends/transforms/ |
H A D | addmm_mm_to_linear.py | 104 Replace calls to addmm/mm with linear node 116 node.target == ops.aten.mm.default or node.target == ops.aten.addmm.default 119 if node.target == ops.aten.addmm.default: 125 # Skip this node as it appears to be a standalone `addmm`
|