载入中...
搜索中...
未找到
KernelGen.h
浏览该文件的文档.
1
2#include "common/Export.h"
3#ifndef EVE_TENSOR_KERNELGEN_H
4#define EVE_TENSOR_KERNELGEN_H
5
6#include "tensor/Optimizer.h"
7
8#include <string>
9#include <vector>
10
11namespace eve::tensor {
12
27struct KernelSpec {
28 std::string pass1; // empty when single-pass
29 std::string pass2; // always set
30 int groupsX1 = 0, groupsY1 = 1, groupsZ1 = 1;
31 int groupsX2 = 0, groupsY2 = 1, groupsZ2 = 1;
34 std::vector<int> inputRepresentatives;
35 int inputCount = 0; // total group input buffers
36 int inputsReadPass1 = 0; // leading inputs bound in pass1
37 int statsCount = 0; // per-row stats buffers (allocated by the runtime)
38 int statsSize = 0; // elements per stats buffer (rows)
39 bool twoPass = false;
40
41 // Weight-only quantization of a matmul B / embedding table input.
42 // qDtype == 0 means fp32 storage. int8/int4 add a per-group scales buffer.
43 int qDtype = 0; // static_cast<int>(DType)
44 int qGroup = 0; // elements per scale group
45 int scalesBinding = -1; // storage binding of the scales buffer
46 int outputBinding = -1; // storage binding of the output (override)
47};
48
58
65bool generateMatMulVariant(const Graph &graph, const FusedGroup &group, bool tiled,
66 KernelSpec &out);
67
69constexpr int kMaxKernelBindings = 8;
70
71} // namespace eve::tensor
72
73#endif // EVE_TENSOR_KERNELGEN_H
building::EdgeCurveGroup group
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::map< std::string, std::vector< std::string > > graph
Definition Package.cpp:59
EVENGINE_API_DOMAINS public API.
Definition Graph.h:111
bool generateKernel(const Graph &graph, const FusedGroup &group, KernelSpec &out)
Generate kernel.
constexpr int kMaxKernelBindings
Definition KernelGen.h:69
bool generateMatMulVariant(const Graph &graph, const FusedGroup &group, bool tiled, KernelSpec &out)
Generate mat mul variant.
FusedGroup public API.
Definition Optimizer.h:46
KernelSpec public API.
Definition KernelGen.h:27
std::vector< int > inputRepresentatives
Input slot to representative slot; empty means identity. WGSL aliases repeated read inputs to one dec...
Definition KernelGen.h:34