interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / src / ggml-openvino / openvino / pass / fuse_moe_compressed.h

30 lines · 1179 bytes Raw Blame History
1#include "openvino/pass/matcher_pass.hpp"
2
3namespace ov {
4namespace frontend {
5namespace ggml {
6namespace pass {
7
8// Folds the MoE expert block emitted for MUL_MAT_ID (3 GatherMatmul + SwiGLU + routing
9// weighting + expert reduction) into a single ov::op::internal::MOECompressed.
10class FuseMoeCompressed : public ov::pass::MatcherPass {
11public:
12 OPENVINO_MATCHER_PASS_RTTI("ov::frontend::ggml::pass::FuseMoeCompressed")
13 FuseMoeCompressed();
14};
15
16// Folds the MoE expert block emitted for a model whose gate and up projections share one
17// fused MUL_MAT_ID weight (gemma-4: one GatherMatmul + Slice/Slice split, GEGLU activation)
18// into a single ov::op::internal::MOECompressed, GEMM3_SWIGLU/GEGLU_ERF. Splits the fused
19// weight/scale/zp into gate/up halves so it lands on the same 3-GEMM expert-grouped kernel
20// FuseMoeCompressed uses for models with separate gate/up weights.
21class FuseMoeCompressedFusedGateUp : public ov::pass::MatcherPass {
22public:
23 OPENVINO_MATCHER_PASS_RTTI("ov::frontend::ggml::pass::FuseMoeCompressedFusedGateUp")
24 FuseMoeCompressedFusedGateUp();
25};
26
27} // namespace pass
28} // namespace ggml
29} // namespace frontend
30} // namespace ov