Source: https://github.com/Niko1221/Strata, commit 6f32ec070f23ced9f50e704d854d775da52591ab (engine 0.1.39, MIT). Every file is as upstream published it; later commits show exactly what this fork changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
19 lines
1.0 KiB
C++
19 lines
1.0 KiB
C++
#pragma once
|
|
|
|
namespace strata::kernels {
|
|
|
|
// Pinned llama.cpp 3cf03257f219afbe7334045ff7c6a06ac68c627d CUDA weighted F32
|
|
// RMSNorm for contiguous [n_cols, n_rows] data and equally shaped F32 gamma.
|
|
// Every row has independent norm statistics. Output is (scale * input) * gamma.
|
|
// Uses 256 threads below n_cols=1024, otherwise 1024, with the pinned XOR tree.
|
|
// Compile the implementation with --use_fast_math; no FP64, allocation, or wait.
|
|
// All buffers are caller-owned, nonoverlapping, and at least four-byte aligned.
|
|
// Require positive dimensions and finite nonnegative epsilon. Inputs/gamma and
|
|
// intermediate sums must be finite; epsilon=0 additionally requires nonzero rows.
|
|
// Enqueues on the supplied CUDA stream. A null handle explicitly selects CUDA's
|
|
// default stream, preserving gr_read's existing API; this function never syncs.
|
|
void native_gr_rms_norm_weighted(const float* input, const float* gamma, float* output,
|
|
int n_cols, int n_rows, float epsilon, void* stream);
|
|
|
|
} // namespace strata::kernels
|