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

ircd::gpt::pipe::model: Additional sub-buffering for lmhead.

This commit is contained in:
Jason Volk 2021-04-22 12:10:22 -07:00
parent 665eeb6cd7
commit bd460a80ce
2 changed files with 108 additions and 78 deletions

View file

@ -93,6 +93,22 @@ struct ircd::gpt::pipe::model::block
block(gpt::model::block &, const size_t); block(gpt::model::block &, const size_t);
}; };
struct ircd::gpt::pipe::model::language
{
cl::data
master[3];
matrix
pos,
token;
language(cl::data *, const off_t, const gpt::model::embed &);
language(cl::data *, const off_t, gpt::model::embed &);
language(const gpt::model::embed &);
language( gpt::model::embed &);
~language() noexcept;
};
struct ircd::gpt::pipe::model::decoder struct ircd::gpt::pipe::model::decoder
{ {
// Combined-layer memory roots // Combined-layer memory roots
@ -110,17 +126,3 @@ struct ircd::gpt::pipe::model::decoder
decoder(gpt::model::decoder &); decoder(gpt::model::decoder &);
~decoder() noexcept; ~decoder() noexcept;
}; };
struct ircd::gpt::pipe::model::language
{
cl::data
master[3];
matrix
pos,
token;
language(const gpt::model::embed &);
language(gpt::model::embed &);
~language() noexcept;
};

View file

@ -696,70 +696,6 @@ noexcept
{ {
} }
//
// pipe::model::language
//
ircd::gpt::pipe::model::language::language(gpt::model::embed &embed)
:master
{
// params
{
sizeof(embed), mutable_buffer
{
reinterpret_cast<char *>(&embed),
sizeof(embed),
}
},
// first moment
{
sizeof(embed), mutable_buffer{},
},
// second moment
{
sizeof(embed), mutable_buffer{},
},
}
,pos
{
master, 0, mutable_buffer{embed.pos}
}
,token
{
master, sizeof(embed.pos), mutable_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::language(const gpt::model::embed &embed)
:master
{
{
sizeof(embed), const_buffer
{
reinterpret_cast<const char *>(&embed),
sizeof(embed),
}
},
}
,pos
{
master, 0, const_buffer{embed.pos}
}
,token
{
master, sizeof(embed.pos), const_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::~language()
noexcept
{
}
// //
// pipe::model::decoder // pipe::model::decoder
// //
@ -855,6 +791,98 @@ noexcept
{ {
} }
//
// pipe::model::language
//
ircd::gpt::pipe::model::language::language(gpt::model::embed &embed)
:master
{
// params
{
sizeof(embed), mutable_buffer
{
reinterpret_cast<char *>(&embed),
sizeof(embed),
}
},
// first moment
{
sizeof(embed), mutable_buffer{},
},
// second moment
{
sizeof(embed), mutable_buffer{},
},
}
,pos
{
master, 0, mutable_buffer{embed.pos}
}
,token
{
master, sizeof(embed.pos), mutable_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::language(const gpt::model::embed &embed)
:master
{
{
sizeof(embed), const_buffer
{
reinterpret_cast<const char *>(&embed),
sizeof(embed),
}
},
}
,pos
{
master, 0, const_buffer{embed.pos}
}
,token
{
master, sizeof(embed.pos), const_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::language(cl::data *const master,
const off_t offset,
gpt::model::embed &embed)
:pos
{
master, offset, mutable_buffer{embed.pos}
}
,token
{
master, offset + off_t(sizeof(embed.pos)), mutable_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::language(cl::data *const master,
const off_t offset,
const gpt::model::embed &embed)
:pos
{
master, offset, const_buffer{embed.pos}
}
,token
{
master, offset + off_t(sizeof(embed.pos)), const_buffer{embed.token}
}
{
}
ircd::gpt::pipe::model::language::~language()
noexcept
{
}
// //
// pipe::model::block // pipe::model::block
// //