0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::gpt::pipe: Unify descriptor allocations.

This commit is contained in:
Jason Volk 2021-09-15 04:39:04 -07:00
parent 9628585f43
commit 79b6d4b9da
2 changed files with 36 additions and 10 deletions

View file

@ -20,6 +20,7 @@ struct ircd::gpt::pipe::desc
pipe::code *code;
cl::data
master,
state, // qry/key/val projection (tokens * embed * 3 * float)
accum, // accumulator (tokens * embed * float)
logit, // result logit vector (50257 * float)

View file

@ -453,30 +453,55 @@ ircd::gpt::pipe::desc::desc(pipe::code &code,
{
&code
}
,master
{
0
+ 512 * 3 * 768 * sizeof(float)
+ 512 * 768 * sizeof(float)
+ 65536 * sizeof(float)
+ 65536 * sizeof(float)
+ 65536 * sizeof(float)
,mutable_buffer{}
}
,state
{
512 * 3 * 768 * sizeof(float),
mutable_buffer{}
master,
{
512 * 3 * 768 * sizeof(float),
off_t(0),
},
}
,accum
{
512 * 768 * sizeof(float),
mutable_buffer{}
master,
{
512 * 768 * sizeof(float),
state.offset() + off_t(state.size()),
},
}
,logit
{
65536 * sizeof(float),
mutable_buffer{}
master,
{
65536 * sizeof(float),
accum.offset() + off_t(accum.size()),
},
}
,logexp
{
65536 * sizeof(float),
mutable_buffer{}
master,
{
65536 * sizeof(float),
logit.offset() + off_t(logit.size()),
},
}
,logsm
{
65536 * sizeof(float),
mutable_buffer{}
master,
{
65536 * sizeof(float),
logexp.offset() + off_t(logexp.size()),
},
}
,ctrl
{