| 762 | } |
| 763 | ggml_init_params input_params{ggml_tensor_overhead() * 64, nullptr, true}; |
| 764 | input_ctx.reset(ggml_init(input_params)); |
| 765 | if (input_ctx == nullptr) { |
| 766 | throw std::runtime_error("failed to initialize Vevo2 FM step input context"); |
| 767 | } |
| 768 | ggml_init_params params{graph_context_bytes, nullptr, true}; |
| 769 | ctx.reset(ggml_init(params)); |
| 770 | if (ctx == nullptr) { |
| 771 | throw std::runtime_error("failed to initialize Vevo2 FM step graph context"); |
| 772 | } |
| 773 | |
| 774 | engine::core::ModuleBuildContext input_build_ctx{input_ctx.get(), "vevo2.fm.step.input", backend_type}; |
| 775 | engine::core::ModuleBuildContext build_ctx{ctx.get(), "vevo2.fm.step", backend_type}; |
| 776 | prompt_input = engine::core::make_tensor( |
| 777 | input_build_ctx, |
| 778 | GGML_TYPE_F32, |
| 779 | engine::core::TensorShape::from_dims({1, prompt_frames, config.mel_dim})).tensor; |
| 780 | xt_input = engine::core::make_tensor( |
| 781 | input_build_ctx, |
| 782 | GGML_TYPE_F32, |
| 783 | engine::core::TensorShape::from_dims({1, target_frames, config.mel_dim})).tensor; |
| 784 | cond_input = engine::core::make_tensor( |
| 785 | input_build_ctx, |
| 786 | GGML_TYPE_F32, |
| 787 | engine::core::TensorShape::from_dims({1, cond_frames, config.hidden_size})).tensor; |
| 788 | uncond_cond_input = engine::core::make_tensor( |
| 789 | input_build_ctx, |
| 790 | GGML_TYPE_F32, |
| 791 | engine::core::TensorShape::from_dims({1, target_frames, config.hidden_size})).tensor; |
| 792 | timestep_input = engine::core::make_tensor( |
| 793 | input_build_ctx, |
| 794 | GGML_TYPE_F32, |
| 795 | engine::core::TensorShape::from_dims({1, config.hidden_size})).tensor; |
| 796 | cond_position_input = engine::core::make_tensor( |
| 797 | input_build_ctx, |
| 798 | GGML_TYPE_I32, |
| 799 | engine::core::TensorShape::from_dims({cond_frames})).tensor; |
| 800 | uncond_position_input = engine::core::make_tensor( |
| 801 | input_build_ctx, |
| 802 | GGML_TYPE_I32, |
| 803 | engine::core::TensorShape::from_dims({target_frames})).tensor; |
| 804 | ggml_set_input(prompt_input); |
| 805 | ggml_set_input(xt_input); |
| 806 | ggml_set_input(cond_input); |
| 807 | ggml_set_input(uncond_cond_input); |
| 808 | ggml_set_input(timestep_input); |
| 809 | ggml_set_input(cond_position_input); |
| 810 | ggml_set_input(uncond_position_input); |
| 811 | |
| 812 | auto prompt = engine::core::wrap_tensor( |
| 813 | prompt_input, |
| 814 | engine::core::TensorShape::from_dims({1, prompt_frames, config.mel_dim}), |
| 815 | GGML_TYPE_F32); |
| 816 | auto xt = engine::core::wrap_tensor( |
| 817 | xt_input, |
| 818 | engine::core::TensorShape::from_dims({1, target_frames, config.mel_dim}), |
| 819 | GGML_TYPE_F32); |
| 820 | auto cond = engine::core::wrap_tensor( |
| 821 | cond_input, |
nothing calls this directly
no test coverage detected