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>
20 lines
1.0 KiB
C++
20 lines
1.0 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
|
|
namespace strata::kernels {
|
|
// Configure before session capture. Existing graphs retain their selected kernels.
|
|
// This experiment is off by default and does not modify the legacy router.
|
|
void native_router_set_enabled(bool enabled);
|
|
bool native_router_enabled();
|
|
|
|
// Pinned CUDA topk-moe contract for ONE token, 512 experts, top 10, softmax,
|
|
// no selection bias, lower normalization clamp 2^-14, and scale 1.
|
|
// Reads 512 finite F32 logits; writes 10 I32 IDs and 10 F32 weights. Equal
|
|
// computed probabilities select the lower expert index. All spans must be
|
|
// four-byte aligned and outputs disjoint from each other and the input.
|
|
// Requires a nonnull ordered CUDA stream. No allocation or synchronization.
|
|
void native_router_top10(const float* logits, int32_t* ids, float* weights, void* stream);
|
|
/// n_tok rows at once (logits [n,512], ids/weights [n,10]); each row exactly as the single call.
|
|
void native_router_top10_multi(const float* logits, int32_t* ids, float* weights, int n_tok, void* stream);
|
|
}
|