MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ attention_mix_stage()

DependencyStage MayaFlux::Yantra::TensorKernels::attention_mix_stage ( uint64_t weights,
uint64_t v,
uint64_t dst,
uint32_t heads,
uint32_t dim,
uint32_t time )
inlinenodiscard

One nn_attention_mix dispatch: the values of every position mixed by each query's attention weights.

weights is [heads, time, time] as attention_scores_stage and softmax_stage leave it. v and dst are [heads * dim, time].

Exceptions
std::invalid_argumentWhen heads, dim or time is 0.

Definition at line 245 of file Stages.hpp.

247{
248 if (heads == 0 || dim == 0 || time == 0) {
249 detail::refuse("Attention needs heads, a head width and positions");
250 }
251 const AttentionMixPC pc { .weights = weights, .v = v, .dst = dst, .heads = heads, .dim = dim, .time = time, .reserved = 0 };
252 return detail::make_grid_stage(attention_mix_shader, pc, static_cast<size_t>(heads) * dim * time);
253}
void refuse(std::string_view message)
Definition Layers.hpp:74
DependencyStage make_grid_stage(const char *shader, const PC &pc, size_t invocations)
Definition Stages.hpp:38
constexpr const char * attention_mix_shader
Definition Layouts.hpp:32

References attention_mix_shader, MayaFlux::Yantra::TensorKernels::detail::make_grid_stage(), and MayaFlux::Yantra::TensorKernels::detail::refuse().

Referenced by MayaFlux::Yantra::HubertPhonemeModel::Impl::run().

Here is the call graph for this function:
Here is the caller graph for this function: