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

Method backbone_prefill_embeddings

src/models/heartmula/mula.cpp:1893–1912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1891}
1892
1893HeartMuLaBackbonePrefillOutput HeartMuLaWeightsRuntime::backbone_prefill_embeddings(
1894 const std::vector<float> & embeddings,
1895 int64_t batch_size,
1896 int64_t steps) const {
1897 const auto & config = assets_->mula_config.backbone;
1898 if (batch_size <= 0 || steps <= 0) {
1899 throw std::runtime_error("HeartMuLa backbone prefill requires positive batch and step counts");
1900 }
1901 if (steps > config.max_seq_len) {
1902 throw std::runtime_error("HeartMuLa backbone prefill exceeds model context length");
1903 }
1904 if (static_cast<int64_t>(embeddings.size()) != batch_size * steps * config.embed_dim) {
1905 throw std::runtime_error("HeartMuLa backbone prefill embedding payload size mismatch");
1906 }
1907 if (backbone_prefill_graph_ == nullptr ||
1908 !backbone_prefill_graph_->matches(*this, batch_size, steps)) {
1909 backbone_prefill_graph_ = std::make_unique<HeartMuLaBackbonePrefillGraph>(*this, batch_size, steps);
1910 }
1911 return backbone_prefill_graph_->run(embeddings);
1912}
1913
1914void HeartMuLaWeightsRuntime::reset_backbone_cached_state(
1915 HeartMuLaBackboneCachedState & state,

Callers 1

Calls 3

sizeMethod · 0.45
matchesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected