Archived
libxe2: the thirteen sampler ops
Each is libref's arithmetic on the card. The serial stages (penalties, DRY, the n-gram ban, top-p, min-p, typical, XTC, the pick) run libref's loops unchanged, one work-item a row, so their sums keep libref's order. Temperature and the grammar mask are one work-item an element. argmax, top-k and logprobs scan the vocabulary with one work-group a row, reducing a 64-bit key -- the value's order-preserving bits above the complemented index -- so the largest value wins and ties go to the lower id, libref's rule; top-k is libref's topk_next k times, and a greedy row takes no rounds. DRY's per-token map is replaced by a first-occurrence scan that computes the same maxima. rad-kbench against libref: the whole fixture with libxe2 first, 1101/1101; MiniCPM5-2B's sampler cases 56/56, all at rel_l2 0. With this, every op MiniCPM5-2B bf16 issues with speculation off has a device row in libxe2 (13 model ops, 13 sampler ops). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
This commit is contained in:
1 parent
ed76fc8aaa
commit
d0e797844e
3 files changed
+769
No files matched your search
@@ -22,4 +22,18 @@ int logits_gemm(const RadArgs* a, RadStream s);
|
||||
int kv_store(const RadArgs* a, RadStream s);
|
||||
int attn_paged(const RadArgs* a, RadStream s);
|
||||
|
||||
int sample_penalties(const RadArgs* a, RadStream s);
|
||||
int sample_dry(const RadArgs* a, RadStream s);
|
||||
int sample_ngram_ban(const RadArgs* a, RadStream s);
|
||||
int sample_temp(const RadArgs* a, RadStream s);
|
||||
int sample_mask(const RadArgs* a, RadStream s);
|
||||
int sample_topk(const RadArgs* a, RadStream s);
|
||||
int sample_topp(const RadArgs* a, RadStream s);
|
||||
int sample_minp(const RadArgs* a, RadStream s);
|
||||
int sample_typical(const RadArgs* a, RadStream s);
|
||||
int sample_xtc(const RadArgs* a, RadStream s);
|
||||
int sample_pick(const RadArgs* a, RadStream s);
|
||||
int sample_argmax(const RadArgs* a, RadStream s);
|
||||
int sample_logprobs(const RadArgs* a, RadStream s);
|
||||
|
||||
} // namespace xe2
|
||||
Reference in new issue
Block a user