| 878 | const int64_t required_cache_steps = last_prompt_tokens_ + generation.max_new_tokens; |
| 879 | double decode_graph_build_ms = 0.0; |
| 880 | if (decode_graph_ == nullptr || !decode_graph_->can_run(*weights_, required_cache_steps)) { |
| 881 | const auto build_start = Clock::now(); |
| 882 | decode_graph_ = std::make_unique<Vevo2ARDecodeGraph>( |
| 883 | execution_context_.backend(), |
| 884 | execution_context_.backend_type(), |
| 885 | execution_context_.config().threads, |
| 886 | decode_graph_context_bytes_, |
| 887 | weights_, |
| 888 | assets_->config.ar, |
| 889 | required_cache_steps); |
| 890 | decode_graph_build_ms = engine::debug::elapsed_ms(build_start); |
| 891 | } |
| 892 | |
| 893 | const auto prefill_start = Clock::now(); |
| 894 | auto prefill = prefill_graph_->run(tokenized.input_ids, assets_->config.ar); |
| 895 | const double prefill_run_ms = engine::debug::elapsed_ms(prefill_start); |
| 896 | const auto import_start = Clock::now(); |
| 897 | decode_graph_->import_state(prefill.kv_state); |
| 898 | const double import_ms = engine::debug::elapsed_ms(import_start); |
| 899 | std::vector<int32_t> history = tokenized.input_ids; |
| 900 | std::vector<int32_t> generated_ids; |
| 901 | generated_ids.reserve(static_cast<size_t>(generation.max_new_tokens)); |
| 902 | const auto rng_start = Clock::now(); |
| 903 | const TorchCudaSamplingPolicy sampling_policy = engine::sampling::resolve_torch_cuda_sampling_policy( |
| 904 | execution_context_.backend_type(), |
| 905 | execution_context_.config().device, |
| 906 | "vevo2.ar.cuda_sampling_policy", |
nothing calls this directly
no test coverage detected