2021-02-26 04:05:02 +01: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
|
|
|
|
#define HAVE_IRCD_GPT_GPT_H
|
|
|
|
|
|
|
|
/// Generative Pre-trained Transformer
|
|
|
|
///
|
|
|
|
namespace ircd::gpt
|
|
|
|
{
|
|
|
|
IRCD_EXCEPTION(ircd::error, error)
|
2021-03-05 02:03:33 +01:00
|
|
|
|
2022-06-20 03:59:29 +02:00
|
|
|
struct samp;
|
|
|
|
struct step;
|
|
|
|
struct epoch;
|
2021-03-10 09:18:23 +01:00
|
|
|
struct task;
|
2021-03-05 02:03:33 +01:00
|
|
|
|
|
|
|
extern log::log log;
|
2021-02-26 04:05:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "vocab.h"
|
2021-04-02 22:01:38 +02:00
|
|
|
#include "token.h"
|
2022-06-20 03:59:29 +02:00
|
|
|
#include "vector.h"
|
|
|
|
#include "model.h"
|
2021-09-18 05:53:53 +02:00
|
|
|
#include "opts.h"
|
|
|
|
#include "ctrl.h"
|
2021-04-02 22:01:38 +02:00
|
|
|
#include "pipe/pipe.h"
|
2022-06-20 03:59:29 +02:00
|
|
|
#include "samp.h"
|
|
|
|
#include "step.h"
|
|
|
|
#include "epoch.h"
|
|
|
|
#include "task.h"
|
|
|
|
|
|
|
|
namespace ircd::gpt
|
|
|
|
{
|
|
|
|
void backprop(const opts &, const u32, const f32, model::decoder &, f32 *const __restrict__ [2]) noexcept;
|
|
|
|
|
|
|
|
void log_debug(const opts &, const ctrl &);
|
|
|
|
void log_debug_token(const opts &, const ctrl &, const uint);
|
|
|
|
void log_debug_attns(const opts &, const ctrl &);
|
|
|
|
void log_debug_attns_top(const opts &, const ctrl &);
|
|
|
|
void log_debug_labels(const opts &, const ctrl &);
|
|
|
|
void log_debug_topn(const opts &, const ctrl &);
|
|
|
|
void log_debug_prof(const opts &, const ctrl &, const pipe::prof &);
|
|
|
|
}
|