repo stringlengths 1 152 ⌀ | file stringlengths 14 221 | code stringlengths 501 25k | file_length int64 501 25k | avg_line_length float64 20 99.5 | max_line_length int64 21 134 | extension_type stringclasses 2
values |
|---|---|---|---|---|---|---|
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/ext_tpp.h | #ifndef _EXT_TPP_H_
#define _EXT_TPP_H_
#include "timing.h"
#include "xsmm_functors.h"
namespace torch_ipex {
namespace tpp {
template <typename Tin, typename Tout>
class BrgemmExtTPP {
public:
BrgemmExtTPP() {}
BrgemmExtTPP(
long M,
long N,
long K,
long str_a,
long str_b,
fl... | 4,403 | 21.02 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_embedding_layernorm_dropout_fwd_tmpl.h | RECORD_FUNCTION("bert_fwd", std::vector<c10::IValue>());
int i = 0;
auto t_in_ids = inputs[i++]; // [B][S]
auto t_pos_ids = inputs[i++]; // [1][S]
auto t_tt_ids = inputs[i++]; // [B][S]
auto t_in_emb = inputs[i++]; // [B][S][NH]
auto t_gamma = inputs[i++]; // [NH]
auto t_beta = inputs[i++]; // [NH]
auto t_word_emb = in... | 3,854 | 31.125 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_self_attention_bwd_tmpl.h | RECORD_FUNCTION("bert_bwd", std::vector<c10::IValue>());
int i = 0;
auto t_dCL = inputs[i++];
auto t_dAPO = inputs[i++];
auto t_Wq = inputs[i++]; // [HS][NH]
auto t_Wk = inputs[i++]; // [HS][NH]
auto t_Wv = inputs[i++]; // [HS][NH]
auto t_HS_T = inputs[i++]; // [B][S][HS]
auto t_HM = inputs[i++]; // Optional [B][N][S][... | 20,379 | 34.629371 | 96 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_self_attention_fwd_tmpl.h | RECORD_FUNCTION("bert_fwd", std::vector<c10::IValue>());
// B - Batch size
// S - Max seq len
// N - Number of attention heads
// H - Head size
auto t_Wq = inputs[0]; // [HS][NH] --> [N1][N2][H2][H1]
auto t_Bq = inputs[1]; // [HS]
auto t_Wk = inputs[2]; // [HS][NH] --> [N1][N2][H2][H1]
auto t_Bk = inputs[3]; // [HS]
au... | 13,705 | 36.653846 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_dense_gelu_fwd_tmpl.h | RECORD_FUNCTION("bert_fwd", std::vector<c10::IValue>());
auto in_sizes = t_in.sizes();
auto wt_sizes = t_wt.sizes();
auto S1 = in_sizes[0];
auto Nc = in_sizes[1];
auto S2 = in_sizes[2];
auto Hc = in_sizes[3];
auto Nk = wt_sizes[0];
auto Hk = wt_sizes[3];
auto t_wt_V = wt_tensor_for_fwd(Nk, Hk, Nc, Hc, t_wt);
auto t_... | 2,660 | 28.566667 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_dense_dropout_layernorm_bwd_tmpl.h | RECORD_FUNCTION("bert_bwd", std::vector<c10::IValue>());
int i = 0;
auto t_grad_out = inputs[i++].contiguous(); // [S1][Nc][S2][Hc]
auto t_in = inputs[i++]; // [S1][Nc][S2][Hc]
auto t_wt = inputs[i++]; // [Nk][Nc][Hc][Hk]
auto t_gamma = inputs[i++]; // [Nk][Hk]
auto t_mean = inputs[i++]; // [Nk][Hk]
auto t_var = inputs... | 9,315 | 32.035461 | 98 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_embedding_layernorm_dropout_bwd_tmpl.h | RECORD_FUNCTION("bert_bwd", std::vector<c10::IValue>());
int i = 0;
auto t_grad_out = inputs[i++]; // [B][S1][N][S2][H]
auto t_in_ids = inputs[i++]; // [B][S]
auto t_pos_ids = inputs[i++]; // [1][S]
auto t_tt_ids = inputs[i++]; // [B][S]
auto t_in_emb = inputs[i++]; // [B][S]
auto t_gamma = inputs[i++]; // [NH]
auto t_... | 5,109 | 31.967742 | 76 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_dense_gelu_bwd_tmpl.h | RECORD_FUNCTION("bert_bwd", std::vector<c10::IValue>());
auto in_sizes = t_in.sizes();
auto wt_sizes = t_wt.sizes();
auto S1 = in_sizes[0];
auto Nc = in_sizes[1];
auto S2 = in_sizes[2];
auto Hc = in_sizes[3];
auto Nk = wt_sizes[0];
auto Hk = wt_sizes[3];
const auto grad_wt_flag =
(t_wt.dim() == 5 ? XformTPP::XFOR... | 7,431 | 31.884956 | 98 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/tpp/bert/fused_dense_dropout_layernorm_fwd_tmpl.h | RECORD_FUNCTION("bert_fwd", std::vector<c10::IValue>());
int i = 0;
auto t_in = inputs[i++]; // [S1][Nc][S2][Hc]
auto t_in2 = inputs[i++]; // [S1][Nk][S2][Hk]
auto t_wt = inputs[i++]; // [Nk][Nc][Hc][Hk]
auto t_bias = inputs[i++]; // [Nk][Hk]
auto t_gamma = inputs[i++]; // [Nk][Hk]
auto t_beta = inputs[i++]; // [Nk][Hk... | 6,342 | 31.695876 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/ideep/IDeepConversions.h |
#pragma once
#include <ATen/ATen.h>
#include <ATen/Config.h>
#include <ideep.hpp>
#include <oneapi/dnnl/dnnl_types.h>
namespace torch_ipex {
extern dnnl_fpmath_mode_t fpmath_mode;
namespace cpu {
// Mapping ScalarType to ideep tensor data_type
ideep::tensor::data_type get_mkldnn_dtype(at::ScalarType type);
// Co... | 2,189 | 34.901639 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/LlgaTensorImpl.h | #pragma once
#include <ATen/ATen.h>
#include <ATen/Config.h>
#include <ATen/core/symbol.h>
#include <ATen/quantized/QTensorImpl.h>
#include <oneapi/dnnl/dnnl_graph.hpp>
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
struct LlgaTensorDesc {
using desc =... | 8,035 | 26.710345 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/graph_helper.h | #pragma once
#include <oneapi/dnnl/dnnl_graph.hpp>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/passes/utils/subgraph_utils.h>
#include "codegen/onednn/operator.h"
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
#define STRIDED_LAYOUT 0
#define OPAQUE_LAYOUT 1
struct OpPart... | 2,762 | 23.669643 | 74 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/prepare_binary.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
// Prepare binary ops for LLGA
//
// The pass does the following:
//
// - (1). Convert scalar input of aten::add, aten::mul and aten::div into Float
// tensor with
// dimension [1]
//
// - (2)... | 940 | 25.138889 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/fusion_group_name.h | #pragma once
#include <string>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
// Workaround here. Once the PR of PyTorch LLGA bridge code has been landed
// into the stock PyTorch, we could directly use the Symbol:
// prim::LlgaFusionGroup and prim::LlgaFusionGuard instead of
// Symbol::... | 586 | 25.681818 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/kernel.h | #pragma once
#include <unordered_map>
#include <vector>
#include "codegen/LlgaTensorImpl.h"
#include "graph_helper.h"
#include "utils/rw_lock.h"
#include <oneapi/dnnl/dnnl_graph.hpp>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/runtime/interpreter.h>
namespace torch_... | 4,945 | 29.343558 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/prepare_dequant.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
// Prepare dequant op for LLGA
//
// The pass decomposes the dequant node from:
// graph 1:
// quant
// + - - - | - - - +
// | dequant |
// | / \ |
// ... | 1,416 | 27.34 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/layout_propagation.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
// The rule is that LlgaTensor can only be consumed by JIT-only ops:
// e.g. llga fusion ops, prim ops
// (torch/csrc/jit/runtime/register_prim_ops.cpp). If a LlgaPartition is only
// fed to JIT... | 547 | 26.4 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/remove_mutation.h | #pragma once
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
/** This function tries to check if the mutated value v except its alias x is
* still alive after node.
*
* @param aliasdb: The aliasdb of the graph owned by node
* @param node: The ... | 1,370 | 25.882353 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/utils.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
namespace utils {
bool isViewOp(torch::jit::Node* n);
bool isBinaryOp(torch::jit::Node* n);
bool isEltwiseOp(torch::jit::Node* n);
bool isSupportedAsInputToDequant(torch::jit::Node* n);
std:... | 1,157 | 21.269231 | 72 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/interface.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/passes/pass_manager.h>
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
static std::atomic<bool> onednn_enabled{true};
static std::atomic<bool>& getLlgaEnabled() {
return onednn_enabled;
}
TORCH_API bool is_llga_fp... | 1,565 | 22.029412 | 64 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/operator.h | #pragma once
#include <oneapi/dnnl/dnnl_graph.hpp>
#include <torch/csrc/jit/ir/ir.h>
#include "codegen/LlgaTensorImpl.h"
namespace torch_ipex {
namespace jit {
namespace fuser {
namespace onednn {
class Operator {
public:
Operator(const torch::jit::Node* node, dnnl::graph::op::kind kind)
: n(node), o(getId(... | 5,176 | 27.13587 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/codegen/onednn/quantization_patterns.h | #include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
#include <string>
#include "passes/graph_rewrite.h"
namespace torch_ipex {
namespace jit {
struct FusionInfo {
std::string quantized_op_name;
st... | 4,901 | 33.27972 | 94 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/utils.h | #pragma once
#include <ATen/ATen.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
#include <vector>
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
namespace pytnnc = torch::jit::tensorexpr;
c10::MemoryFormat deduce_memory_format(
c10... | 824 | 20.710526 | 55 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/nnc_lowering_register.h | #pragma once
#include <torch/csrc/jit/tensorexpr/external_functions.h>
#include <torch/csrc/jit/tensorexpr/external_functions_registry.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
struct NNCOperatorRegister {
NNCOperatorRegister(
... | 1,100 | 28.756757 | 66 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/operator_schema.h | #pragma once
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
extern const char kMmDivSchema[];
extern const char kConvNoneSchema[];
extern const char kConvReluSchema[];
extern const char kConvAddReluSchema[];
extern const char kConvAbsSchema[];
extern const char kConvClampSchema[];
exter... | 1,856 | 32.160714 | 45 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_clamp.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "linear_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<LinearFusedOp::kLinearClamp>
: public LinearCommonOperations {
DECLARE_LINEAR_FUNC_AND_RES(clamp)
/**
... | 2,080 | 27.902778 | 72 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_leaky_relu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "conv_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<ConvFusedOp::kConvLeakyRelu>
: public ConvCommonOperations {
DECLARE_CONV_FUNC_AND_RES(leaky_relu)
/**
... | 1,737 | 26.15625 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_add_relu.h | #pragma once
#include "linear_common.h"
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/exceptions.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit ... | 3,057 | 29.58 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_pow.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "linear_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<LinearFusedOp::kLinearPow>
: public LinearCommonOperations {
DECLARE_LINEAR_FUNC_AND_RES(pow)
/**
* @... | 1,752 | 25.969231 | 72 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_nnc.h | #pragma once
#include "csrc/cpu/jit/cpu/kernels/LinearPacked.h"
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include "csrc/cpu/jit/cpu/tensorexpr/utils.h"
#include <ATen/ATen.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
#include <vector>
namespace torch_ipex {
... | 2,445 | 28.829268 | 76 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/matmul_div.h | #pragma once
#include <ATen/ATen.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
torch::jit::tensorexpr::Tensor computeMatmulDiv(
const std::vector<torch::jit::tensorexpr::ArgValue>& inputs,
const std::vector<torch::jit::tenso... | 821 | 24.6875 | 72 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_clamp.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "conv_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<ConvFusedOp::kConvClamp>
: public ConvCommonOperations {
DECLARE_CONV_FUNC_AND_RES(clamp)
/**
* @note T... | 2,074 | 27.819444 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_add.h | #pragma once
#include "linear_common.h"
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/exceptions.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit ... | 3,037 | 29.38 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_pow.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "conv_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<ConvFusedOp::kConvPow> : public ConvCommonOperations {
DECLARE_CONV_FUNC_AND_RES(pow)
/**
* @note This oper... | 1,742 | 26.234375 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_gelu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "linear_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
static std::unordered_map<std::string, int64_t> approximate_str2int_map = {
{"none", 0},
{"tanh", 1}};
static std::unordered_map<int64_t, dnn... | 2,391 | 29.666667 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_add.h | #pragma once
#include "conv_common.h"
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/exceptions.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit {
... | 3,029 | 29.606061 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_add_relu.h | #pragma once
#include "conv_common.h"
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/exceptions.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit {
... | 3,053 | 29.54 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_nnc.h | #pragma once
#include "csrc/cpu/jit/cpu/kernels/ConvPacked.h"
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include "csrc/cpu/jit/cpu/tensorexpr/utils.h"
#include <ATen/ATen.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
#include <vector>
namespace torch_ipex {
na... | 4,905 | 35.340741 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_common.h | #pragma once
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
#include <vector>
namespace pytnnc = torch::jit::tensorexpr;
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
#define STRINGIZE_NX(... | 5,168 | 26.790323 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_common.h | #pragma once
#include "csrc/cpu/jit/cpu/kernels/OpContext.h"
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
#include <vector>
namespace pytnnc = torch::jit::tensorexpr;
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
#define STRINGIZE_NX(... | 6,273 | 26.761062 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_gelu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "conv_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
static std::unordered_map<std::string, int64_t> approximate_str2int_map = {
{"none", 0},
{"tanh", 1}};
static std::unordered_map<int64_t, dnnl:... | 2,379 | 29.909091 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_bottleneck.h | #pragma once
#include "conv_common.h"
#include <ATen/ATen.h>
#include <torch/csrc/jit/tensorexpr/expr.h>
#include <torch/csrc/jit/tensorexpr/lowerings.h>
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<ConvFusedOp::kConvBottleneckV2>
: public Co... | 1,743 | 27.590164 | 71 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/conv_elu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "conv_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<ConvFusedOp::kConvElu> : public ConvCommonOperations {
DECLARE_CONV_FUNC_AND_RES(elu)
/**
* @note This oper... | 2,248 | 28.592105 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_elu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "linear_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<LinearFusedOp::kLinearElu>
: public LinearCommonOperations {
DECLARE_LINEAR_FUNC_AND_RES(elu)
/**
* @... | 2,256 | 28.311688 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/tensorexpr/external_call/linear_leaky_relu.h | #pragma once
#include <ideep.hpp>
#include <ideep/utils.hpp>
#include "linear_common.h"
namespace torch_ipex {
namespace jit {
namespace cpu {
namespace tensorexpr {
template <>
struct LoweringFuncTrait<LinearFusedOp::kLinearLeakyRelu>
: public LinearCommonOperations {
DECLARE_LINEAR_FUNC_AND_RES(leaky_relu)
... | 1,743 | 26.25 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/LinearMKLPacked.h | #pragma once
#include <ATen/Tensor.h>
#include "ContextLinearMKL.h"
#include "OpContext.h"
namespace torch_ipex {
namespace cpu {
namespace detail {
namespace mkl_sgemm {
c10::intrusive_ptr<MKLOpContext> createLinearMKLPrePackOpContext(
at::Tensor&& weight,
c10::optional<at::Tensor>&& bias,
c10::optional... | 924 | 22.717949 | 69 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/LinearPacked.h | #pragma once
#include <ATen/Tensor.h>
#include "ContextLinear.h"
#include "OpContext.h"
namespace torch_ipex {
namespace cpu {
namespace detail {
namespace linear {
#define DECLARE_LINEAR_UNARY_ELTWISE_RUN(FUSED_OP) \
at::Tensor linear_##FUSED_OP##_run( \
const at::Tensor& input, ... | 3,599 | 29 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ContextConvTranspose.h | #pragma once
#include <ATen/Tensor.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
namespace detail {
struct ContextConvTranspose final {
ideep::tensor::desc original_desc_;
ideep::tensor weight_packed_;
// at_weight will share same memory with weight_packed_
// at_weight is used for autograd... | 2,291 | 31.742857 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ContextLinear.h | #pragma once
#include <ATen/Tensor.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
namespace detail {
struct ContextLinear final {
ideep::tensor::desc original_desc_;
ideep::tensor weight_packed_;
// at_weight will share same memory with weight_packed_
// at_weight is used for autograd and opt... | 967 | 23.820513 | 57 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ContextConvolution.h | #pragma once
#include <ATen/Tensor.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
namespace detail {
struct ContextConvolution final {
ideep::tensor::desc original_desc_;
ideep::tensor weight_packed_;
ideep::tensor bias_;
// at_weight/at_bias_ will share same memory with weight_packed_/bias_... | 2,091 | 29.764706 | 76 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ContextLinearMKL.h | #pragma once
#include <ATen/Tensor.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
namespace detail {
struct ContextLinearMKL final {
std::vector<int64_t> sgemm_sizes_ = {0, 0, 0};
at::Tensor at_weight_; // packed at weight
at::Tensor ori_weight_; // non-packed at weight
c10::optional<at::Tens... | 910 | 23.621622 | 60 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/Mha.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/Scalar.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
at::Tensor dil_mha_scores_calc(
const at::Tensor& q,
const at::Tensor& k,
const at::Tensor& rel_kv,
const at::Scalar& al... | 2,621 | 24.705882 | 69 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/RNN.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/Scalar.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
//! function: quantized_lstm
/*!
*
* Compute a quantized LSTM for INT8 input, INT8 weight and FP32 initial hidden
and cell states whi... | 3,234 | 38.45122 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/Einsum.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/Scalar.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <ideep.hpp>
namespace torch {
namespace jit {
// XXX: PyTorch does not support nesting namespace
// And the alias analysis is not working for namespace other than aten ...
// So we fake s... | 890 | 21.846154 | 74 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/Matmul.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/Scalar.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <ideep.hpp>
namespace torch {
namespace jit {
// XXX: PyTorch does not support nesting namespace
// And the alias analysis is not working for namespace other than aten ...
// So we fake s... | 1,516 | 22.703125 | 74 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/LinearWoqPacked.h | #pragma once
#include <ATen/Tensor.h>
#include "ContextLinearWoq.h"
#include "OpContext.h"
namespace torch_ipex {
namespace cpu {
namespace detail {
namespace woq_linear {
// WOQ = weight-only quantization
c10::intrusive_ptr<WoqLinearOpContext> createWoqLinearPrePackOpContext(
at::Tensor&& weight,
c10::optio... | 1,159 | 24.777778 | 71 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/Softmax.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/Scalar.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <ideep.hpp>
namespace torch {
namespace jit {
// XXX: PyTorch does not support nesting namespace
// And the alias analysis is not working for namespace other than aten ...
// So we fake s... | 891 | 21.3 | 74 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ConvTransposePacked.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/util/ArrayRef.h>
#include <array>
#include "ContextConvTranspose.h"
#include "OpContext.h"
namespace torch_ipex {
namespace cpu {
namespace detail {
namespace conv_transpose {
#define DECLARE_CONV_TRANSPOSE_UNARY_ELTWISE_RUN(FUSED_OP) \
at::Tensor conv_transpose_... | 4,961 | 33.22069 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ContextLinearWoq.h | #pragma once
#include <ATen/Tensor.h>
namespace torch_ipex {
namespace cpu {
namespace detail {
struct ContextLinearWoq final {
at::Tensor at_weight_;
c10::optional<at::Tensor> at_bias_;
ContextLinearWoq() = delete;
ContextLinearWoq(at::Tensor&& at_weight, c10::optional<at::Tensor>&& bias)
: at_weight... | 583 | 21.461538 | 76 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/ConvPacked.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/util/ArrayRef.h>
#include <array>
#include "ContextConvolution.h"
#include "OpContext.h"
namespace torch_ipex {
namespace cpu {
namespace detail {
namespace convolution {
#define DECLARE_CONVOLUTION_UNARY_ELTWISE_RUN(FUSED_OP) \
at::Tensor convolution_##FUSED_OP#... | 5,839 | 31.99435 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/cpu/kernels/OpContext.h |
#pragma once
#include <ATen/Tensor.h>
#include <torch/custom_class.h>
#include <ideep.hpp>
#include "ContextConvTranspose.h"
#include "ContextConvolution.h"
#include "ContextLinear.h"
#include "ContextLinearMKL.h"
#include "ContextLinearWoq.h"
#include "assert.h"
namespace torch_ipex {
namespace cpu {
using Serial... | 18,827 | 31.574394 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/graph_rewrite_inplace_replace.h |
#pragma once
#include <torch/csrc/jit/passes/remove_mutation.h>
#include <torch/csrc/jit/passes/restore_mutation.h>
#include "graph_rewrite.h"
#include "utils.h"
namespace torch_ipex {
namespace jit {
namespace graph_rewrite {
bool hasSideEffectInBlocks(torch::jit::Block* block, torch::jit::Value* v);
bool hasSideEf... | 553 | 25.380952 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/graph_rewrite_utils.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/ir/irparser.h>
#include "cpu/kernels/OpContext.h"
namespace torch_ipex {
namespace jit {
namespace graph_rewrite {
inline auto accumu_use_check = [](const torch::jit::Node* add_node,
const torch::jit::Value* acc... | 4,723 | 35.061069 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/frozen_linear_folding.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
#include "graph_rewrite.h"
#include "graph_rewrite_utils.h"
namespace torch_ipex {
namespace jit {
namespace graph_rewrite {
struct TORCH_API LinearBNParameters {
at::Tensor linear_w;
at::Tensor linear_b;
at::Tensor bn_rm;
at::Tensor bn_rv;
double bn_eps = 0.0... | 1,696 | 31.634615 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/folding_common_utils.h | #pragma once
#include <ATen/ATen.h>
namespace torch_ipex {
namespace jit {
inline bool nonConstantParameters(torch::jit::Node* n) {
// Checks if the parameters, not including the
// first param are all constants.
for (size_t i = 1; i < n->inputs().size(); i++) {
if (n->inputs().at(i)->node()->kind() != tor... | 1,744 | 25.439394 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/graph_rewrite.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/ir/irparser.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
namespace torch_ip... | 3,495 | 43.820513 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/utils.h | #pragma once
#include <torch/csrc/MemoryFormat.h>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace jit {
namespace graph_rewrite {
namespace utils {
struct PostOp {
std::string ipex_op_name;
std::vector<torch::jit::MatchFi... | 1,085 | 26.846154 | 74 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/graph_rewrite_helper.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/ir/irparser.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
namespace torch_ipex {
namespace jit {
namespace graph_rewrite_helper {
// those code just copy from PyTorch offical and extend
//... | 2,189 | 32.692308 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/jit/passes/frozen_conv_folding.h | #pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch_ipex {
namespace jit {
namespace graph_rewrite {
// Fuses Convolution -> Batchnorm into a single Convolution by
// folding batchnorm weights into conv weights.
// This pass only works on Frozen Graphs; otherwise it is a No-Op.
bool FoldFrozenConvBatchnor... | 1,084 | 35.166667 | 72 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/EmbeddingBag.h | #include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <torch/all.h>
namespace torch_ipex {
at::Tensor embedding_bag(
const at::Tensor& weight,
const at::Tensor& indices,
const at::Tensor& offsets,
bool sparse,
bool include_last_offset);
} // namespace torch_ipex
namespace torch_ipe... | 1,619 | 22.142857 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/Interaction.h | #pragma once
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <torch/all.h>
namespace torch_ipex {
at::Tensor interaction_forward(const std::vector<at::Tensor>& input);
std::vector<at::Tensor> interaction_backward(
const at::Tensor& grad_out,
const std::vector<at::Tensor>& input);
} // na... | 1,439 | 23.827586 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/TensorAdvancedIndexing.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
at::Tensor& index_select_out_cpu_(
const at::Tensor& self,
int64_t dim,
const at::Tensor& index,
at::Tensor& result);
at::Tensor index_select_cpu_(
const at::Tensor& self,
int64_t di... | 905 | 21.097561 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/QPadding.h | #pragma once
#include <dyndisp/DispatchStub.h>
#include <torch/all.h>
namespace torch_ipex {
namespace cpu {
namespace {
void replication_pad2d_kernel_impl(
const at::Tensor& output,
const at::Tensor& input,
c10::IntArrayRef padding);
void replication_pad3d_kernel_impl(
const at::Tensor& output,
... | 1,907 | 25.136986 | 108 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/Linear.h | #pragma once
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <torch/csrc/autograd/custom_function.h>
#include <vector>
#include <ideep.hpp>
#include "cpu/kernels/OpContext.h"
namespace torch_ipex {
namespace cpu {
void linear_kernel_output(
const at::Tensor& self,
const ideep::tensor& mk... | 3,978 | 28.043796 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/ConcatBnRelu.h | #pragma once
#include <ATen/ATen.h>
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
/**
* This operator fuses Concat + BN + ReLU specifically for the tensors with the
* same sizes. Please refer
* https://github.com/soCzech/TransNetV2/blob/master/inference-pytorch/... | 1,690 | 25.421875 | 92 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/GroupNorm.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
#include <cstdint>
namespace torch_ipex {
namespace cpu {
using forward_fn = void (*)(
const at::Tensor& /* X */,
const at::Tensor& /* gamma */,
const at::Tensor& /* beta */,
int64_t /* N */,
int64_t /* C */,
int64_t /* Hx... | 977 | 22.285714 | 55 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/BatchNorm.h | #pragma once
#include <ATen/ATen.h>
#include <ATen/Tensor.h>
#include <torch/csrc/autograd/custom_function.h>
#include <ideep.hpp>
namespace torch_ipex {
namespace cpu {
class IPEXBatchNormOp : public torch::autograd::Function<IPEXBatchNormOp> {
public:
static at::Tensor forward(
torch::autograd::AutogradC... | 796 | 23.90625 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/AddLayerNorm.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
using Tensor = at::Tensor;
using IntArrayRef = at::IntArrayRef;
C10_ALWAYS_INLINE std::pair<int64_t, int64_t> _check_layer_norm_inputs(
const Tensor& input,
IntArrayRef normalized_shape,
const Ten... | 3,116 | 28.130841 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/WeightPack.h | #pragma once
#include <vector>
#include <ATen/Tensor.h>
#include <ideep.hpp>
#include "aten/RNN.h"
#include "ideep/IDeepConversions.h"
namespace torch_ipex {
namespace cpu {
enum LstmDtype : bool {
Quantized = true,
Float = false,
};
static ideep::attr_t empty_attr;
struct CommonLstmWeightDesc {
const at::T... | 6,442 | 27.892377 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/ROIAlign.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
#include <torch/all.h>
namespace torch_ipex {
namespace cpu {
at::Tensor ROIAlign_forward_impl(
const at::Tensor& input,
const at::Tensor& rois,
double spatial_scale,
int64_t pooled_height,
int64_t pooled_width,
int64_t sam... | 5,800 | 22.971074 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/ParamUtils.h | #pragma once
#include <c10/util/ArrayRef.h>
#include <vector>
namespace torch_ipex {
namespace cpu {
inline std::vector<int64_t> expand_param_if_needed(
at::IntArrayRef list_param,
const char* param_name,
int64_t expected_dim) {
if (list_param.size() == 1) {
return std::vector<int64_t>(expected_dim... | 2,120 | 32.140625 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/AveragePool.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
template <typename dest_t, typename src_t>
static inline dest_t safe_downcast(src_t v) {
TORCH_CHECK(
std::numeric_limits<dest_t>::min() <= v &&
v <= std::numeric_limits<dest_t>::max(),
... | 5,491 | 20.286822 | 63 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/RNN.h | #pragma once
#include <ATen/Tensor.h>
#include <torch/csrc/autograd/custom_function.h>
#include <ideep.hpp>
#include <vector>
namespace torch_ipex {
std::tuple<at::Tensor, at::Tensor, at::Tensor> ipex_lstm(
const at::Tensor& input,
std::vector<at::Tensor> hx,
std::vector<at::Tensor> params,
bool ha... | 3,729 | 23.701987 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/Converter.h | #pragma once
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
namespace {
void bf16_to_fp32(void* dst, const void* src, int len);
void fp32_to_bf16(void* dst, const void* src, int len);
at::Tensor cat_bfloat16_float_kernel_impl(
const at::Tensor top_half,
cons... | 878 | 25.636364 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/Matmul.h | #pragma once
#include <ATen/Tensor.h>
#include <torch/csrc/autograd/FunctionsManual.h>
#include <torch/csrc/autograd/custom_function.h>
#include <vector>
namespace torch {
namespace autograd {
namespace generated {
namespace ipex {
using IndexRange = std::pair<size_t, size_t>;
// A simple way to imperatively compute... | 1,444 | 22.306452 | 73 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/InstanceNorm.h | #pragma once
#include <ATen/ATen.h>
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <torch/csrc/autograd/custom_function.h>
namespace torch_ipex {
namespace cpu {
std::tuple<at::Tensor, at::Tensor, at::Tensor> instance_norm_forward(
const at::Tensor& input,
const c10::optional<at::Tensor>... | 2,219 | 29.833333 | 71 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/LinearMKL.h | #pragma once
#include <ATen/ATen.h>
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <ideep.hpp>
#include <vector>
#include "cpu/kernels/OpContext.h"
#include "mkl.h"
namespace torch_ipex {
namespace cpu {
at::Tensor mkl_sgemm_pack_weight(
const int64_t M,
const int64_t N,
const int64_... | 2,662 | 22.990991 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/MultiHeadAttention.h | #pragma once
#include <ATen/ATen.h>
#include <cpu/kernels/Matmul.h>
#include <cpu/kernels/Mha.h>
#include <cpu/kernels/Softmax.h>
#include <dyndisp/DispatchStub.h>
#include "AddSoftmax.h"
#include "DivSoftmax.h"
namespace torch_ipex {
namespace cpu {
// This operator assumes that the softmax is applied to the last
/... | 2,081 | 23.209302 | 64 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/AddSoftmax.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
// This operator assumes that the softmax is applied to the last
// dimension.
at::Tensor DivAddSoftmax(
at::Tensor& a,
const at::Tensor& b,
const float& dim_per_head);
namespace {
at::Tensor div... | 827 | 23.352941 | 73 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/ConvTranspose.h | #pragma once
#include <ATen/Tensor.h>
#include <torch/csrc/autograd/custom_function.h>
#include <ideep.hpp>
#include "cpu/kernels/OpContext.h"
namespace torch_ipex {
namespace cpu {
at::Tensor conv_transpose_kernel_impl(
const at::Tensor& input,
const ideep::tensor& w,
const c10::optional<at::Tensor>& b... | 3,284 | 30.893204 | 78 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/Conv.h | #pragma once
#include <ATen/Tensor.h>
#include <torch/csrc/autograd/custom_function.h>
#include <ideep.hpp>
#include "cpu/kernels/OpContext.h"
namespace torch_ipex {
namespace cpu {
void convolution_kernel_output(
const at::Tensor& input,
const ideep::tensor& mkldnn_weight,
const ideep::tensor& bias_opt... | 3,338 | 30.205607 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/DivSoftmax.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
// This operator assumes that the softmax is applied to the last
// dimension.
at::Tensor DivMaskedfillSoftmax(
at::Tensor& a,
const at::Tensor& b,
const at::IntArrayRef& mask_shape,
const flo... | 883 | 20.560976 | 64 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/MergedEmbeddingBag.h | #include <ATen/AccumulateType.h>
#include <ATen/Tensor.h>
#include <dyndisp/DispatchStub.h>
#include <torch/all.h>
#include "utils/csr2csc.h"
namespace torch_ipex {
namespace cpu {
namespace {
struct SGDArgs {
SGDArgs(
const std::vector<Tensor>& bf16_trail_,
float weight_decay_,
float lr_)
... | 2,859 | 25.981132 | 75 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/utils/csr2csc.h | #pragma once
#include <ATen/Tensor.h>
#include <c10/core/CPUAllocator.h>
#include <dyndisp/DispatchStub.h>
#include <omp.h>
#include <torch/all.h>
namespace torch_ipex {
namespace cpu {
using namespace at;
enum PoolingMode { SUM = 0, MEAN = 1 };
struct BatchedHyperCompressedSparseColumn {
// A data structure to ... | 3,549 | 32.809524 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/utils/utils.h | #pragma once
#include <ATen/Tensor.h>
// NOTE:
// Below are Helper functions for is_channels_last_strides_xd.
// 1. Please do not combine these helper functions, each helper function handles
// exactly one case of sizes + memory_format, by doing this, the strides indices
// will be a constant array and we can access ... | 2,115 | 32.587302 | 112 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/utils/radix_sort.h |
#pragma once
#include <omp.h>
#include <cstdint>
#include <utility>
namespace torch_ipex {
namespace cpu {
template <typename T>
using Key_Value_Weight_Tuple = std::tuple<T, T, float>;
// histogram size per thread
const int HIST_SIZE = 256;
template <typename T>
Key_Value_Weight_Tuple<T>* radix_sort_parallel(
... | 3,949 | 31.113821 | 69 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/aten/optimizer/optimizer.h | #pragma once
#include <ATen/ATen.h>
#include <dyndisp/DispatchStub.h>
namespace torch_ipex {
namespace cpu {
namespace {
std::tuple<at::Tensor, at::Tensor, at::Tensor> lamb_fused_step_kernel_impl(
const at::Tensor& param_,
const at::Tensor& exp_avg_,
const at::Tensor& exp_avg_sq_,
const at::Tensor& g... | 3,150 | 23.426357 | 79 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/utils/library.h | #include <torch/library.h>
#include <c10/util/Logging.h>
// The flag is used to control the pytorch log level and defined at c10
extern int FLAGS_caffe2_log_level;
// This FLAGS_caffe2_log_level flag is used to control the log level and defined
// at Pytorch c10 library. The default is log level is warn. But it trig... | 4,418 | 64.955224 | 80 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/utils/rw_lock.h | #pragma once
#include <condition_variable>
#include <mutex>
/*
Usage:
torch_ipex::ReadWriteMutex rwmutex;
void read_function() {
torch_ipex::UniqueReadLock<torch_ipex::ReadWriteMutex> lock( rwmutex );
// reading
}
void write_function() {
torch_ipex::UniqueWriteLock<torch_ipex::ReadWriteMutex> lock( rw... | 2,898 | 23.158333 | 77 | h |
intel-extension-for-pytorch | intel-extension-for-pytorch-master/csrc/cpu/quantization/utils/utils.h | #pragma once
#include <ATen/ATen.h>
namespace torch_ipex {
namespace int8 {
namespace utils {
inline std::tuple<double, int64_t> get_mkldnn_input_scale_zp(
const at::Tensor& input) {
TORCH_CHECK(
input.qscheme() == c10::QScheme::PER_TENSOR_AFFINE,
"should use per_tensor_affine quantization for inpu... | 1,116 | 27.641026 | 71 | h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.