0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd::gpt::pipe::range: Use opts for construction.

This commit is contained in:
Jason Volk 2022-10-15 18:11:27 +00:00
parent bc6b7486ba
commit 1ac69df8cd
2 changed files with 28 additions and 25 deletions

View file

@ -30,7 +30,8 @@ struct ircd::gpt::pipe::range
prop_attn, prop_attn,
prop_ffnn; prop_ffnn;
range(const uint tick, range(const opts &opts,
const uint tick,
const uint count, const uint count,
const uint tokens, const uint tokens,
const uint cached, const uint cached,

View file

@ -232,6 +232,7 @@ ircd::gpt::pipe::cycle::cycle(gpt::samp &samp)
} }
,range ,range
{ {
samp.opts,
tick, tick,
count, count,
tokens, tokens,
@ -365,7 +366,8 @@ noexcept
// pipe::range // pipe::range
// //
ircd::gpt::pipe::range::range(const uint tick, ircd::gpt::pipe::range::range(const opts &opts,
const uint tick,
const uint count, const uint count,
const uint tokens, const uint tokens,
const uint cached, const uint cached,
@ -374,20 +376,20 @@ ircd::gpt::pipe::range::range(const uint tick,
noexcept noexcept
:_full :_full
{ {
{ (tokens - cached) * 192UL, 0 }, { opts.embed_width * (tokens - cached) },
{ 192UL, 0 }, { opts.embed_width },
{ cached * 192UL, 0 }, { opts.embed_width * cached },
} }
,_last ,_last
{ {
{ 1 * 192UL, 0 }, { opts.embed_width * 1 },
{ 192UL, 0 }, { opts.embed_width },
{ (count - 1) * 192UL, 0 }, { opts.embed_width * (count - 1) },
} }
,alloc ,alloc
{ {
{ (tick == 0) * 192UL, 0 }, { opts.embed_width * (tick == 0) },
{ 192UL, 0 }, { opts.embed_width },
} }
,embed ,embed
{ {
@ -421,40 +423,40 @@ noexcept
_last: _last:
cl::kern::range{}, cl::kern::range{},
} }
,logit // TODO: align_up(50257) / 64|256 ,logit
{ {
{ int(fwd) * 50432UL, 0 }, { pad_to(opts.logits, 64L) * int(fwd) },
{ 64L, 0 }, { 64L },
} }
,logsm ,logsm
{ {
{ int(fwd) * 1 * 256UL, 0 }, { 256UL * int(fwd) },
{ 256UL, 0 }, { 256UL },
} }
,select ,select
{ {
{ int(fwd) * 1 * 256UL, 0 }, { 256UL * int(fwd) },
{ 256UL, 0 }, { 256UL },
} }
,prop_embed ,prop_embed
{ {
{ int(rev) * 0 * 192UL, 0 }, { opts.embed_width * int(rev) },
{ 192UL, 0 }, { opts.embed_width },
} }
,prop_norm ,prop_norm
{ {
{ int(rev) * 0 * 192UL, 0 }, { opts.embed_width * int(rev) },
{ 192UL, 0 }, { opts.embed_width },
} }
,prop_attn ,prop_attn
{ {
{ int(rev) * 0 * 192UL, 0 }, { opts.embed_width * int(rev) },
{ 192UL, 0 }, { opts.embed_width },
} }
,prop_ffnn ,prop_ffnn
{ {
{ int(rev) * 0 * 192UL, 0 }, { opts.embed_width * int(rev) },
{ 192UL, 0 }, { opts.embed_width },
} }
{ {
} }