| 806 | } |
| 807 | } |
| 808 | |
| 809 | ggml_backend_t backend = nullptr; |
| 810 | core::BackendType backend_type = core::BackendType::Cpu; |
| 811 | int threads = 1; |
| 812 | std::shared_ptr<const Vevo2ARWeights> weights; |
| 813 | int64_t cache_steps = 0; |
| 814 | std::unique_ptr<ggml_context, GgmlContextDeleter> ctx; |
| 815 | ggml_tensor * token_id = nullptr; |
| 816 | ggml_tensor * positions = nullptr; |
| 817 | ggml_tensor * attention_mask = nullptr; |
| 818 | ggml_tensor * logits = nullptr; |
| 819 | std::vector<ggml_tensor *> key_sources; |
| 820 | std::vector<ggml_tensor *> value_sources; |
| 821 | std::vector<std::vector<ggml_tensor *>> key_destinations; |
| 822 | std::vector<std::vector<ggml_tensor *>> value_destinations; |
| 823 | std::vector<ggml_fp16_t> attention_mask_values; |
| 824 | runtime::TransformerKVCache step_cache; |
| 825 | ggml_cgraph * graph = nullptr; |
| 826 | ggml_backend_buffer_t buffer = nullptr; |
| 827 | }; |
| 828 | |
| 829 | Vevo2AutoregressiveRuntime::Vevo2AutoregressiveRuntime( |
| 830 | std::shared_ptr<const Vevo2Assets> assets, |
| 831 | core::ExecutionContext & execution_context, |
| 832 | size_t weight_context_bytes, |
| 833 | size_t prefill_graph_context_bytes, |
| 834 | size_t decode_graph_context_bytes, |
| 835 | assets::TensorStorageType weight_storage_type) |
| 836 | : assets_(require_assets(std::move(assets))), |
| 837 | execution_context_(execution_context), |
| 838 | prefill_graph_context_bytes_(prefill_graph_context_bytes), |
| 839 | decode_graph_context_bytes_(decode_graph_context_bytes), |
| 840 | tokenizer_(assets_), |
| 841 | weight_source_(assets_->ar_weights), |
| 842 | weights_(load_ar_weights( |
| 843 | *assets_, |
| 844 | execution_context_.backend(), |
| 845 | execution_context_.backend_type(), |
no test coverage detected