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

Function apply_modulated_rms_norm

src/models/ace_step/diffusion.cpp:228–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226 auto embedding = modules::ConcatModule({1}).build(ctx, cos_part, sin_part);
227 auto temb = modules::LinearModule({256, hidden_size, true, GGML_PREC_F32}).build(ctx, embedding, weights.fc1);
228 temb = modules::SiluModule{}.build(ctx, temb);
229 temb = modules::LinearModule({hidden_size, hidden_size, true, GGML_PREC_F32}).build(ctx, temb, weights.fc2);
230 auto proj_in = modules::SiluModule{}.build(ctx, temb);
231 auto timestep_proj =
232 modules::LinearModule({hidden_size, hidden_size * 6, true, GGML_PREC_F32}).build(ctx, proj_in, weights.time_proj);
233 timestep_proj = core::reshape_tensor(
234 ctx,
235 timestep_proj,
236 core::TensorShape::from_dims({timestep_proj.shape.dims[0], int64_t{6}, hidden_size}));
237 return TimeEmbeddingOutputs{temb, timestep_proj};
238}
239
240core::TensorValue build_mlp(
241 core::ModuleBuildContext & ctx,
242 const core::TensorValue & input,
243 const modules::LinearWeights & gate_proj,
244 const modules::LinearWeights & up_proj,

Callers 2

dit_layerFunction · 0.85
buildMethod · 0.85

Calls 4

RMSNormModuleClass · 0.85
wrap_tensorFunction · 0.85
ggml_addFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected