char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
aee56b3ab
char/aliceai-t5-moe
1#pragma once 2 3#include <cstdint> 4#include <map> 5#include <openvino/core/node.hpp> 6#include <openvino/core/partial_shape.hpp> 7#include <openvino/core/shape.hpp> 8#include <openvino/frontend/decoder.hpp> 9#include <set> 10#include <string> 11 12namespace ov { 13namespace frontend { 14namespace ggml { 15 16struct ModelInputInfo { 17element ::Type type ; 18PartialShape shape ; 19}; 20 21struct ModelExtraInputInfo { 22element ::Type type ; 23Shape shape ; 24int64_t value ; 25bool is_parameter ; 26}; 27 28class GgmlDecoder :public DecoderBase { 29public : 30virtual ov ::Any get_attribute (const std ::string & name )const = 0 ; 31 32virtual PartialShape get_input_shape (int node_idx ,const std ::string & name )const = 0 ; 33 34virtual std ::vector < size_t > get_input_stride (int node_idx ,const std ::string & name )const = 0 ; 35 36virtual size_t get_view_input_size (int node_idx ,const std ::string & name )const = 0 ; 37 38virtual size_t get_view_input_offset (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 39 40virtual size_t get_view_input_src_offset (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 41 42virtual std ::vector < size_t > get_view_input_stride (int node_idx , 43const std ::string & name , 44size_t view_index )const = 0 ; 45 46virtual std ::vector < size_t > get_view_input_src_stride (int node_idx , 47const std ::string & name , 48size_t view_index )const = 0 ; 49 50virtual Shape get_view_input_ggml_shape (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 51 52virtual Shape get_view_input_src_ggml_shape (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 53 54virtual PartialShape get_view_input_ov_shape (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 55 56virtual PartialShape get_view_input_src_ov_shape (int node_idx , 57const std ::string & name , 58size_t view_index )const = 0 ; 59 60virtual std ::string get_view_input_name (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 61 62virtual std ::string get_view_input_src_name (int node_idx ,const std ::string & name ,size_t view_index )const = 0 ; 63 64virtual element ::Type get_input_type (int node_idx ,const std ::string & name )const = 0 ; 65 66virtual size_t get_input_size ()const = 0 ; 67 68virtual size_t get_input_size (int node_idx )const = 0 ; 69 70virtual void get_input_node (size_t input_port_idx , 71std ::string & producer_name , 72std ::string & producer_output_port_name , 73size_t & producer_output_port_index )const = 0 ; 74 75virtual std ::vector < std ::string > get_input_names (int node_idx )const = 0 ; 76 77virtual PartialShape get_output_shape (int node_idx )const = 0 ; 78 79virtual element ::Type get_output_type (const int node_idx )const = 0 ; 80 81virtual std ::vector < size_t > get_output_stride (int node_idx )const = 0 ; 82 83virtual int32_t * get_input_op_params (int node_idx ,const std ::string & name )const = 0 ; 84 85virtual int32_t * get_output_op_params (int node_idx )const = 0 ; 86 87virtual size_t get_output_op_offset (int node_idx )const = 0 ; 88 89virtual std ::vector < std ::string > get_output_names (int node_idx )const = 0 ; 90 91virtual std ::string get_inplace_op_src (int node_idx )const = 0 ; 92 93virtual bool is_view_like_alias_of (int node_idx ,const std ::string & view_src_name )const = 0 ; 94 95virtual const std ::string & get_op_type ()const = 0 ; 96 97virtual const std ::string & get_op_type (int node_idx )const = 0 ; 98 99virtual const std ::string & get_op_name ()const = 0 ; 100 101virtual const std ::string & get_op_name (int node_idx )const = 0 ; 102 103virtual void visit_subgraph (std ::function < void (std ::shared_ptr < GgmlDecoder > ,int node_idx )> node_visitor )const = 0 ; 104 105virtual int get_op_case (int node_idx )const = 0 ; 106 107virtual const std ::map < std ::string ,ModelInputInfo > & get_model_inputs ()const = 0 ; 108virtual const std ::map < std ::string ,ModelExtraInputInfo > & get_model_extra_inputs ()const = 0 ; 109virtual const std ::map < std ::string ,std ::shared_ptr < ov ::Node >>& get_model_weights ()const = 0 ; 110virtual std ::set < std ::string > get_model_output_names ()const = 0 ; 111 112virtual int32_t * get_rope_params ()const = 0 ; 113 114virtual bool has_mixed_rope_params ()const = 0 ; 115 116virtual int get_ssm_state_size ()const = 0 ; 117 118virtual std ::map < std ::string ,std ::string > get_kv_param_res_names ()const = 0 ; 119 120virtual bool is_static ()const = 0 ; 121 122virtual bool is_stateful ()const = 0 ; 123 124virtual bool is_splited_model ()const = 0 ; 125 126virtual int is_swa_layer (int layer )const = 0 ; 127 128virtual int32_t get_op_dynamic_dim (int node_idx )const = 0 ; 129}; 130 131}// namespace ggml 132}// namespace frontend 133}// namespace ov