MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / Vevo2AutoregressiveRuntime

Method Vevo2AutoregressiveRuntime

src/models/vevo2/ar.cpp:880–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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",

Callers

nothing calls this directly

Calls 6

open_tensor_sourceFunction · 0.85
load_ar_weightsFunction · 0.85
require_assetsFunction · 0.70
backendMethod · 0.45
backend_typeMethod · 0.45
release_storageMethod · 0.45

Tested by

no test coverage detected