ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-openvino / openvino / pass / fuse_moe_compressed.h
| 1 | #include "openvino/pass/matcher_pass.hpp" |
| 2 | |
| 3 | namespace ov { |
| 4 | namespace frontend { |
| 5 | namespace ggml { |
| 6 | namespace 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. |
| 10 | class FuseMoeCompressed : public ov::pass::MatcherPass { |
| 11 | public: |
| 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. |
| 21 | class FuseMoeCompressedFusedGateUp : public ov::pass::MatcherPass { |
| 22 | public: |
| 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 |