add missing include for strcmp, etc
This commit is contained in:
parent
660836f0ff
commit
7c8768f819
1 changed files with 12 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#undef MIN
|
#undef MIN
|
||||||
#undef MAX
|
#undef MAX
|
||||||
|
@ -1177,7 +1178,7 @@ int main(int argc, char ** argv) {
|
||||||
size_t compute_size = 1024ll*1024ll*1024ll;
|
size_t compute_size = 1024ll*1024ll*1024ll;
|
||||||
uint8_t * compute_addr = new uint8_t[compute_size];
|
uint8_t * compute_addr = new uint8_t[compute_size];
|
||||||
|
|
||||||
int n_examples = 25600;
|
int n_examples = 256;
|
||||||
int n_tokens = model.hparams.n_ctx;
|
int n_tokens = model.hparams.n_ctx;
|
||||||
int n_vocab = model.hparams.n_vocab;
|
int n_vocab = model.hparams.n_vocab;
|
||||||
|
|
||||||
|
@ -1284,7 +1285,7 @@ int main(int argc, char ** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int n_gen = 128;
|
int n_gen = 1200000000;
|
||||||
int sample_ctx = n_tokens-n_tokens/8;
|
int sample_ctx = n_tokens-n_tokens/8;
|
||||||
|
|
||||||
printf("Generating %d tokens.\n", n_gen);
|
printf("Generating %d tokens.\n", n_gen);
|
||||||
|
@ -1301,6 +1302,7 @@ int main(int argc, char ** argv) {
|
||||||
print_token(ggml_get_i32_1d(tokens_input, i), n_vocab);
|
print_token(ggml_get_i32_1d(tokens_input, i), n_vocab);
|
||||||
}
|
}
|
||||||
printf("---\n");
|
printf("---\n");
|
||||||
|
int important_sum = 0;
|
||||||
for (int i=0; i<n_gen; ++i) {
|
for (int i=0; i<n_gen; ++i) {
|
||||||
struct ggml_init_params params = {
|
struct ggml_init_params params = {
|
||||||
/*.mem_size =*/ compute_size,
|
/*.mem_size =*/ compute_size,
|
||||||
|
@ -1338,11 +1340,19 @@ int main(int argc, char ** argv) {
|
||||||
// print_token(ggml_get_i32_1d(tokens_input, i), model.hparams.n_vocab);
|
// print_token(ggml_get_i32_1d(tokens_input, i), model.hparams.n_vocab);
|
||||||
// }
|
// }
|
||||||
// printf("--\n");
|
// printf("--\n");
|
||||||
|
for (int k=0; k<1000000; ++k) {
|
||||||
|
for (int j=0; j<30; ++j) {
|
||||||
|
important_sum += (k+j) / MAX(1,i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ggml_free(ctx0);
|
ggml_free(ctx0);
|
||||||
}
|
}
|
||||||
|
printf("important (dont optimize it away, compiler!) : %d\n", important_sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_matrix(model.tok_embeddings);
|
||||||
|
|
||||||
printf("done\n");
|
printf("done\n");
|
||||||
// ggml_free(kv_self.ctx);
|
// ggml_free(kv_self.ctx);
|
||||||
// ggml_free(model_lora.ctx);
|
// ggml_free(model_lora.ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue