Class ov::pass::GatedDeltaNetFusion#
-
class GatedDeltaNetFusion : public ov::pass::ModelPass#
This pass transforms a loop-based Gated Delta Net sub-graph to a single internal
GatedDeltaNetoperation.Before: ┌────────┐ ┌────────┐ ┌───────┐ ┌──────────────┐ ┌───────┐ ┌───────┐ │ Q │ │ K │ │ V │ │ Initial State│ │ G │ │ Beta │ └───┬────┘ └───┬────┘ └──┬────┘ └──────┬───────┘ └──┬────┘ └───┬───┘ │ │ │ │ │ │ │ │ │ │ │ │ ┌───┴────────────┴───┐ ┌───┴────────┐ │ ┌────┴────────┐ ┌─────┴────┐ │ L2Norm(Q)+QScale │ │ L2Norm(K) │ │ │ Transpose │ │ Transpose│ │ (1/√d) │ └────┬───────┘ │ └────┬────────┘ └───┬──────┘ └────────┬───────────┘ │ │ │ │ │ │ │ │ │ ┌────────┴────────────────────┴──────────────┴──────────────┴────────────────┴────────┐ │ Loop (recurrent body) │ └──────────────────────────────────────┬──────────────────────────────────────────────┘ │ ┌──────────────┴──────────────┐ │ Concat / Slice / Reshape(s) │ └──────────────┬──────────────┘ │ ┌─────────────┴─────────────┐ │ CoreAttn, StateOut │ └───────────────────────────┘
After: ┌────────┐ ┌────────┐ ┌────────┐ ┌──────────────┐ ┌────────┐ ┌────────┐ │ Q │ │ K │ │ V │ │ Initial State│ │ G │ │ Beta │ └───┬────┘ └───┬────┘ └───┬────┘ └──────┬───────┘ └───┬────┘ └───┬────┘ │ │ │ │ │ │ │ │ │ │ │ │ ┌───┴────────────┴────────────┴───────────────┴───────────────┴────────────┴───────┐ │ GatedDeltaNet │ └────────────────────────────────────────┬─────────────────────────────────────────┘ │ ┌──────────────┴──────────────┐ │ CoreAttn, StateOut │ └─────────────────────────────┘