0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00
construct/include/ircd/gpt/token.h

108 lines
1.5 KiB
C
Raw Normal View History

2021-03-30 03:22:42 +02:00
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2021 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
#pragma once
2021-04-02 22:01:38 +02:00
#define HAVE_IRCD_GPT_TOKEN_H
2021-03-30 03:22:42 +02:00
struct ircd_gpt_attn_mask
{
bool
token[1024];
};
2021-04-02 22:01:38 +02:00
union ircd_gpt_token
2021-03-30 03:22:42 +02:00
{
float
word[768],
attn[12][64];
};
#ifdef __OPENCL_C_VERSION__
2021-04-02 22:01:38 +02:00
union ircd_gpt_tokenv
2021-03-30 03:22:42 +02:00
{
float4
word[768/4],
attn[12][64/4];
union ircd_gpt_token
token;
2021-03-30 03:22:42 +02:00
};
#endif
2021-03-30 03:22:42 +02:00
struct ircd_gpt_attn_qkv
2021-03-30 03:22:42 +02:00
{
union ircd_gpt_token
2021-03-30 03:22:42 +02:00
qry,
key,
val;
};
#ifdef __OPENCL_C_VERSION__
struct ircd_gpt_attn_qkvv
2021-03-30 03:22:42 +02:00
{
2021-04-02 22:01:38 +02:00
union ircd_gpt_tokenv
2021-03-30 03:22:42 +02:00
qry,
key,
val;
};
#endif
2021-03-30 03:22:42 +02:00
union ircd_gpt_attn_aperature
2021-03-30 03:22:42 +02:00
{
float
word[768],
fcon[2304],
proj[3][768],
qkv[3][12][64],
attn[12][64];
union ircd_gpt_token
token[3];
2021-03-30 03:22:42 +02:00
};
#ifdef __OPENCL_C_VERSION__
union ircd_gpt_attn_aperaturev
2021-03-30 03:22:42 +02:00
{
float4
word[768/4],
fcon[2304/4],
proj[3][768/4],
qkv[3][12][64/4],
attn[12][64/4];
union ircd_gpt_tokenv
token[3];
};
#endif
union ircd_gpt_ffnn_aperature
{
float
word[768],
fcon[3072],
proj[4][768];
union ircd_gpt_token
token[4];
2021-03-30 03:22:42 +02:00
};
#ifdef __OPENCL_C_VERSION__
union ircd_gpt_ffnn_aperaturev
{
float4
word[768/4],
fcon[3072/4],
proj[4][768/4];
union ircd_gpt_tokenv
token[4];
};
2021-03-30 03:22:42 +02:00
#endif