-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/mlm #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/mlm #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| model: | ||
| core_model: | ||
| core_model_type: generic | ||
| num_layers: 10 | ||
| ffn: | ||
| ffn_type: swiglu | ||
| ffn_dim: 1536 | ||
| normalization: rms_norm | ||
| bias: false | ||
| attn: | ||
| attn_type: generic | ||
| num_heads: 16 | ||
| normalization: rms_norm | ||
| group_size: 4 | ||
| bias: false | ||
| is_causal: false | ||
| embedder: | ||
| tokenizer_type: gpt2 | ||
| embedding_model_type: generic | ||
| dataset_name: simple_en_wiki | ||
| lm_head: | ||
| normalization: rms_norm | ||
| bias: false | ||
| lm_head_type: generic | ||
| hidden_dim: 512 | ||
| context_window: 512 | ||
| vocab_size: 50257 | ||
| model_shell_type: standard | ||
| embedding_weight_tying: true | ||
| positional_encoding_type: rope | ||
| trainer: | ||
| dropout_scheduler: | ||
| dropout_type: constant | ||
| dropout: 0.1 | ||
| dataset: simple_en_wiki | ||
| training: | ||
| trainer_type: base_trainer | ||
| batch_size: 24 | ||
| gradient_accumulation_steps: 20 | ||
| max_iters: 25000 | ||
| lr_decay_iters: 25000 | ||
| warmup_iters: 5000 | ||
| eval_interval: 5000 | ||
| log_interval: 100 | ||
| eval_iters: 200 | ||
| checkpoint_interval: 1000000000.0 | ||
| run_profiler: false | ||
|
|
||
| optimizer: | ||
| name: nanoGPTadamW | ||
| lr: 0.0006 | ||
| min_lr: 6.0e-05 | ||
| weight_decay: 0.1 | ||
| beta1: 0.9 | ||
| beta2: 0.95 | ||
| grad_clip: 1.0 | ||
| decay_lr: true | ||
| warmup_iters: 5000 | ||
| lr_scheduler: | ||
| name: cosine | ||
| dataloader: | ||
| name: mlm | ||
| loss_fn: | ||
| name: cross_entropy | ||
|
|
||
| general: | ||
| logging: | ||
| wandb_log: true | ||
| wandb_project: SuperTinyLanguageModels | ||
| paths: | ||
| output_dir: outputs | ||
| data_dir: data | ||
| checkpoint_dir: checkpoints | ||
| seed: 489 | ||
| device: cuda | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,7 @@ def compute_perplexity(logits, y, char_lengths, mask=None): | |
| # flatten both | ||
| logits = logits.view(-1, logits.size(-1)) | ||
| y = y.view(-1) | ||
| loss = torch.nn.functional.cross_entropy(logits, y, reduction="none") | ||
| loss = torch.nn.functional.cross_entropy(logits, y, reduction="none", ignore_index=-1) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are 100% sure this has no impacts elsewhere? should be okay but..
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Ignore_index's default value is -100. So, changing it from -100 to -1 would only impact existing label (y) assignments of -1 or -100.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| # B, S, 1 | ||
| # unflatten | ||
| loss = loss.view(B, seq_len) | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to stlm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, can I clarify what should be changed to stlm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the dataset_name, but its okay, this will all be reworked later