Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- checkpoints/quarantine/20260802T040637Z/official/mdlm/owt/configuration_mdlm.py +31 -0
- checkpoints/quarantine/20260818T073943Z/official/flm/lm1b/config.json +209 -0
- checkpoints/quarantine/20260818T074044Z/official/fmlm/lm1b/README.md +45 -0
- checkpoints/quarantine/20260818T074500Z/official/langflow/owt/README.md +61 -0
- checkpoints/quarantine/20260818T074854Z/official/duo_dcd/owt/README.md +52 -0
- checkpoints/quarantine/20260818T074907Z/official/mdlm/owt/README.md +67 -0
- checkpoints/quarantine/20260818T074907Z/official/mdlm/owt/modeling_mdlm.py +450 -0
- checkpoints/quarantine/20260818T074924Z/official/mdlm_sdtt/owt/config.json +207 -0
- checkpoints/quarantine/20260820T072046Z/official/fmlm/owt/config.json +223 -0
- checkpoints/quarantine/20260820T072128Z/official/langflow/owt/__init__.py +6 -0
- checkpoints/quarantine/20260820T072218Z/official/duo/owt/README.md +53 -0
- checkpoints/quarantine/20260820T072218Z/official/duo/owt/config.py +29 -0
- checkpoints/quarantine/20260820T072232Z/official/duo_dcd/owt/config.json +23 -0
- checkpoints/quarantine/20260820T072232Z/official/duo_dcd/owt/model.py +601 -0
- checkpoints/quarantine/20260820T072244Z/official/mdlm/owt/config.json +22 -0
- checkpoints/quarantine/20260820T073530Z/official/rdlm/lm1b/Text8/config.yaml +73 -0
- checkpoints/quarantine/20260821T024751Z/official/langflow/lm1b/__init__.py +6 -0
- checkpoints/quarantine/20260821T024800Z/official/duo/owt/config.py +29 -0
- checkpoints/quarantine/20260821T024808Z/official/duo_dcd/owt/README.md +52 -0
- checkpoints/quarantine/20260821T024817Z/official/mdlm/owt/configuration_mdlm.py +31 -0
- checkpoints/quarantine/20260825T100201Z/official/langflow/owt/__init__.py +6 -0
- checkpoints/quarantine/20260825T100215Z/official/langflow/lm1b/config.json +29 -0
- checkpoints/quarantine/20260825T100308Z/official/mdlm/owt/README.md +67 -0
- checkpoints/quarantine/20260825T100308Z/official/mdlm/owt/configuration_mdlm.py +31 -0
- checkpoints/reference_reproduction/mdlm_di4c/lm1b/stdout.log +0 -0
- results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/config.yaml +180 -0
- results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/recipe.json +30 -0
- results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/stderr.log +9 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/config.yaml +180 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/hydra.yaml +203 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/overrides.yaml +41 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/launch_argv.json +48 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/provenance.json +121 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/recipe.json +30 -0
- results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/stderr.log +9 -0
- results/conditional/metrics/lm1b/flm/steps_32/metrics.json +95 -0
- results/conditional/metrics/lm1b/flm/steps_8/metrics.json +95 -0
- results/conditional/metrics/lm1b/fmlm/steps_32/metrics.json +95 -0
- results/conditional/metrics/lm1b/langflow/steps_4/metrics.json +95 -0
- results/conditional/metrics/lm1b/mdlm/steps_4/metrics.json +95 -0
- results/conditional/metrics/lm1b/mdlm_di4c/steps_4/metrics.json +95 -0
- results/conditional/metrics/lm1b/rdlm/steps_1000/metrics.json +95 -0
- results/conditional/metrics/lm1b/rdlm/steps_1024/metrics.json +95 -0
- results/conditional/metrics/owt/duo/steps_1/metrics.json +91 -0
- results/conditional/metrics/owt/duo/steps_2/metrics.json +91 -0
- results/conditional/metrics/owt/flm/steps_2/metrics.json +91 -0
- results/conditional/metrics/owt/mdlm_di4c/steps_16/metrics.json +91 -0
- results/conditional/samples/lm1b/candi/steps_1/samples.jsonl +0 -0
- results/conditional/samples/lm1b/candi/steps_1/upstream_hydra/.hydra/config.yaml +154 -0
- results/conditional/samples/lm1b/candi/steps_1024/stderr.log +13 -0
checkpoints/quarantine/20260802T040637Z/official/mdlm/owt/configuration_mdlm.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""MDLM config for Hugging Face.
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import transformers
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class MDLMConfig(transformers.PretrainedConfig):
|
| 9 |
+
"""Hugging Face configuration class for MDLM."""
|
| 10 |
+
model_type = "mdlm"
|
| 11 |
+
|
| 12 |
+
def __init__(
|
| 13 |
+
self,
|
| 14 |
+
vocab_size: int = 50258,
|
| 15 |
+
model_length: int = 1024,
|
| 16 |
+
hidden_dim: int = 768,
|
| 17 |
+
cond_dim: int = 129,
|
| 18 |
+
n_blocks: int = 12,
|
| 19 |
+
n_heads: int = 12,
|
| 20 |
+
dropout: float = 0.1,
|
| 21 |
+
time_conditioning: bool = False,
|
| 22 |
+
** kwargs):
|
| 23 |
+
super().__init__(**kwargs)
|
| 24 |
+
self.vocab_size = vocab_size
|
| 25 |
+
self.model_length = model_length
|
| 26 |
+
self.hidden_dim = hidden_dim
|
| 27 |
+
self.cond_dim = cond_dim
|
| 28 |
+
self.n_blocks = n_blocks
|
| 29 |
+
self.n_heads = n_heads
|
| 30 |
+
self.dropout = dropout
|
| 31 |
+
self.time_conditioning = time_conditioning
|
checkpoints/quarantine/20260818T073943Z/official/flm/lm1b/config.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": {
|
| 3 |
+
"algo": {
|
| 4 |
+
"T": 0,
|
| 5 |
+
"backbone": "dit",
|
| 6 |
+
"causal_attention": false,
|
| 7 |
+
"curriculum_end": 1000000,
|
| 8 |
+
"curriculum_start": 0,
|
| 9 |
+
"double_temb": false,
|
| 10 |
+
"flow_loss_type": "ce",
|
| 11 |
+
"flow_ratio": 0.75,
|
| 12 |
+
"gumbel_tau_log10_end": -0.0,
|
| 13 |
+
"gumbel_tau_log10_start": -0.0,
|
| 14 |
+
"ignore_bos": false,
|
| 15 |
+
"jvp_api": "autograd",
|
| 16 |
+
"loss_scale": "none",
|
| 17 |
+
"n_separated_blocks": -1,
|
| 18 |
+
"name": "dos",
|
| 19 |
+
"parameterization": "mean",
|
| 20 |
+
"pred_log_interval": 2000,
|
| 21 |
+
"sigma_min": 0.0001,
|
| 22 |
+
"subs_masking": false,
|
| 23 |
+
"t_max": 1.0,
|
| 24 |
+
"t_min": 0.0,
|
| 25 |
+
"time_condition": "alpha_t",
|
| 26 |
+
"time_conditioning": true,
|
| 27 |
+
"use_curriculum": true,
|
| 28 |
+
"use_discrete_schedule": true
|
| 29 |
+
},
|
| 30 |
+
"callbacks": {
|
| 31 |
+
"checkpoint_every_n_steps": {
|
| 32 |
+
"_target_": "lightning.pytorch.callbacks.ModelCheckpoint",
|
| 33 |
+
"auto_insert_metric_name": false,
|
| 34 |
+
"dirpath": "/home/david3684/projects/flm/hf_upload/checkpoints",
|
| 35 |
+
"every_n_train_steps": 50000,
|
| 36 |
+
"save_last": false,
|
| 37 |
+
"save_top_k": -1,
|
| 38 |
+
"verbose": true
|
| 39 |
+
},
|
| 40 |
+
"checkpoint_monitor": {
|
| 41 |
+
"_target_": "lightning.pytorch.callbacks.ModelCheckpoint",
|
| 42 |
+
"auto_insert_metric_name": false,
|
| 43 |
+
"dirpath": "/home/david3684/projects/flm/hf_upload/checkpoints",
|
| 44 |
+
"filename": "best_nll",
|
| 45 |
+
"mode": "min",
|
| 46 |
+
"monitor": "val/nll",
|
| 47 |
+
"save_last": true,
|
| 48 |
+
"save_top_k": 1,
|
| 49 |
+
"verbose": true
|
| 50 |
+
},
|
| 51 |
+
"learning_rate_monitor": {
|
| 52 |
+
"_target_": "lightning.pytorch.callbacks.LearningRateMonitor",
|
| 53 |
+
"logging_interval": "step"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"checkpointing": {
|
| 57 |
+
"resume_ckpt_path": "/home/work/RADAR/workspace/KAIST/discrete-mean-flow/text/outputs/lm1b/2026.01.05/154016/checkpoints/47-650000.ckpt",
|
| 58 |
+
"resume_from_ckpt": true,
|
| 59 |
+
"save_dir": "/home/david3684/projects/flm/hf_upload"
|
| 60 |
+
},
|
| 61 |
+
"data": {
|
| 62 |
+
"cache_dir": "/home/work/RADAR/workspace/KAIST/cdBDD/datasets/lm1b",
|
| 63 |
+
"insert_train_eos": true,
|
| 64 |
+
"insert_valid_eos": true,
|
| 65 |
+
"streaming": false,
|
| 66 |
+
"tokenizer_name_or_path": "bert-base-uncased",
|
| 67 |
+
"train": "lm1b",
|
| 68 |
+
"valid": "lm1b",
|
| 69 |
+
"wrap": true
|
| 70 |
+
},
|
| 71 |
+
"eval": {
|
| 72 |
+
"checkpoint_path": "",
|
| 73 |
+
"compute_generative_perplexity": true,
|
| 74 |
+
"compute_perplexity_on_sanity": false,
|
| 75 |
+
"disable_ema": false,
|
| 76 |
+
"gen_ppl_eval_model_name_or_path": "gpt2-large",
|
| 77 |
+
"generate_samples": true,
|
| 78 |
+
"generated_samples_path": "/home/david3684/projects/flm/hf_upload/samples.json",
|
| 79 |
+
"perplexity_batch_size": 8
|
| 80 |
+
},
|
| 81 |
+
"is_di4c": false,
|
| 82 |
+
"is_di4c_deterministic": true,
|
| 83 |
+
"loader": {
|
| 84 |
+
"batch_size": 128,
|
| 85 |
+
"eval_batch_size": 128,
|
| 86 |
+
"eval_global_batch_size": 512,
|
| 87 |
+
"global_batch_size": 512,
|
| 88 |
+
"num_workers": 192,
|
| 89 |
+
"pin_memory": true
|
| 90 |
+
},
|
| 91 |
+
"lr_scheduler": {
|
| 92 |
+
"_target_": "transformers.get_constant_schedule_with_warmup",
|
| 93 |
+
"num_warmup_steps": 2500
|
| 94 |
+
},
|
| 95 |
+
"mode": "train",
|
| 96 |
+
"model": {
|
| 97 |
+
"cond_dim": 128,
|
| 98 |
+
"dropout": 0.1,
|
| 99 |
+
"hidden_size": 768,
|
| 100 |
+
"length": 128,
|
| 101 |
+
"n_blocks": 12,
|
| 102 |
+
"n_heads": 12,
|
| 103 |
+
"name": "small",
|
| 104 |
+
"scale_by_sigma": true,
|
| 105 |
+
"tie_word_embeddings": false,
|
| 106 |
+
"type": "ddit",
|
| 107 |
+
"vocab_lookup": true
|
| 108 |
+
},
|
| 109 |
+
"noise": {
|
| 110 |
+
"denoiser_latent_conditioning": -1,
|
| 111 |
+
"eps": 0,
|
| 112 |
+
"freeze_decoder": false,
|
| 113 |
+
"freeze_encoder": false,
|
| 114 |
+
"parameterization": "log-linear",
|
| 115 |
+
"type": "log-linear"
|
| 116 |
+
},
|
| 117 |
+
"optim": {
|
| 118 |
+
"beta1": 0.9,
|
| 119 |
+
"beta2": 0.999,
|
| 120 |
+
"eps": 1e-08,
|
| 121 |
+
"ln_tune": "none",
|
| 122 |
+
"lr": 0.0003,
|
| 123 |
+
"use_muon": false,
|
| 124 |
+
"weight_decay": 0
|
| 125 |
+
},
|
| 126 |
+
"prior": {
|
| 127 |
+
"latent_height": 0,
|
| 128 |
+
"latent_width": 0,
|
| 129 |
+
"type": "none"
|
| 130 |
+
},
|
| 131 |
+
"sampling": {
|
| 132 |
+
"argmax_correction": false,
|
| 133 |
+
"hard_start": false,
|
| 134 |
+
"noise_removal": "meanflow",
|
| 135 |
+
"noise_removal_list": [
|
| 136 |
+
"uniform",
|
| 137 |
+
"uniform_alpha"
|
| 138 |
+
],
|
| 139 |
+
"num_reflow_samples": 50000,
|
| 140 |
+
"num_sample_batches": 1,
|
| 141 |
+
"num_sample_log": 2,
|
| 142 |
+
"num_strides": 1,
|
| 143 |
+
"p_nucleus": 1.0,
|
| 144 |
+
"predictor": "ancestral",
|
| 145 |
+
"semi_ar": false,
|
| 146 |
+
"solver": "euler",
|
| 147 |
+
"steps": [
|
| 148 |
+
1024
|
| 149 |
+
],
|
| 150 |
+
"stride_length": 1,
|
| 151 |
+
"tau_log10": 0.0,
|
| 152 |
+
"temperature": 1.0,
|
| 153 |
+
"use_float64": true
|
| 154 |
+
},
|
| 155 |
+
"seed": 1,
|
| 156 |
+
"strategy": {
|
| 157 |
+
"_target_": "lightning.pytorch.strategies.DDPStrategy",
|
| 158 |
+
"find_unused_parameters": true
|
| 159 |
+
},
|
| 160 |
+
"trainer": {
|
| 161 |
+
"_target_": "lightning.Trainer",
|
| 162 |
+
"accelerator": "cuda",
|
| 163 |
+
"accumulate_grad_batches": 1,
|
| 164 |
+
"devices": 8,
|
| 165 |
+
"gradient_clip_val": 1.0,
|
| 166 |
+
"limit_train_batches": 1.0,
|
| 167 |
+
"limit_val_batches": 1.0,
|
| 168 |
+
"log_every_n_steps": 100,
|
| 169 |
+
"max_steps": 1000000,
|
| 170 |
+
"num_nodes": 1,
|
| 171 |
+
"num_sanity_val_steps": 2,
|
| 172 |
+
"precision": "bf16",
|
| 173 |
+
"val_check_interval": 10000
|
| 174 |
+
},
|
| 175 |
+
"training": {
|
| 176 |
+
"antithetic_sampling": true,
|
| 177 |
+
"change_of_variables": false,
|
| 178 |
+
"double_ema": 0.0,
|
| 179 |
+
"ema": 0.9999,
|
| 180 |
+
"finetune_path": "",
|
| 181 |
+
"importance_sampling": false,
|
| 182 |
+
"load_ema": false,
|
| 183 |
+
"loss_precision": "bf16",
|
| 184 |
+
"loss_type": "flow",
|
| 185 |
+
"loss_weighting": false,
|
| 186 |
+
"not_sampling_t": false,
|
| 187 |
+
"pred_type": "x0",
|
| 188 |
+
"sampling_eps": 0.001,
|
| 189 |
+
"t_curriculum_max": 1.0,
|
| 190 |
+
"t_curriculum_min": 0.0,
|
| 191 |
+
"t_curriculum_steps": 100000,
|
| 192 |
+
"torch_compile_mode": "default",
|
| 193 |
+
"use_torch_compile": true
|
| 194 |
+
},
|
| 195 |
+
"wandb": {
|
| 196 |
+
"group": null,
|
| 197 |
+
"id": "fc867e70",
|
| 198 |
+
"job_type": null,
|
| 199 |
+
"name": "lm1b_full_flow_no_input_softmax_no_loss_scale_ce_loss_fc867e70",
|
| 200 |
+
"notes": "DOS",
|
| 201 |
+
"project": "lm1b_full",
|
| 202 |
+
"tags": [
|
| 203 |
+
"lm1b",
|
| 204 |
+
"dos"
|
| 205 |
+
]
|
| 206 |
+
}
|
| 207 |
+
},
|
| 208 |
+
"vocab_size": 30522
|
| 209 |
+
}
|
checkpoints/quarantine/20260818T074044Z/official/fmlm/lm1b/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- model_hub_mixin
|
| 4 |
+
- pytorch_model_hub_mixin
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
base_model:
|
| 9 |
+
- david3684/FLM-B-LM1B
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
## FMLM (LM1B)
|
| 13 |
+
|
| 14 |
+
For more information and implementation details, visit our github repository: [FLM](https://github.com/david3684/flm).
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
The model has a context length of 128, distilled from 1M steps trained FLM checkpoint trained on the One Billion Words (LM1B) dataset.
|
| 19 |
+
|
| 20 |
+
For more details, please see our paper:
|
| 21 |
+
- [arXiv:2602.16813](https://arxiv.org/abs/2602.16813)
|
| 22 |
+
- [Huggingface Papers](https://huggingface.co/papers/2602.16813)
|
| 23 |
+
|
| 24 |
+
## Citation
|
| 25 |
+
|
| 26 |
+
Please cite our work using the bibtex below:
|
| 27 |
+
|
| 28 |
+
**BibTeX:**
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
```bibtex
|
| 32 |
+
@article{lee2026flow,
|
| 33 |
+
title={Flow Map Language Models: One-step Language Modeling via Continuous Denoising},
|
| 34 |
+
author={Chanhyuk Lee and Jaehoon Yoo and Manan Agarwal
|
| 35 |
+
and Sheel Shah and Jerry Huang
|
| 36 |
+
and Aditi Raghunathan and Seunghoon Hong
|
| 37 |
+
and Nicholas M. Boffi and Jinwoo Kim},
|
| 38 |
+
journal={arXiv preprint arXiv:2602.16813},
|
| 39 |
+
year={2026},
|
| 40 |
+
}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Model Card Contact
|
| 44 |
+
|
| 45 |
+
Chanhyuk Lee (chanhyuk-lee@kaist.ac.kr)
|
checkpoints/quarantine/20260818T074500Z/official/langflow/owt/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- Skylion007/openwebtext
|
| 4 |
+
papers:
|
| 5 |
+
- arxiv: 2604.11748
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
library_name: transformers
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
metrics:
|
| 11 |
+
- perplexity
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# LangFlow
|
| 16 |
+
|
| 17 |
+
LangFlow is a continuous diffusion language model that operates in embedding space. Unlike discrete diffusion models (MDLM, SEDD, DUO), LangFlow performs diffusion directly on continuous token embeddings, enabling smoother denoising dynamics.
|
| 18 |
+
|
| 19 |
+
For more details, please see our paper: [LangFlow: Continuous Diffusion Rivals Discrete in Language Modeling](https://arxiv.org/abs/2604.11748).
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
## Using LangFlow
|
| 23 |
+
|
| 24 |
+
To use the pre-trained model for text generation, use the following snippet:
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 28 |
+
|
| 29 |
+
tokenizer = AutoTokenizer.from_pretrained('gpt2')
|
| 30 |
+
model = AutoModelForMaskedLM.from_pretrained('chumengl/langflow-owt', trust_remote_code=True)
|
| 31 |
+
|
| 32 |
+
# Generate samples
|
| 33 |
+
samples = model.generate_samples(num_samples=5, num_steps=128)
|
| 34 |
+
texts = tokenizer.batch_decode(samples, skip_special_tokens=True)
|
| 35 |
+
for text in texts:
|
| 36 |
+
print(text)
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Model Details
|
| 40 |
+
|
| 41 |
+
- **Architecture**: DiT (Diffusion Transformer) backbone with adaptive layer normalization
|
| 42 |
+
- **Context Length**: 1024 tokens
|
| 43 |
+
- **Parameters**: ~130M non-embedding parameters (similar to GPT-2 medium)
|
| 44 |
+
- **Training**: 1M steps on OpenWebText corpus
|
| 45 |
+
- **Tokenizer**: GPT-2 tokenizer (50,257 vocab size)
|
| 46 |
+
|
| 47 |
+
## Citation
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
@article{chen2026langflow,
|
| 51 |
+
title={LangFlow: Continuous Diffusion Rivals Discrete in Language Modeling},
|
| 52 |
+
author={Chen, Yuxin and Liang, Chumeng and Sui, Hangke and Guo, Ruihan and Cheng, Chaoran and You, Jiaxuan and Liu, Ge},
|
| 53 |
+
journal={arXiv preprint arXiv:2604.11748},
|
| 54 |
+
year={2026}
|
| 55 |
+
}
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Model Card Contact
|
| 59 |
+
|
| 60 |
+
Chumeng Liang (chumengl@illinois.edu)
|
| 61 |
+
|
checkpoints/quarantine/20260818T074854Z/official/duo_dcd/owt/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- Skylion007/openwebtext
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
metrics:
|
| 9 |
+
- perplexity
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Using DUO
|
| 14 |
+
To use the pre-trained model for masked language modeling, use the following snippet:
|
| 15 |
+
```python
|
| 16 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 17 |
+
|
| 18 |
+
# See the `DUO` collection page on the hub for list of available models.
|
| 19 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
| 20 |
+
model = AutoModelForMaskedLM.from_pretrained('s-sahoo/duo-distilled')
|
| 21 |
+
```
|
| 22 |
+
For a hands-on example, check out this [Colab notebook](https://colab.research.google.com/drive/1Sf7R-dqdR6gq-H8nyZ9E3ZkyvqMTqcwq?usp=sharing).
|
| 23 |
+
For more information and implementation details, visit our github repository: [DUO](https://github.com/s-sahoo/duo)
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
The model, which has a context length of `1024` and is similar in size to GPT2-medium with approximately `130 million` non-embedding parameters,
|
| 27 |
+
was trained for 1M steps on the OpenWebText corpus.
|
| 28 |
+
|
| 29 |
+
For more details, please see our paper: [The Diffusion Duality](https://huggingface.co/papers/2506.10892).
|
| 30 |
+
|
| 31 |
+
Project page: https://s-sahoo.com/duo
|
| 32 |
+
|
| 33 |
+
## Citation
|
| 34 |
+
|
| 35 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 36 |
+
Please cite our work using the bibtex below:
|
| 37 |
+
|
| 38 |
+
**BibTeX:**
|
| 39 |
+
|
| 40 |
+
```
|
| 41 |
+
@inproceedings{
|
| 42 |
+
sahoo2025the,
|
| 43 |
+
title={The Diffusion Duality},
|
| 44 |
+
author={Subham Sekhar Sahoo and Justin Deschenaux and Aaron Gokaslan and Guanghan Wang and Justin T Chiu and Volodymyr Kuleshov},
|
| 45 |
+
booktitle={Forty-second International Conference on Machine Learning},
|
| 46 |
+
year={2025},
|
| 47 |
+
url={https://openreview.net/forum?id=9P9Y8FOSOk}
|
| 48 |
+
}
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Model Card Contact
|
| 52 |
+
Subham Sekhar Sahoo (ssahoo@cs.cornell.edu)
|
checkpoints/quarantine/20260818T074907Z/official/mdlm/owt/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
datasets:
|
| 7 |
+
- Skylion007/openwebtext
|
| 8 |
+
metrics:
|
| 9 |
+
- perplexity
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
## Using MDLM
|
| 13 |
+
To use the pre-trained model for masked language modeling, use the following snippet:
|
| 14 |
+
```python
|
| 15 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 16 |
+
|
| 17 |
+
# See the `MDLM` collection page on the hub for list of available models.
|
| 18 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
| 19 |
+
model_name = 'kuleshov-group/mdlm-owt'
|
| 20 |
+
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
For more details, please see our github repository: [MDLM](https://github.com/kuleshov-group/mdlm)
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
The model, which has a context length of `1024` and is similar in size to GPT2-medium with approximately `130 million` non-embedding parameters,
|
| 27 |
+
was trained using a forward diffusion process that generates inputs varying from fully masked to fully unmasked. Its objective is to
|
| 28 |
+
reconstruct the original input from these varying levels of masking, outputting logits in the process.
|
| 29 |
+
The training regimen comprised one million steps on the OpenWebText corpus, involving the processing of a total of `33 billion` tokens.
|
| 30 |
+
|
| 31 |
+
For more details, please see our paper: [Simple and Effective Masked Diffusion Language Models](http://arxiv.org/abs/2406.07524).
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Citation
|
| 36 |
+
|
| 37 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 38 |
+
Please cite our work using the bibtex below:
|
| 39 |
+
|
| 40 |
+
**BibTeX:**
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
@inproceedings{
|
| 44 |
+
sahoo2024simple,
|
| 45 |
+
title={Simple and Effective Masked Diffusion Language Models},
|
| 46 |
+
author={Subham Sekhar Sahoo and Marianne Arriola and Aaron Gokaslan and Edgar Mariano Marroquin and Alexander M Rush and Yair Schiff and Justin T Chiu and Volodymyr Kuleshov},
|
| 47 |
+
booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
|
| 48 |
+
year={2024},
|
| 49 |
+
url={https://openreview.net/forum?id=L4uaAR4ArM}
|
| 50 |
+
}
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
**APA:**
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
@software{Sahoo_Simple_and_Effective_2024,
|
| 57 |
+
author = {Sahoo, Subham Sekhar and Arriola, Marianne and Schiff, Yair and Gokaslan, Aaron and Marroquin, Edgar and Chiu, Justin T and Rush, Alexander and Kuleshov, Volodymyr},
|
| 58 |
+
doi = {10.48550/arXiv.2406.07524},
|
| 59 |
+
month = jun,
|
| 60 |
+
title = {{Simple and Effective Masked Diffusion Language Models}},
|
| 61 |
+
version = {arXiv:2406.07524v1},
|
| 62 |
+
year = {2024}
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Model Card Contact
|
| 67 |
+
Subham Sekhar Sahoo (subbham@gmail.com)
|
checkpoints/quarantine/20260818T074907Z/official/mdlm/owt/modeling_mdlm.py
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""MDLM model for Hugging Face.
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
import itertools
|
| 5 |
+
import math
|
| 6 |
+
import typing
|
| 7 |
+
|
| 8 |
+
import flash_attn
|
| 9 |
+
import flash_attn.layers.rotary
|
| 10 |
+
import torch
|
| 11 |
+
import torch.nn as nn
|
| 12 |
+
import torch.nn.functional as F
|
| 13 |
+
import transformers
|
| 14 |
+
from einops import rearrange
|
| 15 |
+
from transformers import modeling_outputs
|
| 16 |
+
|
| 17 |
+
from .configuration_mdlm import MDLMConfig
|
| 18 |
+
|
| 19 |
+
# Flags required to enable jit fusion kernels
|
| 20 |
+
torch._C._jit_set_profiling_mode(False)
|
| 21 |
+
torch._C._jit_set_profiling_executor(False)
|
| 22 |
+
torch._C._jit_override_can_fuse_on_cpu(True)
|
| 23 |
+
torch._C._jit_override_can_fuse_on_gpu(True)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def bias_dropout_add_scale(
|
| 27 |
+
x: torch.Tensor,
|
| 28 |
+
bias: typing.Optional[torch.Tensor],
|
| 29 |
+
scale: torch.Tensor,
|
| 30 |
+
residual: typing.Optional[torch.Tensor],
|
| 31 |
+
prob: float,
|
| 32 |
+
training: bool) -> torch.Tensor:
|
| 33 |
+
if bias is not None:
|
| 34 |
+
out = scale * F.dropout(x + bias, p=prob,
|
| 35 |
+
training=training)
|
| 36 |
+
else:
|
| 37 |
+
out = scale * F.dropout(x, p=prob, training=training)
|
| 38 |
+
|
| 39 |
+
if residual is not None:
|
| 40 |
+
out = residual + out
|
| 41 |
+
return out
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def get_bias_dropout_add_scale(training):
|
| 45 |
+
def _bias_dropout_add(x, bias, scale, residual, prob):
|
| 46 |
+
return bias_dropout_add_scale(
|
| 47 |
+
x, bias, scale, residual, prob, training)
|
| 48 |
+
|
| 49 |
+
return _bias_dropout_add
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
# function overload
|
| 53 |
+
def modulate(x: torch.Tensor,
|
| 54 |
+
shift: torch.Tensor,
|
| 55 |
+
scale: torch.Tensor) -> torch.Tensor:
|
| 56 |
+
return x * (1 + scale) + shift
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
@torch.jit.script
|
| 60 |
+
def bias_dropout_add_scale_fused_train(
|
| 61 |
+
x: torch.Tensor,
|
| 62 |
+
bias: typing.Optional[torch.Tensor],
|
| 63 |
+
scale: torch.Tensor,
|
| 64 |
+
residual: typing.Optional[torch.Tensor],
|
| 65 |
+
prob: float) -> torch.Tensor:
|
| 66 |
+
return bias_dropout_add_scale(
|
| 67 |
+
x, bias, scale, residual, prob, True)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
@torch.jit.script
|
| 71 |
+
def bias_dropout_add_scale_fused_inference(
|
| 72 |
+
x: torch.Tensor,
|
| 73 |
+
bias: typing.Optional[torch.Tensor],
|
| 74 |
+
scale: torch.Tensor,
|
| 75 |
+
residual: typing.Optional[torch.Tensor],
|
| 76 |
+
prob: float) -> torch.Tensor:
|
| 77 |
+
return bias_dropout_add_scale(
|
| 78 |
+
x, bias, scale, residual, prob, False)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@torch.jit.script
|
| 82 |
+
def modulate_fused(x: torch.Tensor,
|
| 83 |
+
shift: torch.Tensor,
|
| 84 |
+
scale: torch.Tensor) -> torch.Tensor:
|
| 85 |
+
return modulate(x, shift, scale)
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
class Rotary(torch.nn.Module):
|
| 89 |
+
def __init__(self, dim, base=10_000):
|
| 90 |
+
super().__init__()
|
| 91 |
+
inv_freq = 1.0 / (
|
| 92 |
+
base ** (torch.arange(0, dim, 2).float() / dim))
|
| 93 |
+
self.register_buffer('inv_freq', inv_freq)
|
| 94 |
+
self.seq_len_cached = None
|
| 95 |
+
self.cos_cached = None
|
| 96 |
+
self.sin_cached = None
|
| 97 |
+
|
| 98 |
+
def forward(self, x, seq_dim=1):
|
| 99 |
+
seq_len = x.shape[seq_dim]
|
| 100 |
+
if seq_len != self.seq_len_cached:
|
| 101 |
+
self.seq_len_cached = seq_len
|
| 102 |
+
t = torch.arange(x.shape[seq_dim],
|
| 103 |
+
device=x.device).type_as(
|
| 104 |
+
self.inv_freq)
|
| 105 |
+
freqs = torch.einsum("i,j->ij", t,
|
| 106 |
+
self.inv_freq.clone())
|
| 107 |
+
emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
|
| 108 |
+
# dims are: batch, seq_len, qkv, head, dim
|
| 109 |
+
self.cos_cached = emb.cos()[None, :, None, None,
|
| 110 |
+
:].repeat(1, 1, 3, 1, 1)
|
| 111 |
+
self.sin_cached = emb.sin()[None, :, None, None,
|
| 112 |
+
:].repeat(1, 1, 3, 1, 1)
|
| 113 |
+
# This makes the transformation on v an identity.
|
| 114 |
+
self.cos_cached[:, :, 2, :, :].fill_(1.)
|
| 115 |
+
self.sin_cached[:, :, 2, :, :].fill_(0.)
|
| 116 |
+
|
| 117 |
+
return self.cos_cached, self.sin_cached
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def rotate_half(x):
|
| 121 |
+
x1, x2 = x[..., : x.shape[-1] // 2], x[...,
|
| 122 |
+
x.shape[-1] // 2:]
|
| 123 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def apply_rotary_pos_emb(qkv, cos, sin):
|
| 127 |
+
cos = cos[0, :, 0, 0, :cos.shape[-1] // 2]
|
| 128 |
+
sin = sin[0, :, 0, 0, :sin.shape[-1] // 2]
|
| 129 |
+
return flash_attn.layers.rotary.apply_rotary_emb_qkv_(qkv,
|
| 130 |
+
cos,
|
| 131 |
+
sin)
|
| 132 |
+
# function overload
|
| 133 |
+
def modulate(x, shift, scale):
|
| 134 |
+
return x * (1 + scale.unsqueeze(1)) + shift.unsqueeze(1)
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
############################################################
|
| 138 |
+
# Layers #
|
| 139 |
+
############################################################
|
| 140 |
+
class LayerNorm(nn.Module):
|
| 141 |
+
def __init__(self, dim):
|
| 142 |
+
super().__init__()
|
| 143 |
+
self.weight = nn.Parameter(torch.ones([dim]))
|
| 144 |
+
self.dim = dim
|
| 145 |
+
|
| 146 |
+
def forward(self, x):
|
| 147 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 148 |
+
x = F.layer_norm(x.float(), [self.dim])
|
| 149 |
+
return x * self.weight[None, None, :]
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def residual_linear(x, W, x_skip, residual_scale):
|
| 153 |
+
"""x_skip + residual_scale * W @ x"""
|
| 154 |
+
dim_out, dim_in = W.shape[0], W.shape[1]
|
| 155 |
+
return torch.addmm(
|
| 156 |
+
x_skip.view(-1, dim_out),
|
| 157 |
+
x.view(-1, dim_in),
|
| 158 |
+
W.T,
|
| 159 |
+
alpha=residual_scale).view(*x.shape[:-1], dim_out)
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
############################################################
|
| 163 |
+
# Embedding Layers for Timesteps and Class Labels #
|
| 164 |
+
############################################################
|
| 165 |
+
class TimestepEmbedder(nn.Module):
|
| 166 |
+
"""
|
| 167 |
+
Embeds scalar timesteps into vector representations.
|
| 168 |
+
"""
|
| 169 |
+
|
| 170 |
+
def __init__(self, hidden_size,
|
| 171 |
+
frequency_embedding_size=256):
|
| 172 |
+
super().__init__()
|
| 173 |
+
self.mlp = nn.Sequential(
|
| 174 |
+
nn.Linear(frequency_embedding_size, hidden_size,
|
| 175 |
+
bias=True),
|
| 176 |
+
nn.SiLU(),
|
| 177 |
+
nn.Linear(hidden_size, hidden_size, bias=True))
|
| 178 |
+
self.frequency_embedding_size = frequency_embedding_size
|
| 179 |
+
|
| 180 |
+
@staticmethod
|
| 181 |
+
def timestep_embedding(t, dim, max_period=10000):
|
| 182 |
+
"""
|
| 183 |
+
Create sinusoidal timestep embeddings.
|
| 184 |
+
:param t: a 1-D Tensor of N indices, one per batch
|
| 185 |
+
element. These may be fractional.
|
| 186 |
+
:param dim: the dimension of the output.
|
| 187 |
+
:param max_period: controls the minimum frequency of the
|
| 188 |
+
embeddings.
|
| 189 |
+
:return: an (N, D) Tensor of positional embeddings.
|
| 190 |
+
"""
|
| 191 |
+
# https://github.com/openai/glide-text2im/blob/main/glide_text2im/nn.py
|
| 192 |
+
half = dim // 2
|
| 193 |
+
freqs = torch.exp(
|
| 194 |
+
- math.log(max_period)
|
| 195 |
+
* torch.arange(start=0, end=half, dtype=torch.float32)
|
| 196 |
+
/ half).to(device=t.device)
|
| 197 |
+
args = t[:, None].float() * freqs[None]
|
| 198 |
+
embedding = torch.cat(
|
| 199 |
+
[torch.cos(args), torch.sin(args)], dim=-1)
|
| 200 |
+
if dim % 2:
|
| 201 |
+
embedding = torch.cat(
|
| 202 |
+
[embedding,
|
| 203 |
+
torch.zeros_like(embedding[:, :1])], dim=-1)
|
| 204 |
+
return embedding
|
| 205 |
+
|
| 206 |
+
def forward(self, t):
|
| 207 |
+
t_freq = self.timestep_embedding(t,
|
| 208 |
+
self.frequency_embedding_size)
|
| 209 |
+
t_emb = self.mlp(t_freq)
|
| 210 |
+
return t_emb
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
class LabelEmbedder(nn.Module):
|
| 214 |
+
"""Embeds class labels into vector representations.
|
| 215 |
+
|
| 216 |
+
Also handles label dropout for classifier-free guidance.
|
| 217 |
+
"""
|
| 218 |
+
|
| 219 |
+
def __init__(self, num_classes, cond_size):
|
| 220 |
+
super().__init__()
|
| 221 |
+
self.embedding_table = nn.Embedding(num_classes + 1,
|
| 222 |
+
cond_size)
|
| 223 |
+
self.num_classes = num_classes
|
| 224 |
+
|
| 225 |
+
# TODO think of initializing with 0.02 std deviation like in original DiT paper
|
| 226 |
+
|
| 227 |
+
def forward(self, labels):
|
| 228 |
+
embeddings = self.embedding_table(labels)
|
| 229 |
+
return embeddings
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
############################################################
|
| 233 |
+
# Core Model #
|
| 234 |
+
############################################################
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
class DDiTBlock(nn.Module):
|
| 238 |
+
def __init__(self, dim, n_heads, cond_dim, mlp_ratio=4,
|
| 239 |
+
dropout=0.1):
|
| 240 |
+
super().__init__()
|
| 241 |
+
self.n_heads = n_heads
|
| 242 |
+
|
| 243 |
+
self.norm1 = LayerNorm(dim)
|
| 244 |
+
self.attn_qkv = nn.Linear(dim, 3 * dim, bias=False)
|
| 245 |
+
self.attn_out = nn.Linear(dim, dim, bias=False)
|
| 246 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 247 |
+
|
| 248 |
+
self.norm2 = LayerNorm(dim)
|
| 249 |
+
self.mlp = nn.Sequential(
|
| 250 |
+
nn.Linear(dim, mlp_ratio * dim, bias=True),
|
| 251 |
+
nn.GELU(approximate='tanh'),
|
| 252 |
+
nn.Linear(mlp_ratio * dim, dim, bias=True))
|
| 253 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 254 |
+
self.dropout = dropout
|
| 255 |
+
|
| 256 |
+
self.adaLN_modulation = nn.Linear(cond_dim, 6 * dim,
|
| 257 |
+
bias=True)
|
| 258 |
+
self.adaLN_modulation.weight.data.zero_()
|
| 259 |
+
self.adaLN_modulation.bias.data.zero_()
|
| 260 |
+
|
| 261 |
+
def _get_bias_dropout_scale(self):
|
| 262 |
+
if self.training:
|
| 263 |
+
return bias_dropout_add_scale_fused_train
|
| 264 |
+
else:
|
| 265 |
+
return bias_dropout_add_scale_fused_inference
|
| 266 |
+
|
| 267 |
+
def forward(self, x, rotary_cos_sin, c, seqlens=None):
|
| 268 |
+
batch_size, seq_len = x.shape[0], x.shape[1]
|
| 269 |
+
|
| 270 |
+
bias_dropout_scale_fn = self._get_bias_dropout_scale()
|
| 271 |
+
|
| 272 |
+
(shift_msa, scale_msa, gate_msa, shift_mlp,
|
| 273 |
+
scale_mlp, gate_mlp) = self.adaLN_modulation(c)[:,
|
| 274 |
+
None].chunk(6, dim=2)
|
| 275 |
+
|
| 276 |
+
# attention operation
|
| 277 |
+
x_skip = x
|
| 278 |
+
x = modulate_fused(self.norm1(x), shift_msa, scale_msa)
|
| 279 |
+
|
| 280 |
+
qkv = self.attn_qkv(x)
|
| 281 |
+
qkv = rearrange(qkv,
|
| 282 |
+
'b s (three h d) -> b s three h d',
|
| 283 |
+
three=3,
|
| 284 |
+
h=self.n_heads)
|
| 285 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 286 |
+
cos, sin = rotary_cos_sin
|
| 287 |
+
qkv = apply_rotary_pos_emb(
|
| 288 |
+
qkv, cos.to(qkv.dtype), sin.to(qkv.dtype))
|
| 289 |
+
qkv = rearrange(qkv, 'b s ... -> (b s) ...')
|
| 290 |
+
if seqlens is None:
|
| 291 |
+
cu_seqlens = torch.arange(
|
| 292 |
+
0, (batch_size + 1) * seq_len, step=seq_len,
|
| 293 |
+
dtype=torch.int32, device=qkv.device)
|
| 294 |
+
else:
|
| 295 |
+
cu_seqlens = seqlens.cumsum(-1)
|
| 296 |
+
x = flash_attn.flash_attn_interface.flash_attn_varlen_qkvpacked_func(
|
| 297 |
+
qkv, cu_seqlens, seq_len, 0., causal=False)
|
| 298 |
+
|
| 299 |
+
x = rearrange(x, '(b s) h d -> b s (h d)', b=batch_size)
|
| 300 |
+
|
| 301 |
+
x = bias_dropout_scale_fn(self.attn_out(x),
|
| 302 |
+
None,
|
| 303 |
+
gate_msa,
|
| 304 |
+
x_skip,
|
| 305 |
+
self.dropout)
|
| 306 |
+
|
| 307 |
+
# mlp operation
|
| 308 |
+
x = bias_dropout_scale_fn(
|
| 309 |
+
self.mlp(modulate_fused(
|
| 310 |
+
self.norm2(x), shift_mlp, scale_mlp)),
|
| 311 |
+
None, gate_mlp, x, self.dropout)
|
| 312 |
+
return x
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
class EmbeddingLayer(nn.Module):
|
| 316 |
+
def __init__(self, dim, vocab_dim):
|
| 317 |
+
super().__init__()
|
| 318 |
+
self.embedding = nn.Parameter(
|
| 319 |
+
torch.empty((vocab_dim, dim)))
|
| 320 |
+
torch.nn.init.kaiming_uniform_(self.embedding,
|
| 321 |
+
a=math.sqrt(5))
|
| 322 |
+
|
| 323 |
+
def forward(self, x):
|
| 324 |
+
return self.embedding[x]
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
class DDitFinalLayer(nn.Module):
|
| 328 |
+
def __init__(self, hidden_size, out_channels, cond_dim):
|
| 329 |
+
super().__init__()
|
| 330 |
+
self.norm_final = LayerNorm(hidden_size)
|
| 331 |
+
self.linear = nn.Linear(hidden_size, out_channels)
|
| 332 |
+
self.linear.weight.data.zero_()
|
| 333 |
+
self.linear.bias.data.zero_()
|
| 334 |
+
|
| 335 |
+
self.adaLN_modulation = nn.Linear(cond_dim,
|
| 336 |
+
2 * hidden_size,
|
| 337 |
+
bias=True)
|
| 338 |
+
self.adaLN_modulation.weight.data.zero_()
|
| 339 |
+
self.adaLN_modulation.bias.data.zero_()
|
| 340 |
+
|
| 341 |
+
def forward(self, x, c):
|
| 342 |
+
shift, scale = self.adaLN_modulation(c)[:, None].chunk(
|
| 343 |
+
2, dim=2)
|
| 344 |
+
x = modulate_fused(self.norm_final(x), shift, scale)
|
| 345 |
+
x = self.linear(x)
|
| 346 |
+
return x
|
| 347 |
+
|
| 348 |
+
|
| 349 |
+
class DITBackbone(nn.Module):
|
| 350 |
+
def __init__(
|
| 351 |
+
self,
|
| 352 |
+
config: MDLMConfig):
|
| 353 |
+
super().__init__()
|
| 354 |
+
|
| 355 |
+
self.config = config
|
| 356 |
+
self.vocab_size = config.vocab_size
|
| 357 |
+
|
| 358 |
+
self.vocab_embed = EmbeddingLayer(
|
| 359 |
+
config.hidden_dim,
|
| 360 |
+
config.vocab_size)
|
| 361 |
+
self.sigma_map = TimestepEmbedder(
|
| 362 |
+
config.cond_dim)
|
| 363 |
+
self.rotary_emb = Rotary(
|
| 364 |
+
config.hidden_dim // config.n_heads)
|
| 365 |
+
|
| 366 |
+
blocks = []
|
| 367 |
+
for _ in range(config.n_blocks):
|
| 368 |
+
blocks.append(DDiTBlock(config.hidden_dim,
|
| 369 |
+
config.n_heads,
|
| 370 |
+
config.cond_dim,
|
| 371 |
+
dropout=config.dropout))
|
| 372 |
+
self.blocks = nn.ModuleList(blocks)
|
| 373 |
+
|
| 374 |
+
self.output_layer = DDitFinalLayer(
|
| 375 |
+
config.hidden_dim,
|
| 376 |
+
config.vocab_size,
|
| 377 |
+
config.cond_dim)
|
| 378 |
+
|
| 379 |
+
def _get_bias_dropout_scale(self):
|
| 380 |
+
if self.training:
|
| 381 |
+
return bias_dropout_add_scale_fused_train
|
| 382 |
+
else:
|
| 383 |
+
return bias_dropout_add_scale_fused_inference
|
| 384 |
+
|
| 385 |
+
def forward(self, indices, sigma,
|
| 386 |
+
output_hidden_states=False):
|
| 387 |
+
if not self.config.time_conditioning:
|
| 388 |
+
sigma = torch.zeros_like(sigma)
|
| 389 |
+
all_hidden_states = []
|
| 390 |
+
x = self.vocab_embed(indices)
|
| 391 |
+
if output_hidden_states:
|
| 392 |
+
all_hidden_states.append(x)
|
| 393 |
+
c = F.silu(self.sigma_map(sigma))
|
| 394 |
+
|
| 395 |
+
rotary_cos_sin = self.rotary_emb(x)
|
| 396 |
+
|
| 397 |
+
with torch.cuda.amp.autocast(dtype=torch.bfloat16):
|
| 398 |
+
for i in range(len(self.blocks)):
|
| 399 |
+
x = self.blocks[i](x, rotary_cos_sin, c,
|
| 400 |
+
seqlens=None)
|
| 401 |
+
if output_hidden_states:
|
| 402 |
+
all_hidden_states.append(x)
|
| 403 |
+
logits = self.output_layer(x, c)
|
| 404 |
+
return logits, all_hidden_states
|
| 405 |
+
|
| 406 |
+
class MDLM(transformers.PreTrainedModel):
|
| 407 |
+
"""HF-compatible model."""
|
| 408 |
+
config_class = MDLMConfig
|
| 409 |
+
base_model_prefix = "mdlm"
|
| 410 |
+
|
| 411 |
+
def __init__(
|
| 412 |
+
self,
|
| 413 |
+
config: MDLMConfig):
|
| 414 |
+
super().__init__(config)
|
| 415 |
+
self.backbone = DITBackbone(config)
|
| 416 |
+
|
| 417 |
+
def forward(
|
| 418 |
+
self,
|
| 419 |
+
input_ids: torch.LongTensor = None,
|
| 420 |
+
timesteps: torch.FloatTensor = None,
|
| 421 |
+
output_hidden_states: typing.Optional[bool] = None,
|
| 422 |
+
return_dict: typing.Optional[bool] = None,
|
| 423 |
+
) -> typing.Union[
|
| 424 |
+
torch.Tensor, typing.Tuple,
|
| 425 |
+
modeling_outputs.MaskedLMOutput]:
|
| 426 |
+
"""HF-compatible forward method."""
|
| 427 |
+
output_hidden_states = (
|
| 428 |
+
output_hidden_states
|
| 429 |
+
if output_hidden_states is not None
|
| 430 |
+
else self.config.output_hidden_states
|
| 431 |
+
)
|
| 432 |
+
return_dict = return_dict \
|
| 433 |
+
if return_dict is not None \
|
| 434 |
+
else self.config.use_return_dict
|
| 435 |
+
|
| 436 |
+
logits, all_hidden_states = self.backbone(
|
| 437 |
+
indices=input_ids,
|
| 438 |
+
sigma=timesteps,
|
| 439 |
+
output_hidden_states=output_hidden_states
|
| 440 |
+
)
|
| 441 |
+
if return_dict:
|
| 442 |
+
return modeling_outputs.MaskedLMOutput(
|
| 443 |
+
logits=logits,
|
| 444 |
+
hidden_states=all_hidden_states if output_hidden_states else None,
|
| 445 |
+
loss=None
|
| 446 |
+
)
|
| 447 |
+
elif output_hidden_states:
|
| 448 |
+
return logits, all_hidden_states
|
| 449 |
+
else:
|
| 450 |
+
return logits
|
checkpoints/quarantine/20260818T074924Z/official/mdlm_sdtt/owt/config.json
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"mode": "train",
|
| 3 |
+
"time_conditioning": false,
|
| 4 |
+
"T": 0,
|
| 5 |
+
"compile": false,
|
| 6 |
+
"eval_every": 5000,
|
| 7 |
+
"data_preprocess": {
|
| 8 |
+
"data_cache": "REDACTED",
|
| 9 |
+
"min_seq_len": -1,
|
| 10 |
+
"seq_len": "${model.length}",
|
| 11 |
+
"group_text": true,
|
| 12 |
+
"remove_text": true,
|
| 13 |
+
"num_seqs": -1,
|
| 14 |
+
"add_bos": false,
|
| 15 |
+
"add_eos": true,
|
| 16 |
+
"legacy_start_end_bos": true
|
| 17 |
+
},
|
| 18 |
+
"loader": {
|
| 19 |
+
"global_batch_size": 32,
|
| 20 |
+
"eval_global_batch_size": "${.global_batch_size}",
|
| 21 |
+
"batch_size": "${div_up:${.global_batch_size}, ${eval:${trainer.devices} * ${trainer.num_nodes}}}",
|
| 22 |
+
"eval_batch_size": "${div_up:${.eval_global_batch_size}, ${eval:${trainer.devices} * ${trainer.num_nodes}}}",
|
| 23 |
+
"num_workers": 32,
|
| 24 |
+
"pin_memory": true,
|
| 25 |
+
"persistent_workers": true
|
| 26 |
+
},
|
| 27 |
+
"training": {
|
| 28 |
+
"ema": 0.9999,
|
| 29 |
+
"antithetic_sampling": true,
|
| 30 |
+
"importance_sampling": false,
|
| 31 |
+
"sampling_eps": 1e-05,
|
| 32 |
+
"change_of_variables": false
|
| 33 |
+
},
|
| 34 |
+
"tokenizer": {
|
| 35 |
+
"name": "gpt2"
|
| 36 |
+
},
|
| 37 |
+
"optim": {
|
| 38 |
+
"name": "adamw",
|
| 39 |
+
"weight_decay": 0.0,
|
| 40 |
+
"lr": 0.0003,
|
| 41 |
+
"beta1": 0.9,
|
| 42 |
+
"beta2": 0.999,
|
| 43 |
+
"eps": 1e-08
|
| 44 |
+
},
|
| 45 |
+
"trainer": {
|
| 46 |
+
"_target_": "lightning.Trainer",
|
| 47 |
+
"accelerator": "cuda",
|
| 48 |
+
"num_nodes": 1,
|
| 49 |
+
"devices": 1,
|
| 50 |
+
"accumulate_grad_batches": "${div_up:${loader.global_batch_size}, ${eval:${trainer.devices} * ${loader.batch_size} * ${trainer.num_nodes}}}",
|
| 51 |
+
"gradient_clip_val": 1.0,
|
| 52 |
+
"precision": "bf16-mixed",
|
| 53 |
+
"num_sanity_val_steps": 2,
|
| 54 |
+
"max_steps": 1000000,
|
| 55 |
+
"log_every_n_steps": 10,
|
| 56 |
+
"limit_train_batches": 1.0,
|
| 57 |
+
"limit_val_batches": 1.0,
|
| 58 |
+
"val_check_interval": "${eval:${trainer.accumulate_grad_batches} * ${eval_every}}",
|
| 59 |
+
"check_val_every_n_epoch": null,
|
| 60 |
+
"benchmark": true
|
| 61 |
+
},
|
| 62 |
+
"wandb": {
|
| 63 |
+
"project": "text-diffusion",
|
| 64 |
+
"notes": "",
|
| 65 |
+
"group": null,
|
| 66 |
+
"job_type": null,
|
| 67 |
+
"name": null,
|
| 68 |
+
"tags": [
|
| 69 |
+
"${noise.type}",
|
| 70 |
+
"${data.train}",
|
| 71 |
+
"${data.valid}"
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
"checkpointing": {
|
| 75 |
+
"save_dir": "${cwd:}",
|
| 76 |
+
"resume_from_ckpt": true,
|
| 77 |
+
"resume_ckpt_path": "/claire-rcp-scratch/home/deschena/fast-discrete-diff/dev/hf_downloads/baselines/kld/baselines/bwd_kl_double_dt_10k_lr_2x_sm/70000.ckpt"
|
| 78 |
+
},
|
| 79 |
+
"eval": {
|
| 80 |
+
"valid": {
|
| 81 |
+
"n_samples": 16,
|
| 82 |
+
"num_steps": 128
|
| 83 |
+
},
|
| 84 |
+
"ppl_with_ar": {
|
| 85 |
+
"run": true,
|
| 86 |
+
"model": "gpt2-large",
|
| 87 |
+
"batch_size": 8
|
| 88 |
+
},
|
| 89 |
+
"mauve": {
|
| 90 |
+
"run": false,
|
| 91 |
+
"num_rounds": 5,
|
| 92 |
+
"max_num_tokens": 100,
|
| 93 |
+
"batch_size": 8,
|
| 94 |
+
"scaling_factor": 5
|
| 95 |
+
},
|
| 96 |
+
"lambada_openai": {
|
| 97 |
+
"run": false,
|
| 98 |
+
"batch_size": 32,
|
| 99 |
+
"num_samples": 32,
|
| 100 |
+
"from_ema": true,
|
| 101 |
+
"add_bos": true,
|
| 102 |
+
"add_eos": true
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
"callbacks": {
|
| 106 |
+
"checkpoint_every_n_steps": {
|
| 107 |
+
"_target_": "lightning.pytorch.callbacks.ModelCheckpoint",
|
| 108 |
+
"save_top_k": -1,
|
| 109 |
+
"save_last": true,
|
| 110 |
+
"dirpath": "${checkpointing.save_dir}/checkpoints",
|
| 111 |
+
"verbose": true,
|
| 112 |
+
"auto_insert_metric_name": false,
|
| 113 |
+
"every_n_train_steps": 10000
|
| 114 |
+
},
|
| 115 |
+
"learning_rate_monitor": {
|
| 116 |
+
"_target_": "lightning.pytorch.callbacks.LearningRateMonitor",
|
| 117 |
+
"logging_interval": "step"
|
| 118 |
+
},
|
| 119 |
+
"text_throughput": {
|
| 120 |
+
"_target_": "callbacks.text_throughput.TextThroughputMonitor"
|
| 121 |
+
},
|
| 122 |
+
"grad_norm": {
|
| 123 |
+
"_target_": "callbacks.gradient_norm.GradNormCallback"
|
| 124 |
+
}
|
| 125 |
+
},
|
| 126 |
+
"data": {
|
| 127 |
+
"train": "openwebtext-train",
|
| 128 |
+
"valid": "openwebtext-valid",
|
| 129 |
+
"test": "openwebtext-test",
|
| 130 |
+
"tokenizer_name_or_path": "gpt2",
|
| 131 |
+
"wrap": true,
|
| 132 |
+
"streaming": false
|
| 133 |
+
},
|
| 134 |
+
"model": {
|
| 135 |
+
"name": "small",
|
| 136 |
+
"type": "ddit-orig",
|
| 137 |
+
"hidden_size": 768,
|
| 138 |
+
"cond_dim": 128,
|
| 139 |
+
"length": 1024,
|
| 140 |
+
"n_blocks": 12,
|
| 141 |
+
"n_heads": 12,
|
| 142 |
+
"scale_by_sigma": true,
|
| 143 |
+
"dropout": 0.1,
|
| 144 |
+
"tie_word_embeddings": false
|
| 145 |
+
},
|
| 146 |
+
"strategy": {
|
| 147 |
+
"_target_": "lightning.pytorch.strategies.DDPStrategy",
|
| 148 |
+
"find_unused_parameters": false,
|
| 149 |
+
"process_group_backend": "nccl"
|
| 150 |
+
},
|
| 151 |
+
"noise": {
|
| 152 |
+
"type": "loglinear",
|
| 153 |
+
"sigma_min": 0.0001,
|
| 154 |
+
"sigma_max": 20
|
| 155 |
+
},
|
| 156 |
+
"lr_scheduler": {
|
| 157 |
+
"_target_": "transformers.get_constant_schedule_with_warmup",
|
| 158 |
+
"num_warmup_steps": 2500
|
| 159 |
+
},
|
| 160 |
+
"parameterization": {
|
| 161 |
+
"name": "multi-round-sdtt",
|
| 162 |
+
"log_loss_buckets": -1,
|
| 163 |
+
"checkpoint_path": "kuleshov-group/mdlm-owt",
|
| 164 |
+
"start_from_hf": false,
|
| 165 |
+
"distill_mode": "kl-bwd",
|
| 166 |
+
"num_distill_steps": 2,
|
| 167 |
+
"min_num_sampling_steps": 8,
|
| 168 |
+
"grow_dt_every": 10000,
|
| 169 |
+
"orig_num_sampling_steps": 1024,
|
| 170 |
+
"sampling_mode": "ancestral",
|
| 171 |
+
"loss_precision": null,
|
| 172 |
+
"reset_optimizer_on_growth": false,
|
| 173 |
+
"use_ema_on_growth": false,
|
| 174 |
+
"sampling": {
|
| 175 |
+
"uncond": {
|
| 176 |
+
"run": false,
|
| 177 |
+
"num_samples": 1024,
|
| 178 |
+
"batch_size": 32,
|
| 179 |
+
"from_ema": true,
|
| 180 |
+
"num_steps": 1024,
|
| 181 |
+
"seq_len": 1024,
|
| 182 |
+
"sampler": "ancestral",
|
| 183 |
+
"cache_preds": false,
|
| 184 |
+
"add_bos": false,
|
| 185 |
+
"add_eos": false
|
| 186 |
+
},
|
| 187 |
+
"cond_prefix": {
|
| 188 |
+
"run": false,
|
| 189 |
+
"num_samples": 1024,
|
| 190 |
+
"batch_size": 32,
|
| 191 |
+
"from_ema": true,
|
| 192 |
+
"dataset": "webtext",
|
| 193 |
+
"seq_len": 100,
|
| 194 |
+
"prefix_len": 50,
|
| 195 |
+
"num_cont_per_prefix": 5,
|
| 196 |
+
"min_seq_len": 1024,
|
| 197 |
+
"num_steps": 1024,
|
| 198 |
+
"sampler": "ancestral",
|
| 199 |
+
"cache_preds": false,
|
| 200 |
+
"add_bos": false,
|
| 201 |
+
"add_eos": false
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
},
|
| 205 |
+
"repo": "jdeschena/sdtt",
|
| 206 |
+
"revision": "baselines_kld"
|
| 207 |
+
}
|
checkpoints/quarantine/20260820T072046Z/official/fmlm/owt/config.json
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": {
|
| 3 |
+
"algo": {
|
| 4 |
+
"T": 0,
|
| 5 |
+
"add_boundary": "fixed",
|
| 6 |
+
"backbone": "dit",
|
| 7 |
+
"backprop_entmax_temp_lsd": false,
|
| 8 |
+
"boundary_prob": 32,
|
| 9 |
+
"causal_attention": false,
|
| 10 |
+
"diagonal_fraction": 0.5,
|
| 11 |
+
"distillation_method": "PSD",
|
| 12 |
+
"double_temb": true,
|
| 13 |
+
"entmax_temp_lsd": 2.0,
|
| 14 |
+
"initialize_student_from_teacher": true,
|
| 15 |
+
"learnable_loss_weighting": false,
|
| 16 |
+
"loss_scale": "none",
|
| 17 |
+
"loss_type": null,
|
| 18 |
+
"name": "fmlm",
|
| 19 |
+
"offdiagonal_sampling": "uniform_diff",
|
| 20 |
+
"parameterization": "mean",
|
| 21 |
+
"pred_log_interval": 2000,
|
| 22 |
+
"rescale_offdiag_loss_psd": false,
|
| 23 |
+
"subs_masking": false,
|
| 24 |
+
"t_max": 1.0,
|
| 25 |
+
"t_min": 0.0,
|
| 26 |
+
"teacher_path": "/home/irteam/ours_owt_flow_ce_1m.ckpt",
|
| 27 |
+
"time_condition": "alpha_t",
|
| 28 |
+
"time_conditioning": true,
|
| 29 |
+
"use_discrete_schedule": true,
|
| 30 |
+
"use_ema_for_psd_target": false,
|
| 31 |
+
"use_mse_loss_psd": false,
|
| 32 |
+
"use_simulated_entropy": false,
|
| 33 |
+
"use_teacher_for_D_t_lsd": false
|
| 34 |
+
},
|
| 35 |
+
"callbacks": {
|
| 36 |
+
"checkpoint_every_n_steps": {
|
| 37 |
+
"_target_": "lightning.pytorch.callbacks.ModelCheckpoint",
|
| 38 |
+
"auto_insert_metric_name": false,
|
| 39 |
+
"dirpath": "/home/david3684/projects/flm/hf_upload/checkpoints",
|
| 40 |
+
"every_n_train_steps": 5000,
|
| 41 |
+
"save_last": false,
|
| 42 |
+
"save_top_k": -1,
|
| 43 |
+
"verbose": true
|
| 44 |
+
},
|
| 45 |
+
"checkpoint_monitor": {
|
| 46 |
+
"_target_": "lightning.pytorch.callbacks.ModelCheckpoint",
|
| 47 |
+
"auto_insert_metric_name": false,
|
| 48 |
+
"dirpath": "/home/david3684/projects/flm/hf_upload/checkpoints",
|
| 49 |
+
"filename": "best_nll",
|
| 50 |
+
"mode": "min",
|
| 51 |
+
"monitor": "val/nll",
|
| 52 |
+
"save_last": true,
|
| 53 |
+
"save_top_k": 1,
|
| 54 |
+
"verbose": true
|
| 55 |
+
},
|
| 56 |
+
"learning_rate_monitor": {
|
| 57 |
+
"_target_": "lightning.pytorch.callbacks.LearningRateMonitor",
|
| 58 |
+
"logging_interval": "step"
|
| 59 |
+
}
|
| 60 |
+
},
|
| 61 |
+
"checkpointing": {
|
| 62 |
+
"resume_ckpt_path": "/home/david3684/projects/flm/hf_upload/checkpoints/last.ckpt",
|
| 63 |
+
"resume_from_ckpt": false,
|
| 64 |
+
"save_dir": "/home/david3684/projects/flm/hf_upload"
|
| 65 |
+
},
|
| 66 |
+
"data": {
|
| 67 |
+
"cache_dir": "/home/irteam/workspace/datasets/openwebtext",
|
| 68 |
+
"insert_train_eos": true,
|
| 69 |
+
"insert_valid_eos": true,
|
| 70 |
+
"streaming": false,
|
| 71 |
+
"tokenizer_name_or_path": "gpt2",
|
| 72 |
+
"train": "openwebtext-train",
|
| 73 |
+
"valid": "openwebtext-valid",
|
| 74 |
+
"wrap": true
|
| 75 |
+
},
|
| 76 |
+
"eval": {
|
| 77 |
+
"checkpoint_path": "",
|
| 78 |
+
"compute_generative_perplexity": true,
|
| 79 |
+
"compute_perplexity_on_sanity": false,
|
| 80 |
+
"disable_ema": false,
|
| 81 |
+
"ema_decay": null,
|
| 82 |
+
"gen_ppl_eval_model_name_or_path": "gpt2-large",
|
| 83 |
+
"generate_samples": true,
|
| 84 |
+
"generated_samples_path": "/home/david3684/projects/flm/hf_upload/samples.json",
|
| 85 |
+
"perplexity_batch_size": 8
|
| 86 |
+
},
|
| 87 |
+
"is_di4c": false,
|
| 88 |
+
"is_di4c_deterministic": true,
|
| 89 |
+
"loader": {
|
| 90 |
+
"batch_size": 16,
|
| 91 |
+
"eval_batch_size": 16,
|
| 92 |
+
"eval_global_batch_size": 128,
|
| 93 |
+
"global_batch_size": 128,
|
| 94 |
+
"num_workers": 4,
|
| 95 |
+
"pin_memory": true
|
| 96 |
+
},
|
| 97 |
+
"lr_scheduler": {
|
| 98 |
+
"_target_": "transformers.get_constant_schedule_with_warmup",
|
| 99 |
+
"num_warmup_steps": 2500
|
| 100 |
+
},
|
| 101 |
+
"mode": "train",
|
| 102 |
+
"model": {
|
| 103 |
+
"cond_dim": 128,
|
| 104 |
+
"dropout": 0.1,
|
| 105 |
+
"hidden_size": 768,
|
| 106 |
+
"l2_normalize_embeddings": false,
|
| 107 |
+
"length": 1024,
|
| 108 |
+
"n_blocks": 12,
|
| 109 |
+
"n_heads": 12,
|
| 110 |
+
"name": "small",
|
| 111 |
+
"scale_by_sigma": true,
|
| 112 |
+
"tie_word_embeddings": false,
|
| 113 |
+
"type": "ddit",
|
| 114 |
+
"vocab_lookup": true
|
| 115 |
+
},
|
| 116 |
+
"noise": {
|
| 117 |
+
"denoiser_latent_conditioning": -1,
|
| 118 |
+
"eps": 0,
|
| 119 |
+
"freeze_decoder": false,
|
| 120 |
+
"freeze_encoder": false,
|
| 121 |
+
"parameterization": "log-linear",
|
| 122 |
+
"type": "log-linear"
|
| 123 |
+
},
|
| 124 |
+
"optim": {
|
| 125 |
+
"beta1": 0.9,
|
| 126 |
+
"beta2": 0.95,
|
| 127 |
+
"eps": 1e-08,
|
| 128 |
+
"ln_tune": "none",
|
| 129 |
+
"lr": 0.0003,
|
| 130 |
+
"muon_lr": 0.03,
|
| 131 |
+
"muon_momentum": 0.95,
|
| 132 |
+
"muon_weight_decay": 0.01,
|
| 133 |
+
"use_muon": false,
|
| 134 |
+
"weight_decay": 0
|
| 135 |
+
},
|
| 136 |
+
"prior": {
|
| 137 |
+
"latent_height": 0,
|
| 138 |
+
"latent_width": 0,
|
| 139 |
+
"type": "none"
|
| 140 |
+
},
|
| 141 |
+
"sampling": {
|
| 142 |
+
"argmax_correction": false,
|
| 143 |
+
"autoguidance_weight": 0.0,
|
| 144 |
+
"hard_start": false,
|
| 145 |
+
"noise_removal": "uniform_alpha",
|
| 146 |
+
"num_reflow_samples": 50000,
|
| 147 |
+
"num_sample_batches": 1,
|
| 148 |
+
"num_sample_log": 2,
|
| 149 |
+
"num_strides": 1,
|
| 150 |
+
"p_nucleus": 1.0,
|
| 151 |
+
"predictor": "ancestral",
|
| 152 |
+
"semi_ar": false,
|
| 153 |
+
"solver": "euler",
|
| 154 |
+
"steps": [
|
| 155 |
+
1,
|
| 156 |
+
2,
|
| 157 |
+
4,
|
| 158 |
+
8,
|
| 159 |
+
16,
|
| 160 |
+
32,
|
| 161 |
+
64,
|
| 162 |
+
128
|
| 163 |
+
],
|
| 164 |
+
"stride_length": 1,
|
| 165 |
+
"tau_log10": -1.0,
|
| 166 |
+
"temperature": 1.0,
|
| 167 |
+
"use_float64": true
|
| 168 |
+
},
|
| 169 |
+
"seed": 1,
|
| 170 |
+
"strategy": {
|
| 171 |
+
"_target_": "lightning.pytorch.strategies.DDPStrategy",
|
| 172 |
+
"find_unused_parameters": false
|
| 173 |
+
},
|
| 174 |
+
"trainer": {
|
| 175 |
+
"_target_": "lightning.Trainer",
|
| 176 |
+
"accelerator": "cuda",
|
| 177 |
+
"accumulate_grad_batches": 1,
|
| 178 |
+
"devices": 8,
|
| 179 |
+
"gradient_clip_val": 1.0,
|
| 180 |
+
"limit_train_batches": 1.0,
|
| 181 |
+
"limit_val_batches": 10,
|
| 182 |
+
"log_every_n_steps": 100,
|
| 183 |
+
"max_steps": 1000000,
|
| 184 |
+
"num_nodes": 1,
|
| 185 |
+
"num_sanity_val_steps": 2,
|
| 186 |
+
"precision": "bf16",
|
| 187 |
+
"val_check_interval": 10000
|
| 188 |
+
},
|
| 189 |
+
"training": {
|
| 190 |
+
"antithetic_sampling": true,
|
| 191 |
+
"change_of_variables": false,
|
| 192 |
+
"double_ema": 0.0,
|
| 193 |
+
"ema": "0.9999, 0.999, 0.99, 0.95",
|
| 194 |
+
"finetune_path": "",
|
| 195 |
+
"importance_sampling": false,
|
| 196 |
+
"load_ema": false,
|
| 197 |
+
"loss_precision": "bf16",
|
| 198 |
+
"loss_type": "sd",
|
| 199 |
+
"loss_weighting": false,
|
| 200 |
+
"not_sampling_t": false,
|
| 201 |
+
"pred_type": "x0",
|
| 202 |
+
"sampling_eps": 0.001,
|
| 203 |
+
"t_curriculum_max": 1.0,
|
| 204 |
+
"t_curriculum_min": 0.0,
|
| 205 |
+
"t_curriculum_steps": 100000,
|
| 206 |
+
"torch_compile_mode": "default",
|
| 207 |
+
"use_torch_compile": true
|
| 208 |
+
},
|
| 209 |
+
"wandb": {
|
| 210 |
+
"group": null,
|
| 211 |
+
"id": "9efb5cfb",
|
| 212 |
+
"job_type": null,
|
| 213 |
+
"name": "owt_PSD_teacher_distill_LR_3e-4_DF_0.5_BP_32_SE_False_IT_True_EDMW_False_EMA_False_beta2_0.95_9efb5cfb",
|
| 214 |
+
"notes": "DOS",
|
| 215 |
+
"project": "owt_full",
|
| 216 |
+
"tags": [
|
| 217 |
+
"openwebtext-train",
|
| 218 |
+
"dos_denoiser"
|
| 219 |
+
]
|
| 220 |
+
}
|
| 221 |
+
},
|
| 222 |
+
"vocab_size": 50258
|
| 223 |
+
}
|
checkpoints/quarantine/20260820T072128Z/official/langflow/owt/__init__.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""HuggingFace release package for LangFlow."""
|
| 2 |
+
|
| 3 |
+
from .config import LangFlowConfig
|
| 4 |
+
from .model import LangFlow
|
| 5 |
+
|
| 6 |
+
__all__ = ["LangFlowConfig", "LangFlow"]
|
checkpoints/quarantine/20260820T072218Z/official/duo/owt/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- Skylion007/openwebtext
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
metrics:
|
| 9 |
+
- perplexity
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Using DUO
|
| 14 |
+
To use the pre-trained model for masked language modeling, use the following snippet:
|
| 15 |
+
```python
|
| 16 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 17 |
+
|
| 18 |
+
# See the `MDLM` collection page on the hub for list of available models.
|
| 19 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
| 20 |
+
model = AutoModelForMaskedLM.from_pretrained('s-sahoo/duo')
|
| 21 |
+
```
|
| 22 |
+
For a hands-on example, check out this [Colab notebook](https://colab.research.google.com/drive/1Sf7R-dqdR6gq-H8nyZ9E3ZkyvqMTqcwq?usp=sharing).
|
| 23 |
+
For more information and implementation details, visit our github repository: [DUO](https://github.com/s-sahoo/duo) and project page: [Project Page](https://s-sahoo.com/duo)
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
The model, which has a context length of `1024` and is similar in size to GPT2-medium with approximately `130 million` non-embedding parameters,
|
| 27 |
+
was trained for 1M steps on the OpenWebText corpus.
|
| 28 |
+
|
| 29 |
+
For more details, please see our paper: [The Diffusion Duality](https://openreview.net/forum?id=CB0Ub2yXjC).
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## Citation
|
| 34 |
+
|
| 35 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 36 |
+
Please cite our work using the bibtex below:
|
| 37 |
+
|
| 38 |
+
**BibTeX:**
|
| 39 |
+
|
| 40 |
+
```
|
| 41 |
+
@inproceedings{
|
| 42 |
+
sahoo2025the,
|
| 43 |
+
title={The Diffusion Duality},
|
| 44 |
+
author={Subham Sekhar Sahoo and Justin Deschenaux and Aaron Gokaslan and Guanghan Wang and Justin T Chiu and Volodymyr Kuleshov},
|
| 45 |
+
booktitle={Forty-second International Conference on Machine Learning},
|
| 46 |
+
year={2025},
|
| 47 |
+
url={https://openreview.net/forum?id=9P9Y8FOSOk}
|
| 48 |
+
}
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
## Model Card Contact
|
| 53 |
+
Subham Sekhar Sahoo (ssahoo@cs.cornell.edu)
|
checkpoints/quarantine/20260820T072218Z/official/duo/owt/config.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import transformers
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class DUOConfig(transformers.PretrainedConfig):
|
| 5 |
+
"""Hugging Face configuration class for DUO."""
|
| 6 |
+
model_type = 'DUO'
|
| 7 |
+
|
| 8 |
+
def __init__(
|
| 9 |
+
self,
|
| 10 |
+
vocab_size: int = 50258,
|
| 11 |
+
model_length: int = 1024,
|
| 12 |
+
causal: bool = False,
|
| 13 |
+
hidden_dim: int = 768,
|
| 14 |
+
cond_dim: int = 129,
|
| 15 |
+
n_blocks: int = 12,
|
| 16 |
+
n_heads: int = 12,
|
| 17 |
+
dropout: float = 0.1,
|
| 18 |
+
var_min: bool = True,
|
| 19 |
+
** kwargs):
|
| 20 |
+
super().__init__(**kwargs)
|
| 21 |
+
self.causal = causal
|
| 22 |
+
self.vocab_size = vocab_size
|
| 23 |
+
self.model_length = model_length
|
| 24 |
+
self.hidden_dim = hidden_dim
|
| 25 |
+
self.cond_dim = cond_dim
|
| 26 |
+
self.n_blocks = n_blocks
|
| 27 |
+
self.n_heads = n_heads
|
| 28 |
+
self.dropout = dropout
|
| 29 |
+
self.var_min = var_min
|
checkpoints/quarantine/20260820T072232Z/official/duo_dcd/owt/config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "s-sahoo/duo-distilled",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DUO"
|
| 5 |
+
],
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "config.DUOConfig",
|
| 8 |
+
"AutoModelForMaskedLM": "model.DUO"
|
| 9 |
+
},
|
| 10 |
+
"causal": false,
|
| 11 |
+
"cond_dim": 128,
|
| 12 |
+
"dropout": 0.1,
|
| 13 |
+
"hidden_dim": 768,
|
| 14 |
+
"model_length": 1024,
|
| 15 |
+
"model_type": "DUO",
|
| 16 |
+
"n_blocks": 12,
|
| 17 |
+
"n_heads": 12,
|
| 18 |
+
"return_dict": false,
|
| 19 |
+
"torch_dtype": "float32",
|
| 20 |
+
"transformers_version": "4.38.2",
|
| 21 |
+
"var_min": true,
|
| 22 |
+
"vocab_size": 50258
|
| 23 |
+
}
|
checkpoints/quarantine/20260820T072232Z/official/duo_dcd/owt/model.py
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import math
|
| 2 |
+
import typing
|
| 3 |
+
|
| 4 |
+
import einops
|
| 5 |
+
import flash_attn
|
| 6 |
+
import flash_attn.layers.rotary
|
| 7 |
+
import huggingface_hub
|
| 8 |
+
import omegaconf
|
| 9 |
+
import torch
|
| 10 |
+
import torch.nn as nn
|
| 11 |
+
import torch.nn.functional as F
|
| 12 |
+
import transformers
|
| 13 |
+
|
| 14 |
+
from .config import DUOConfig
|
| 15 |
+
|
| 16 |
+
# Flags required to enable jit fusion kernels
|
| 17 |
+
torch._C._jit_set_profiling_mode(False)
|
| 18 |
+
torch._C._jit_set_profiling_executor(False)
|
| 19 |
+
torch._C._jit_override_can_fuse_on_cpu(True)
|
| 20 |
+
torch._C._jit_override_can_fuse_on_gpu(True)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def bias_dropout_add_scale(
|
| 24 |
+
x: torch.Tensor,
|
| 25 |
+
bias: typing.Optional[torch.Tensor],
|
| 26 |
+
scale: torch.Tensor,
|
| 27 |
+
residual: typing.Optional[torch.Tensor],
|
| 28 |
+
prob: float,
|
| 29 |
+
training: bool) -> torch.Tensor:
|
| 30 |
+
if bias is not None:
|
| 31 |
+
out = scale * F.dropout(x + bias, p=prob, training=training)
|
| 32 |
+
else:
|
| 33 |
+
out = scale * F.dropout(x, p=prob, training=training)
|
| 34 |
+
|
| 35 |
+
if residual is not None:
|
| 36 |
+
out = residual + out
|
| 37 |
+
return out
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def get_bias_dropout_add_scale(training):
|
| 41 |
+
def _bias_dropout_add(x, bias, scale, residual, prob):
|
| 42 |
+
return bias_dropout_add_scale(
|
| 43 |
+
x, bias, scale, residual, prob, training)
|
| 44 |
+
|
| 45 |
+
return _bias_dropout_add
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
# function overload
|
| 49 |
+
def modulate(x: torch.Tensor,
|
| 50 |
+
shift: torch.Tensor,
|
| 51 |
+
scale: torch.Tensor) -> torch.Tensor:
|
| 52 |
+
return x * (1 + scale) + shift
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
@torch.jit.script
|
| 56 |
+
def bias_dropout_add_scale_fused_train(
|
| 57 |
+
x: torch.Tensor,
|
| 58 |
+
bias: typing.Optional[torch.Tensor],
|
| 59 |
+
scale: torch.Tensor,
|
| 60 |
+
residual: typing.Optional[torch.Tensor],
|
| 61 |
+
prob: float) -> torch.Tensor:
|
| 62 |
+
return bias_dropout_add_scale(
|
| 63 |
+
x, bias, scale, residual, prob, True)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@torch.jit.script
|
| 67 |
+
def bias_dropout_add_scale_fused_inference(
|
| 68 |
+
x: torch.Tensor,
|
| 69 |
+
bias: typing.Optional[torch.Tensor],
|
| 70 |
+
scale: torch.Tensor,
|
| 71 |
+
residual: typing.Optional[torch.Tensor],
|
| 72 |
+
prob: float) -> torch.Tensor:
|
| 73 |
+
return bias_dropout_add_scale(
|
| 74 |
+
x, bias, scale, residual, prob, False)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
@torch.jit.script
|
| 78 |
+
def modulate_fused(x: torch.Tensor,
|
| 79 |
+
shift: torch.Tensor,
|
| 80 |
+
scale: torch.Tensor) -> torch.Tensor:
|
| 81 |
+
return modulate(x, shift, scale)
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
class Rotary(torch.nn.Module):
|
| 85 |
+
def __init__(self, dim, base=10_000):
|
| 86 |
+
super().__init__()
|
| 87 |
+
inv_freq = 1.0 / (base ** (torch.arange(0, dim, 2).float() / dim))
|
| 88 |
+
self.register_buffer('inv_freq', inv_freq)
|
| 89 |
+
self.seq_len_cached = None
|
| 90 |
+
self.cos_cached = None
|
| 91 |
+
self.sin_cached = None
|
| 92 |
+
|
| 93 |
+
def forward(self, x, seq_dim=1):
|
| 94 |
+
seq_len = x.shape[seq_dim]
|
| 95 |
+
if seq_len != self.seq_len_cached:
|
| 96 |
+
self.seq_len_cached = seq_len
|
| 97 |
+
t = torch.arange(x.shape[seq_dim], device=x.device).type_as(self.inv_freq)
|
| 98 |
+
freqs = torch.einsum("i,j->ij", t, self.inv_freq.clone())
|
| 99 |
+
emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
|
| 100 |
+
# dims are: batch, seq_len, qkv, head, dim
|
| 101 |
+
self.cos_cached = emb.cos()[None, :, None, None, :].repeat(1,1,3,1,1)
|
| 102 |
+
self.sin_cached = emb.sin()[None, :, None, None, :].repeat(1,1,3,1,1)
|
| 103 |
+
# This makes the transformation on v an identity.
|
| 104 |
+
self.cos_cached[:,:,2,:,:].fill_(1.)
|
| 105 |
+
self.sin_cached[:,:,2,:,:].fill_(0.)
|
| 106 |
+
|
| 107 |
+
return self.cos_cached, self.sin_cached
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def rotate_half(x):
|
| 111 |
+
x1, x2 = x[..., : x.shape[-1] // 2], x[..., x.shape[-1] // 2 :]
|
| 112 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
def split_and_apply_rotary_pos_emb(qkv, rotary_cos_sin):
|
| 116 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 117 |
+
cos, sin = rotary_cos_sin
|
| 118 |
+
cos = cos.to(qkv.dtype)
|
| 119 |
+
sin = sin.to(qkv.dtype)
|
| 120 |
+
cos = cos[0,:,0,0,:cos.shape[-1]//2]
|
| 121 |
+
sin = sin[0,:,0,0,:sin.shape[-1]//2]
|
| 122 |
+
q, k, v = qkv.chunk(3, dim=2)
|
| 123 |
+
q = flash_attn.layers.rotary.apply_rotary_emb_torch(
|
| 124 |
+
q.squeeze(dim=2), cos, sin)
|
| 125 |
+
k = flash_attn.layers.rotary.apply_rotary_emb_torch(
|
| 126 |
+
k.squeeze(dim=2), cos, sin)
|
| 127 |
+
v = v.squeeze(dim=2)
|
| 128 |
+
return q, k, v
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
def apply_rotary_pos_emb(qkv, cos, sin):
|
| 132 |
+
cos = cos[0,:,0,0,:cos.shape[-1]//2]
|
| 133 |
+
sin = sin[0,:,0,0,:sin.shape[-1]//2]
|
| 134 |
+
return flash_attn.layers.rotary.apply_rotary_emb_qkv_(qkv, cos, sin)
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def regular_attention_multi_headed(q, k, v):
|
| 138 |
+
# Assuming qkv is a tensor with shape [batch, seq_len, 3, num_heads, head_dim]
|
| 139 |
+
# where the 3 represents Q, K, V packed in that order
|
| 140 |
+
attention_output = F.scaled_dot_product_attention(
|
| 141 |
+
query=q.transpose(1, 2),
|
| 142 |
+
key=k.transpose(1, 2),
|
| 143 |
+
value=v.transpose(1, 2),
|
| 144 |
+
attn_mask=None,
|
| 145 |
+
dropout_p=0.0,
|
| 146 |
+
is_causal=False)
|
| 147 |
+
# [batch_size, seq_len, num_heads, head_dim]
|
| 148 |
+
attention_output = attention_output.transpose(1, 2)
|
| 149 |
+
return einops.rearrange(attention_output, 'b s h d -> b s (h d)')
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
#################################################################################
|
| 153 |
+
# Layers #
|
| 154 |
+
#################################################################################
|
| 155 |
+
class LayerNorm(nn.Module):
|
| 156 |
+
def __init__(self, dim):
|
| 157 |
+
super().__init__()
|
| 158 |
+
self.weight = nn.Parameter(torch.ones([dim]))
|
| 159 |
+
self.dim = dim
|
| 160 |
+
def forward(self, x):
|
| 161 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 162 |
+
x = F.layer_norm(x.float(), [self.dim])
|
| 163 |
+
return x * self.weight[None, None, :]
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def residual_linear(x, W, x_skip, residual_scale):
|
| 167 |
+
"""x_skip + residual_scale * W @ x"""
|
| 168 |
+
dim_out, dim_in = W.shape[0], W.shape[1]
|
| 169 |
+
return torch.addmm(
|
| 170 |
+
x_skip.view(-1, dim_out),
|
| 171 |
+
x.view(-1, dim_in),
|
| 172 |
+
W.T,
|
| 173 |
+
alpha=residual_scale).view(*x.shape[:-1], dim_out)
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
#################################################################################
|
| 177 |
+
# Embedding Layers for Timesteps and Class Labels #
|
| 178 |
+
#################################################################################
|
| 179 |
+
class TimestepEmbedder(nn.Module):
|
| 180 |
+
"""
|
| 181 |
+
Embeds scalar timesteps into vector representations.
|
| 182 |
+
"""
|
| 183 |
+
def __init__(self, hidden_size, frequency_embedding_size=256):
|
| 184 |
+
super().__init__()
|
| 185 |
+
self.mlp = nn.Sequential(
|
| 186 |
+
nn.Linear(frequency_embedding_size, hidden_size, bias=True),
|
| 187 |
+
nn.SiLU(),
|
| 188 |
+
nn.Linear(hidden_size, hidden_size, bias=True))
|
| 189 |
+
self.frequency_embedding_size = frequency_embedding_size
|
| 190 |
+
|
| 191 |
+
@staticmethod
|
| 192 |
+
def timestep_embedding(t, dim, max_period=10000):
|
| 193 |
+
"""
|
| 194 |
+
Create sinusoidal timestep embeddings.
|
| 195 |
+
:param t: a 1-D Tensor of N indices, one per batch element.
|
| 196 |
+
These may be fractional.
|
| 197 |
+
:param dim: the dimension of the output.
|
| 198 |
+
:param max_period: controls the minimum frequency of the embeddings.
|
| 199 |
+
:return: an (N, D) Tensor of positional embeddings.
|
| 200 |
+
"""
|
| 201 |
+
# https://github.com/openai/glide-text2im/blob/main/glide_text2im/nn.py
|
| 202 |
+
half = dim // 2
|
| 203 |
+
freqs = torch.exp(
|
| 204 |
+
- math.log(max_period)
|
| 205 |
+
* torch.arange(start=0, end=half, dtype=torch.float32, device=t.device)
|
| 206 |
+
/ half)
|
| 207 |
+
args = t[:, None].float() * freqs[None]
|
| 208 |
+
embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1)
|
| 209 |
+
if dim % 2:
|
| 210 |
+
embedding = torch.cat(
|
| 211 |
+
[embedding,
|
| 212 |
+
torch.zeros_like(embedding[:, :1])], dim=-1)
|
| 213 |
+
return embedding
|
| 214 |
+
|
| 215 |
+
def forward(self, t):
|
| 216 |
+
t_freq = self.timestep_embedding(t, self.frequency_embedding_size)
|
| 217 |
+
t_emb = self.mlp(t_freq)
|
| 218 |
+
return t_emb
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
class LabelEmbedder(nn.Module):
|
| 222 |
+
"""Embeds class labels into vector representations.
|
| 223 |
+
|
| 224 |
+
Also handles label dropout for classifier-free guidance.
|
| 225 |
+
"""
|
| 226 |
+
def __init__(self, num_classes, cond_size):
|
| 227 |
+
super().__init__()
|
| 228 |
+
self.embedding_table = nn.Embedding(num_classes + 1, cond_size)
|
| 229 |
+
self.num_classes = num_classes
|
| 230 |
+
|
| 231 |
+
# TODO think of initializing with 0.02 std deviation like in original DiT paper
|
| 232 |
+
|
| 233 |
+
def forward(self, labels):
|
| 234 |
+
embeddings = self.embedding_table(labels)
|
| 235 |
+
return embeddings
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
#################################################################################
|
| 239 |
+
# Core Model #
|
| 240 |
+
#################################################################################
|
| 241 |
+
|
| 242 |
+
class DDiTBlockCausal(nn.Module):
|
| 243 |
+
def __init__(self, dim, n_heads, mlp_ratio=4, dropout=0.1):
|
| 244 |
+
super().__init__()
|
| 245 |
+
self.n_heads = n_heads
|
| 246 |
+
|
| 247 |
+
self.norm1 = LayerNorm(dim)
|
| 248 |
+
self.attn_qkv = nn.Linear(dim, 3 * dim, bias=False)
|
| 249 |
+
self.attn_out = nn.Linear(dim, dim, bias=False)
|
| 250 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 251 |
+
|
| 252 |
+
self.norm2 = LayerNorm(dim)
|
| 253 |
+
self.mlp = nn.Sequential(
|
| 254 |
+
nn.Linear(dim, mlp_ratio * dim, bias=True),
|
| 255 |
+
nn.GELU(approximate='tanh'),
|
| 256 |
+
nn.Linear(mlp_ratio * dim, dim, bias=True))
|
| 257 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 258 |
+
self.dropout = dropout
|
| 259 |
+
|
| 260 |
+
def _get_bias_dropout_scale(self):
|
| 261 |
+
if self.training:
|
| 262 |
+
return bias_dropout_add_scale_fused_train
|
| 263 |
+
else:
|
| 264 |
+
return bias_dropout_add_scale_fused_inference
|
| 265 |
+
|
| 266 |
+
def forward(self, x, rotary_cos_sin, **kwargs):
|
| 267 |
+
del kwargs
|
| 268 |
+
batch_size, seq_len = x.shape[0], x.shape[1]
|
| 269 |
+
|
| 270 |
+
bias_dropout_scale_fn = self._get_bias_dropout_scale()
|
| 271 |
+
|
| 272 |
+
# attention operation
|
| 273 |
+
x_skip = x
|
| 274 |
+
x = self.norm1(x)
|
| 275 |
+
|
| 276 |
+
qkv = self.attn_qkv(x)
|
| 277 |
+
qkv = einops.rearrange(
|
| 278 |
+
qkv,
|
| 279 |
+
'b s (three h d) -> b s three h d',
|
| 280 |
+
three=3,
|
| 281 |
+
h=self.n_heads)
|
| 282 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 283 |
+
cos, sin = rotary_cos_sin
|
| 284 |
+
qkv = apply_rotary_pos_emb(
|
| 285 |
+
qkv, cos.to(qkv.dtype), sin.to(qkv.dtype)
|
| 286 |
+
)
|
| 287 |
+
qkv = einops.rearrange(qkv, 'b s ... -> (b s) ...')
|
| 288 |
+
cu_seqlens = torch.arange(
|
| 289 |
+
0, (batch_size + 1) * seq_len,
|
| 290 |
+
step=seq_len, dtype=torch.int32, device=qkv.device)
|
| 291 |
+
x = flash_attn.flash_attn_interface.flash_attn_varlen_qkvpacked_func(
|
| 292 |
+
qkv, cu_seqlens, seq_len, 0.0, causal=True)
|
| 293 |
+
|
| 294 |
+
x = einops.rearrange(x, '(b s) h d -> b s (h d)',
|
| 295 |
+
b=batch_size)
|
| 296 |
+
|
| 297 |
+
scale = torch.ones(1, device=x.device, dtype=x.dtype)
|
| 298 |
+
x = bias_dropout_scale_fn(
|
| 299 |
+
self.attn_out(x), None, scale, x_skip, self.dropout)
|
| 300 |
+
|
| 301 |
+
# mlp operation
|
| 302 |
+
x = bias_dropout_scale_fn(
|
| 303 |
+
self.mlp(self.norm2(x)), None, scale, x, self.dropout)
|
| 304 |
+
return x
|
| 305 |
+
|
| 306 |
+
|
| 307 |
+
|
| 308 |
+
class DDiTBlock(nn.Module):
|
| 309 |
+
def __init__(self, dim, n_heads, adaLN,
|
| 310 |
+
cond_dim=None, mlp_ratio=4,
|
| 311 |
+
dropout=0.1):
|
| 312 |
+
super().__init__()
|
| 313 |
+
self.n_heads = n_heads
|
| 314 |
+
self.adaLN = adaLN
|
| 315 |
+
|
| 316 |
+
self.norm1 = LayerNorm(dim)
|
| 317 |
+
self.attn_qkv = nn.Linear(dim, 3 * dim, bias=False)
|
| 318 |
+
self.attn_out = nn.Linear(dim, dim, bias=False)
|
| 319 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 320 |
+
|
| 321 |
+
self.norm2 = LayerNorm(dim)
|
| 322 |
+
self.mlp = nn.Sequential(
|
| 323 |
+
nn.Linear(dim, mlp_ratio * dim, bias=True),
|
| 324 |
+
nn.GELU(approximate='tanh'),
|
| 325 |
+
nn.Linear(mlp_ratio * dim, dim, bias=True))
|
| 326 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 327 |
+
self.dropout = dropout
|
| 328 |
+
|
| 329 |
+
if self.adaLN:
|
| 330 |
+
self.adaLN_modulation = nn.Linear(cond_dim, 6 * dim)
|
| 331 |
+
self.adaLN_modulation.weight.data.zero_()
|
| 332 |
+
self.adaLN_modulation.bias.data.zero_()
|
| 333 |
+
|
| 334 |
+
|
| 335 |
+
def _get_bias_dropout_scale(self):
|
| 336 |
+
if self.training:
|
| 337 |
+
return bias_dropout_add_scale_fused_train
|
| 338 |
+
else:
|
| 339 |
+
return bias_dropout_add_scale_fused_inference
|
| 340 |
+
|
| 341 |
+
|
| 342 |
+
def forward(self, x, rotary_cos_sin, c=None):
|
| 343 |
+
|
| 344 |
+
bias_dropout_scale_fn = self._get_bias_dropout_scale()
|
| 345 |
+
|
| 346 |
+
x_skip = x
|
| 347 |
+
x = self.norm1(x)
|
| 348 |
+
|
| 349 |
+
if self.adaLN:
|
| 350 |
+
# self.adaLN_modulation(c): (128, 1536)
|
| 351 |
+
# self.adaLN_modulation(c)[:, None]: (128, 1, 1536)
|
| 352 |
+
# "" .chunk(6, dim=2) returns 6 tuples of shapes (128, 1, 256)
|
| 353 |
+
(shift_msa, scale_msa, gate_msa, shift_mlp,
|
| 354 |
+
scale_mlp, gate_mlp) = self.adaLN_modulation(c)[:, None].chunk(6, dim=2)
|
| 355 |
+
x = modulate_fused(x, shift_msa, scale_msa)
|
| 356 |
+
|
| 357 |
+
qkv = einops.rearrange(
|
| 358 |
+
self.attn_qkv(x),
|
| 359 |
+
'b s (three h d) -> b s three h d',
|
| 360 |
+
three=3,
|
| 361 |
+
h=self.n_heads)
|
| 362 |
+
q, k, v = split_and_apply_rotary_pos_emb(qkv, rotary_cos_sin)
|
| 363 |
+
|
| 364 |
+
x = regular_attention_multi_headed(q, k, v)
|
| 365 |
+
|
| 366 |
+
if self.adaLN:
|
| 367 |
+
x = bias_dropout_scale_fn(self.attn_out(x),
|
| 368 |
+
None,
|
| 369 |
+
gate_msa,
|
| 370 |
+
x_skip,
|
| 371 |
+
self.dropout)
|
| 372 |
+
x = bias_dropout_scale_fn(
|
| 373 |
+
self.mlp(modulate_fused(
|
| 374 |
+
self.norm2(x), shift_mlp, scale_mlp)),
|
| 375 |
+
None, gate_mlp, x, self.dropout)
|
| 376 |
+
else:
|
| 377 |
+
scale = torch.ones(1, device=x.device, dtype=x.dtype)
|
| 378 |
+
x = bias_dropout_scale_fn(
|
| 379 |
+
self.attn_out(x), None, scale, x_skip, self.dropout)
|
| 380 |
+
x = bias_dropout_scale_fn(
|
| 381 |
+
self.mlp(self.norm2(x)), None, scale, x, self.dropout)
|
| 382 |
+
return x
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
class EmbeddingLayer(nn.Module):
|
| 386 |
+
def __init__(self, dim, vocab_dim):
|
| 387 |
+
super().__init__()
|
| 388 |
+
self.embedding = nn.Parameter(torch.empty((vocab_dim, dim)))
|
| 389 |
+
torch.nn.init.kaiming_uniform_(self.embedding, a=math.sqrt(5))
|
| 390 |
+
|
| 391 |
+
def forward(self, x):
|
| 392 |
+
if x.ndim == 2:
|
| 393 |
+
return self.embedding[x]
|
| 394 |
+
assert x.ndim == 3
|
| 395 |
+
return torch.einsum(
|
| 396 |
+
"blv,ve->ble",
|
| 397 |
+
torch.nn.functional.softmax(x, dim=-1).float(),
|
| 398 |
+
self.embedding.float()).to(x.dtype)
|
| 399 |
+
|
| 400 |
+
|
| 401 |
+
class DDiTFinalLayer(nn.Module):
|
| 402 |
+
def __init__(self, hidden_size, out_channels, cond_dim,
|
| 403 |
+
adaLN):
|
| 404 |
+
super().__init__()
|
| 405 |
+
self.norm_final = LayerNorm(hidden_size)
|
| 406 |
+
self.linear = nn.Linear(hidden_size, out_channels)
|
| 407 |
+
self.linear.weight.data.zero_()
|
| 408 |
+
self.linear.bias.data.zero_()
|
| 409 |
+
self.adaLN = adaLN
|
| 410 |
+
if self.adaLN:
|
| 411 |
+
self.adaLN_modulation = nn.Linear(cond_dim,
|
| 412 |
+
2 * hidden_size,
|
| 413 |
+
bias=True)
|
| 414 |
+
self.adaLN_modulation.weight.data.zero_()
|
| 415 |
+
self.adaLN_modulation.bias.data.zero_()
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
def forward(self, x, c):
|
| 419 |
+
x = self.norm_final(x)
|
| 420 |
+
if self.adaLN:
|
| 421 |
+
shift, scale = self.adaLN_modulation(c)[:, None].chunk(2, dim=2)
|
| 422 |
+
x = modulate_fused(x, shift, scale)
|
| 423 |
+
x = self.linear(x)
|
| 424 |
+
return x
|
| 425 |
+
|
| 426 |
+
|
| 427 |
+
class DIT(nn.Module, huggingface_hub.PyTorchModelHubMixin):
|
| 428 |
+
def __init__(self, config, vocab_size: int):
|
| 429 |
+
super().__init__()
|
| 430 |
+
if type(config) == dict:
|
| 431 |
+
config = omegaconf.OmegaConf.create(config)
|
| 432 |
+
self.causal = config.algo.causal_attention
|
| 433 |
+
self.adaLN = not self.causal
|
| 434 |
+
self.config = config
|
| 435 |
+
self.vocab_size = vocab_size
|
| 436 |
+
dim = config.model.hidden_size
|
| 437 |
+
cond_dim = config.model.cond_dim
|
| 438 |
+
self.vocab_embed = EmbeddingLayer(dim, vocab_size)
|
| 439 |
+
if not self.causal:
|
| 440 |
+
self.sigma_map = TimestepEmbedder(cond_dim)
|
| 441 |
+
self.rotary_emb = Rotary(dim // config.model.n_heads)
|
| 442 |
+
|
| 443 |
+
blocks = []
|
| 444 |
+
for _ in range(config.model.n_blocks):
|
| 445 |
+
if self.causal:
|
| 446 |
+
block = DDiTBlockCausal(
|
| 447 |
+
dim=dim,
|
| 448 |
+
n_heads=config.model.n_heads,
|
| 449 |
+
dropout=config.model.dropout)
|
| 450 |
+
else:
|
| 451 |
+
block = DDiTBlock(
|
| 452 |
+
dim=dim,
|
| 453 |
+
n_heads=config.model.n_heads,
|
| 454 |
+
cond_dim=cond_dim,
|
| 455 |
+
adaLN=self.adaLN,
|
| 456 |
+
dropout=config.model.dropout)
|
| 457 |
+
blocks.append(block)
|
| 458 |
+
self.blocks = nn.ModuleList(blocks)
|
| 459 |
+
|
| 460 |
+
self.output_layer = DDiTFinalLayer(
|
| 461 |
+
hidden_size=dim,
|
| 462 |
+
out_channels=vocab_size,
|
| 463 |
+
cond_dim=cond_dim,
|
| 464 |
+
adaLN=self.adaLN)
|
| 465 |
+
self.scale_by_sigma = config.model.scale_by_sigma
|
| 466 |
+
|
| 467 |
+
def _get_bias_dropout_scale(self):
|
| 468 |
+
if self.training:
|
| 469 |
+
return bias_dropout_add_scale_fused_train
|
| 470 |
+
else:
|
| 471 |
+
return bias_dropout_add_scale_fused_inference
|
| 472 |
+
|
| 473 |
+
def forward(self, x, sigma):
|
| 474 |
+
x = self.vocab_embed(x)
|
| 475 |
+
if self.causal:
|
| 476 |
+
t_cond = None
|
| 477 |
+
else:
|
| 478 |
+
t_cond = F.silu(self.sigma_map(sigma))
|
| 479 |
+
|
| 480 |
+
rotary_cos_sin = self.rotary_emb(x).to(x.device)
|
| 481 |
+
|
| 482 |
+
with torch.cuda.amp.autocast(dtype=torch.bfloat16):
|
| 483 |
+
for i in range(len(self.blocks)):
|
| 484 |
+
x = self.blocks[i](x, rotary_cos_sin, c=t_cond)
|
| 485 |
+
x = self.output_layer(x, c=t_cond)
|
| 486 |
+
|
| 487 |
+
return x
|
| 488 |
+
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
class HFDIT(torch.nn.Module):
|
| 492 |
+
def __init__(self, config):
|
| 493 |
+
super().__init__()
|
| 494 |
+
self.causal = config.causal
|
| 495 |
+
self.adaLN = not self.causal
|
| 496 |
+
self.vocab_size = config.vocab_size
|
| 497 |
+
dim = config.hidden_dim
|
| 498 |
+
cond_dim = config.cond_dim
|
| 499 |
+
self.vocab_embed = EmbeddingLayer(dim, self.vocab_size)
|
| 500 |
+
if not self.causal:
|
| 501 |
+
self.sigma_map = TimestepEmbedder(cond_dim)
|
| 502 |
+
self.rotary_emb = Rotary(dim // config.n_heads)
|
| 503 |
+
|
| 504 |
+
blocks = []
|
| 505 |
+
for _ in range(config.n_blocks):
|
| 506 |
+
if self.causal:
|
| 507 |
+
block = DDiTBlockCausal(
|
| 508 |
+
dim=dim,
|
| 509 |
+
n_heads=config.n_heads,
|
| 510 |
+
dropout=config.dropout)
|
| 511 |
+
else:
|
| 512 |
+
block = DDiTBlock(
|
| 513 |
+
dim=dim,
|
| 514 |
+
n_heads=config.n_heads,
|
| 515 |
+
cond_dim=cond_dim,
|
| 516 |
+
adaLN=self.adaLN,
|
| 517 |
+
dropout=config.dropout)
|
| 518 |
+
blocks.append(block)
|
| 519 |
+
self.blocks = torch.nn.ModuleList(blocks)
|
| 520 |
+
|
| 521 |
+
self.output_layer = DDiTFinalLayer(
|
| 522 |
+
hidden_size=dim,
|
| 523 |
+
out_channels=self.vocab_size,
|
| 524 |
+
cond_dim=cond_dim,
|
| 525 |
+
adaLN=self.adaLN)
|
| 526 |
+
|
| 527 |
+
def _get_bias_dropout_scale(self):
|
| 528 |
+
if self.training:
|
| 529 |
+
return bias_dropout_add_scale_fused_train
|
| 530 |
+
else:
|
| 531 |
+
return bias_dropout_add_scale_fused_inference
|
| 532 |
+
|
| 533 |
+
def forward(self, x, sigma, output_hidden_states=False):
|
| 534 |
+
all_hidden_states = []
|
| 535 |
+
x = self.vocab_embed(x)
|
| 536 |
+
if output_hidden_states:
|
| 537 |
+
all_hidden_states.append(x)
|
| 538 |
+
if self.causal:
|
| 539 |
+
t_cond = None
|
| 540 |
+
else:
|
| 541 |
+
t_cond = F.silu(self.sigma_map(sigma))
|
| 542 |
+
|
| 543 |
+
rotary_cos_sin = self.rotary_emb(x)
|
| 544 |
+
with torch.cuda.amp.autocast(
|
| 545 |
+
dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float32):
|
| 546 |
+
for i in range(len(self.blocks)):
|
| 547 |
+
x = self.blocks[i](x, rotary_cos_sin, c=t_cond)
|
| 548 |
+
if output_hidden_states:
|
| 549 |
+
all_hidden_states.append(x)
|
| 550 |
+
x = self.output_layer(x, c=t_cond)
|
| 551 |
+
return x, all_hidden_states
|
| 552 |
+
|
| 553 |
+
|
| 554 |
+
class DUO(transformers.PreTrainedModel):
|
| 555 |
+
"""HF-compatible model."""
|
| 556 |
+
config_class = DUOConfig
|
| 557 |
+
base_model_prefix = 'duo'
|
| 558 |
+
|
| 559 |
+
def __init__(self, config: DUOConfig):
|
| 560 |
+
super().__init__(config)
|
| 561 |
+
self.config = config
|
| 562 |
+
self.backbone = HFDIT(config)
|
| 563 |
+
|
| 564 |
+
def reset_kv_cache(self):
|
| 565 |
+
for block in self.backbone.blocks:
|
| 566 |
+
block.kv_cache = None
|
| 567 |
+
|
| 568 |
+
def forward(
|
| 569 |
+
self,
|
| 570 |
+
input_ids: torch.LongTensor = None,
|
| 571 |
+
timesteps: torch.FloatTensor = None,
|
| 572 |
+
output_hidden_states: typing.Optional[bool] = None,
|
| 573 |
+
return_dict: typing.Optional[bool] = None,
|
| 574 |
+
) -> typing.Union[
|
| 575 |
+
torch.Tensor, typing.Tuple,
|
| 576 |
+
transformers.modeling_outputs.MaskedLMOutput]:
|
| 577 |
+
"""HF-compatible forward method."""
|
| 578 |
+
output_hidden_states = (
|
| 579 |
+
output_hidden_states
|
| 580 |
+
if output_hidden_states is not None
|
| 581 |
+
else self.config.output_hidden_states
|
| 582 |
+
)
|
| 583 |
+
return_dict = return_dict \
|
| 584 |
+
if return_dict is not None \
|
| 585 |
+
else self.config.use_return_dict
|
| 586 |
+
|
| 587 |
+
logits, all_hidden_states = self.backbone(
|
| 588 |
+
x=input_ids,
|
| 589 |
+
sigma=timesteps,
|
| 590 |
+
output_hidden_states=output_hidden_states,
|
| 591 |
+
)
|
| 592 |
+
if return_dict:
|
| 593 |
+
return transformers.modeling_outputs.MaskedLMOutput(
|
| 594 |
+
logits=logits,
|
| 595 |
+
hidden_states=all_hidden_states if output_hidden_states else None,
|
| 596 |
+
loss=None
|
| 597 |
+
)
|
| 598 |
+
elif output_hidden_states:
|
| 599 |
+
return logits, all_hidden_states
|
| 600 |
+
else:
|
| 601 |
+
return logits
|
checkpoints/quarantine/20260820T072244Z/official/mdlm/owt/config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "kuleshov-group/mdlm-owt",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MDLM"
|
| 5 |
+
],
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_mdlm.MDLMConfig",
|
| 8 |
+
"AutoModelForMaskedLM": "modeling_mdlm.MDLM"
|
| 9 |
+
},
|
| 10 |
+
"cond_dim": 128,
|
| 11 |
+
"dropout": 0.1,
|
| 12 |
+
"hidden_dim": 768,
|
| 13 |
+
"model_length": 1024,
|
| 14 |
+
"model_type": "mdlm",
|
| 15 |
+
"n_blocks": 12,
|
| 16 |
+
"n_heads": 12,
|
| 17 |
+
"return_dict": false,
|
| 18 |
+
"time_conditioning": false,
|
| 19 |
+
"torch_dtype": "float32",
|
| 20 |
+
"transformers_version": "4.38.2",
|
| 21 |
+
"vocab_size": 50258
|
| 22 |
+
}
|
checkpoints/quarantine/20260820T073530Z/official/rdlm/lm1b/Text8/config.yaml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
seed: 0
|
| 2 |
+
ngpus: 2
|
| 3 |
+
run_mode: train
|
| 4 |
+
num_workers: 8
|
| 5 |
+
paths:
|
| 6 |
+
experiments: exps
|
| 7 |
+
n_jobs: 2
|
| 8 |
+
model:
|
| 9 |
+
_target_: model.dit.DiT
|
| 10 |
+
hidden_size: 768
|
| 11 |
+
n_heads: 12
|
| 12 |
+
cond_dim: 128
|
| 13 |
+
dropout: 0.0
|
| 14 |
+
n_blocks: 12
|
| 15 |
+
length: 256
|
| 16 |
+
input_dim: ${tokens}
|
| 17 |
+
output_dim: ${tokens}
|
| 18 |
+
name: text8
|
| 19 |
+
original_tokens: 27
|
| 20 |
+
tokens: 27
|
| 21 |
+
training:
|
| 22 |
+
batch_size: 512
|
| 23 |
+
accum: 1
|
| 24 |
+
n_iters: 1000001
|
| 25 |
+
snapshot_freq: 50000
|
| 26 |
+
log_freq: 50
|
| 27 |
+
eval_freq: 100
|
| 28 |
+
snapshot_freq_for_preemption: 5000
|
| 29 |
+
snapshot_sampling: true
|
| 30 |
+
ema: 0.9999
|
| 31 |
+
loss_type: ce
|
| 32 |
+
data:
|
| 33 |
+
train: text8
|
| 34 |
+
valid: text8
|
| 35 |
+
cache_dir: data
|
| 36 |
+
sampling:
|
| 37 |
+
steps: 256
|
| 38 |
+
predictor: grw
|
| 39 |
+
eval:
|
| 40 |
+
batch_size: ${training.batch_size}
|
| 41 |
+
n_iters: 500
|
| 42 |
+
entropy: true
|
| 43 |
+
eval_model: gptj
|
| 44 |
+
nll: true
|
| 45 |
+
simul_steps: 500
|
| 46 |
+
sde:
|
| 47 |
+
_target_: sde.LogBridge_Mixture
|
| 48 |
+
preprocess_steps: 10000
|
| 49 |
+
mix_type: step
|
| 50 |
+
rho_scale: 1.0
|
| 51 |
+
step_thr: 0.35
|
| 52 |
+
prior_dist:
|
| 53 |
+
_target_: distribution.Mixture
|
| 54 |
+
add_mask_token: true
|
| 55 |
+
scheduler:
|
| 56 |
+
_target_: scheduler_lib.Geometric
|
| 57 |
+
beta_0: 0.001
|
| 58 |
+
beta_f: 0.2
|
| 59 |
+
weight_type: step
|
| 60 |
+
left: 0.3
|
| 61 |
+
right: 0.6
|
| 62 |
+
lb: 0.0001
|
| 63 |
+
ub: 1.0
|
| 64 |
+
optim:
|
| 65 |
+
name: adamw
|
| 66 |
+
optimizer: AdamW
|
| 67 |
+
weight_decay: 0
|
| 68 |
+
lr: 0.0003
|
| 69 |
+
beta1: 0.9
|
| 70 |
+
beta2: 0.999
|
| 71 |
+
eps: 1.0e-08
|
| 72 |
+
warmup: 2500
|
| 73 |
+
grad_clip: 1.0
|
checkpoints/quarantine/20260821T024751Z/official/langflow/lm1b/__init__.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""HuggingFace release package for LangFlow."""
|
| 2 |
+
|
| 3 |
+
from .config import LangFlowConfig
|
| 4 |
+
from .model import LangFlow
|
| 5 |
+
|
| 6 |
+
__all__ = ["LangFlowConfig", "LangFlow"]
|
checkpoints/quarantine/20260821T024800Z/official/duo/owt/config.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import transformers
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class DUOConfig(transformers.PretrainedConfig):
|
| 5 |
+
"""Hugging Face configuration class for DUO."""
|
| 6 |
+
model_type = 'DUO'
|
| 7 |
+
|
| 8 |
+
def __init__(
|
| 9 |
+
self,
|
| 10 |
+
vocab_size: int = 50258,
|
| 11 |
+
model_length: int = 1024,
|
| 12 |
+
causal: bool = False,
|
| 13 |
+
hidden_dim: int = 768,
|
| 14 |
+
cond_dim: int = 129,
|
| 15 |
+
n_blocks: int = 12,
|
| 16 |
+
n_heads: int = 12,
|
| 17 |
+
dropout: float = 0.1,
|
| 18 |
+
var_min: bool = True,
|
| 19 |
+
** kwargs):
|
| 20 |
+
super().__init__(**kwargs)
|
| 21 |
+
self.causal = causal
|
| 22 |
+
self.vocab_size = vocab_size
|
| 23 |
+
self.model_length = model_length
|
| 24 |
+
self.hidden_dim = hidden_dim
|
| 25 |
+
self.cond_dim = cond_dim
|
| 26 |
+
self.n_blocks = n_blocks
|
| 27 |
+
self.n_heads = n_heads
|
| 28 |
+
self.dropout = dropout
|
| 29 |
+
self.var_min = var_min
|
checkpoints/quarantine/20260821T024808Z/official/duo_dcd/owt/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- Skylion007/openwebtext
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
metrics:
|
| 9 |
+
- perplexity
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Using DUO
|
| 14 |
+
To use the pre-trained model for masked language modeling, use the following snippet:
|
| 15 |
+
```python
|
| 16 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 17 |
+
|
| 18 |
+
# See the `DUO` collection page on the hub for list of available models.
|
| 19 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
| 20 |
+
model = AutoModelForMaskedLM.from_pretrained('s-sahoo/duo-distilled')
|
| 21 |
+
```
|
| 22 |
+
For a hands-on example, check out this [Colab notebook](https://colab.research.google.com/drive/1Sf7R-dqdR6gq-H8nyZ9E3ZkyvqMTqcwq?usp=sharing).
|
| 23 |
+
For more information and implementation details, visit our github repository: [DUO](https://github.com/s-sahoo/duo)
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
The model, which has a context length of `1024` and is similar in size to GPT2-medium with approximately `130 million` non-embedding parameters,
|
| 27 |
+
was trained for 1M steps on the OpenWebText corpus.
|
| 28 |
+
|
| 29 |
+
For more details, please see our paper: [The Diffusion Duality](https://huggingface.co/papers/2506.10892).
|
| 30 |
+
|
| 31 |
+
Project page: https://s-sahoo.com/duo
|
| 32 |
+
|
| 33 |
+
## Citation
|
| 34 |
+
|
| 35 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 36 |
+
Please cite our work using the bibtex below:
|
| 37 |
+
|
| 38 |
+
**BibTeX:**
|
| 39 |
+
|
| 40 |
+
```
|
| 41 |
+
@inproceedings{
|
| 42 |
+
sahoo2025the,
|
| 43 |
+
title={The Diffusion Duality},
|
| 44 |
+
author={Subham Sekhar Sahoo and Justin Deschenaux and Aaron Gokaslan and Guanghan Wang and Justin T Chiu and Volodymyr Kuleshov},
|
| 45 |
+
booktitle={Forty-second International Conference on Machine Learning},
|
| 46 |
+
year={2025},
|
| 47 |
+
url={https://openreview.net/forum?id=9P9Y8FOSOk}
|
| 48 |
+
}
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Model Card Contact
|
| 52 |
+
Subham Sekhar Sahoo (ssahoo@cs.cornell.edu)
|
checkpoints/quarantine/20260821T024817Z/official/mdlm/owt/configuration_mdlm.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""MDLM config for Hugging Face.
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import transformers
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class MDLMConfig(transformers.PretrainedConfig):
|
| 9 |
+
"""Hugging Face configuration class for MDLM."""
|
| 10 |
+
model_type = "mdlm"
|
| 11 |
+
|
| 12 |
+
def __init__(
|
| 13 |
+
self,
|
| 14 |
+
vocab_size: int = 50258,
|
| 15 |
+
model_length: int = 1024,
|
| 16 |
+
hidden_dim: int = 768,
|
| 17 |
+
cond_dim: int = 129,
|
| 18 |
+
n_blocks: int = 12,
|
| 19 |
+
n_heads: int = 12,
|
| 20 |
+
dropout: float = 0.1,
|
| 21 |
+
time_conditioning: bool = False,
|
| 22 |
+
** kwargs):
|
| 23 |
+
super().__init__(**kwargs)
|
| 24 |
+
self.vocab_size = vocab_size
|
| 25 |
+
self.model_length = model_length
|
| 26 |
+
self.hidden_dim = hidden_dim
|
| 27 |
+
self.cond_dim = cond_dim
|
| 28 |
+
self.n_blocks = n_blocks
|
| 29 |
+
self.n_heads = n_heads
|
| 30 |
+
self.dropout = dropout
|
| 31 |
+
self.time_conditioning = time_conditioning
|
checkpoints/quarantine/20260825T100201Z/official/langflow/owt/__init__.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""HuggingFace release package for LangFlow."""
|
| 2 |
+
|
| 3 |
+
from .config import LangFlowConfig
|
| 4 |
+
from .model import LangFlow
|
| 5 |
+
|
| 6 |
+
__all__ = ["LangFlowConfig", "LangFlow"]
|
checkpoints/quarantine/20260825T100215Z/official/langflow/lm1b/config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "nealchen/langflow-lm1b",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LangFlow"
|
| 5 |
+
],
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "config.LangFlowConfig",
|
| 8 |
+
"AutoModelForMaskedLM": "model.LangFlow"
|
| 9 |
+
},
|
| 10 |
+
"model_type": "LangFlow",
|
| 11 |
+
"vocab_size": 30522,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"cond_dim": 128,
|
| 14 |
+
"n_blocks": 12,
|
| 15 |
+
"n_heads": 12,
|
| 16 |
+
"dropout": 0.1,
|
| 17 |
+
"model_length": 128,
|
| 18 |
+
"use_normalized_embedding": true,
|
| 19 |
+
"embedding_norm_method": "layernorm",
|
| 20 |
+
"self_conditioning": true,
|
| 21 |
+
"use_bias": true,
|
| 22 |
+
"gumbel_loc": 4.723,
|
| 23 |
+
"gumbel_scale": 0.852,
|
| 24 |
+
"gumbel_cutoff": 1e-5,
|
| 25 |
+
"gumbel_entropy": 7.02,
|
| 26 |
+
"return_dict": true,
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
+
"transformers_version": "4.38.2"
|
| 29 |
+
}
|
checkpoints/quarantine/20260825T100308Z/official/mdlm/owt/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
datasets:
|
| 7 |
+
- Skylion007/openwebtext
|
| 8 |
+
metrics:
|
| 9 |
+
- perplexity
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
## Using MDLM
|
| 13 |
+
To use the pre-trained model for masked language modeling, use the following snippet:
|
| 14 |
+
```python
|
| 15 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 16 |
+
|
| 17 |
+
# See the `MDLM` collection page on the hub for list of available models.
|
| 18 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
| 19 |
+
model_name = 'kuleshov-group/mdlm-owt'
|
| 20 |
+
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
For more details, please see our github repository: [MDLM](https://github.com/kuleshov-group/mdlm)
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
The model, which has a context length of `1024` and is similar in size to GPT2-medium with approximately `130 million` non-embedding parameters,
|
| 27 |
+
was trained using a forward diffusion process that generates inputs varying from fully masked to fully unmasked. Its objective is to
|
| 28 |
+
reconstruct the original input from these varying levels of masking, outputting logits in the process.
|
| 29 |
+
The training regimen comprised one million steps on the OpenWebText corpus, involving the processing of a total of `33 billion` tokens.
|
| 30 |
+
|
| 31 |
+
For more details, please see our paper: [Simple and Effective Masked Diffusion Language Models](http://arxiv.org/abs/2406.07524).
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Citation
|
| 36 |
+
|
| 37 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 38 |
+
Please cite our work using the bibtex below:
|
| 39 |
+
|
| 40 |
+
**BibTeX:**
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
@inproceedings{
|
| 44 |
+
sahoo2024simple,
|
| 45 |
+
title={Simple and Effective Masked Diffusion Language Models},
|
| 46 |
+
author={Subham Sekhar Sahoo and Marianne Arriola and Aaron Gokaslan and Edgar Mariano Marroquin and Alexander M Rush and Yair Schiff and Justin T Chiu and Volodymyr Kuleshov},
|
| 47 |
+
booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
|
| 48 |
+
year={2024},
|
| 49 |
+
url={https://openreview.net/forum?id=L4uaAR4ArM}
|
| 50 |
+
}
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
**APA:**
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
@software{Sahoo_Simple_and_Effective_2024,
|
| 57 |
+
author = {Sahoo, Subham Sekhar and Arriola, Marianne and Schiff, Yair and Gokaslan, Aaron and Marroquin, Edgar and Chiu, Justin T and Rush, Alexander and Kuleshov, Volodymyr},
|
| 58 |
+
doi = {10.48550/arXiv.2406.07524},
|
| 59 |
+
month = jun,
|
| 60 |
+
title = {{Simple and Effective Masked Diffusion Language Models}},
|
| 61 |
+
version = {arXiv:2406.07524v1},
|
| 62 |
+
year = {2024}
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Model Card Contact
|
| 67 |
+
Subham Sekhar Sahoo (subbham@gmail.com)
|
checkpoints/quarantine/20260825T100308Z/official/mdlm/owt/configuration_mdlm.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""MDLM config for Hugging Face.
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import transformers
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class MDLMConfig(transformers.PretrainedConfig):
|
| 9 |
+
"""Hugging Face configuration class for MDLM."""
|
| 10 |
+
model_type = "mdlm"
|
| 11 |
+
|
| 12 |
+
def __init__(
|
| 13 |
+
self,
|
| 14 |
+
vocab_size: int = 50258,
|
| 15 |
+
model_length: int = 1024,
|
| 16 |
+
hidden_dim: int = 768,
|
| 17 |
+
cond_dim: int = 129,
|
| 18 |
+
n_blocks: int = 12,
|
| 19 |
+
n_heads: int = 12,
|
| 20 |
+
dropout: float = 0.1,
|
| 21 |
+
time_conditioning: bool = False,
|
| 22 |
+
** kwargs):
|
| 23 |
+
super().__init__(**kwargs)
|
| 24 |
+
self.vocab_size = vocab_size
|
| 25 |
+
self.model_length = model_length
|
| 26 |
+
self.hidden_dim = hidden_dim
|
| 27 |
+
self.cond_dim = cond_dim
|
| 28 |
+
self.n_blocks = n_blocks
|
| 29 |
+
self.n_heads = n_heads
|
| 30 |
+
self.dropout = dropout
|
| 31 |
+
self.time_conditioning = time_conditioning
|
checkpoints/reference_reproduction/mdlm_di4c/lm1b/stdout.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/config.yaml
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mode: train
|
| 2 |
+
time_conditioning: false
|
| 3 |
+
T: 1024
|
| 4 |
+
compile: false
|
| 5 |
+
eval_every: 5000000
|
| 6 |
+
is_di4c: true
|
| 7 |
+
is_teacher_di4c: false
|
| 8 |
+
latent_bsize: 16
|
| 9 |
+
alpha_t: sigmoid
|
| 10 |
+
alpha_const: 0.1
|
| 11 |
+
distil_delta: 0.02
|
| 12 |
+
log_unif: false
|
| 13 |
+
round: 7
|
| 14 |
+
data_preprocess:
|
| 15 |
+
data_cache: /home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b
|
| 16 |
+
min_seq_len: -1
|
| 17 |
+
seq_len: 128
|
| 18 |
+
group_text: true
|
| 19 |
+
remove_text: true
|
| 20 |
+
num_seqs: -1
|
| 21 |
+
add_bos: false
|
| 22 |
+
add_eos: true
|
| 23 |
+
legacy_start_end_bos: true
|
| 24 |
+
loader:
|
| 25 |
+
global_batch_size: 2
|
| 26 |
+
eval_global_batch_size: 2
|
| 27 |
+
batch_size: 1
|
| 28 |
+
eval_batch_size: 1
|
| 29 |
+
num_workers: ${eval:"len(__import__('os').sched_getaffinity(0))"}
|
| 30 |
+
pin_memory: true
|
| 31 |
+
persistent_workers: true
|
| 32 |
+
training:
|
| 33 |
+
ema: 0.9999
|
| 34 |
+
antithetic_sampling: true
|
| 35 |
+
importance_sampling: false
|
| 36 |
+
sampling_eps: 1.0e-05
|
| 37 |
+
change_of_variables: false
|
| 38 |
+
tokenizer:
|
| 39 |
+
name: /home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594
|
| 40 |
+
optim:
|
| 41 |
+
name: adamw
|
| 42 |
+
weight_decay: 0.0
|
| 43 |
+
lr: 3.0e-05
|
| 44 |
+
beta1: 0.9
|
| 45 |
+
beta2: 0.999
|
| 46 |
+
eps: 1.0e-08
|
| 47 |
+
trainer:
|
| 48 |
+
_target_: lightning.Trainer
|
| 49 |
+
accelerator: cuda
|
| 50 |
+
num_nodes: 1
|
| 51 |
+
devices: 1
|
| 52 |
+
accumulate_grad_batches: 2
|
| 53 |
+
gradient_clip_val: 1.0
|
| 54 |
+
precision: bf16-mixed
|
| 55 |
+
num_sanity_val_steps: 0
|
| 56 |
+
max_steps: 20000
|
| 57 |
+
log_every_n_steps: 10
|
| 58 |
+
limit_train_batches: 1.0
|
| 59 |
+
limit_val_batches: 1.0
|
| 60 |
+
val_check_interval: ${eval:${trainer.accumulate_grad_batches} * ${eval_every}}
|
| 61 |
+
check_val_every_n_epoch: null
|
| 62 |
+
benchmark: true
|
| 63 |
+
wandb: null
|
| 64 |
+
checkpointing:
|
| 65 |
+
save_dir: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 66 |
+
resume_from_ckpt: true
|
| 67 |
+
resume_ckpt_path: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt
|
| 68 |
+
eval:
|
| 69 |
+
valid:
|
| 70 |
+
n_samples: 16
|
| 71 |
+
num_steps: 128
|
| 72 |
+
ppl_with_ar:
|
| 73 |
+
run: true
|
| 74 |
+
model: gpt2-large
|
| 75 |
+
batch_size: 8
|
| 76 |
+
cond_ppl:
|
| 77 |
+
run: true
|
| 78 |
+
model: gpt2-large
|
| 79 |
+
batch_size: 8
|
| 80 |
+
mauve:
|
| 81 |
+
run: false
|
| 82 |
+
num_rounds: 5
|
| 83 |
+
max_num_tokens: 100
|
| 84 |
+
batch_size: 8
|
| 85 |
+
scaling_factor: 5
|
| 86 |
+
lambada_openai:
|
| 87 |
+
run: false
|
| 88 |
+
batch_size: 32
|
| 89 |
+
num_samples: 32
|
| 90 |
+
from_ema: false
|
| 91 |
+
add_bos: true
|
| 92 |
+
add_eos: true
|
| 93 |
+
callbacks:
|
| 94 |
+
checkpoint_every_n_steps:
|
| 95 |
+
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
| 96 |
+
save_top_k: -1
|
| 97 |
+
save_last: true
|
| 98 |
+
dirpath: ${checkpointing.save_dir}/checkpoints
|
| 99 |
+
verbose: true
|
| 100 |
+
auto_insert_metric_name: false
|
| 101 |
+
every_n_train_steps: 10000
|
| 102 |
+
learning_rate_monitor:
|
| 103 |
+
_target_: lightning.pytorch.callbacks.LearningRateMonitor
|
| 104 |
+
logging_interval: step
|
| 105 |
+
text_throughput:
|
| 106 |
+
_target_: callbacks.text_throughput.TextThroughputMonitor
|
| 107 |
+
grad_norm:
|
| 108 |
+
_target_: callbacks.gradient_norm.GradNormCallback
|
| 109 |
+
data:
|
| 110 |
+
train: lm1b
|
| 111 |
+
valid: lm1b
|
| 112 |
+
test: openwebtext-test
|
| 113 |
+
tokenizer_name_or_path: gpt2
|
| 114 |
+
wrap: true
|
| 115 |
+
streaming: false
|
| 116 |
+
model:
|
| 117 |
+
name: small
|
| 118 |
+
type: ddit-orig
|
| 119 |
+
hidden_size: 768
|
| 120 |
+
cond_dim: 128
|
| 121 |
+
length: 128
|
| 122 |
+
n_blocks: 12
|
| 123 |
+
n_heads: 12
|
| 124 |
+
scale_by_sigma: true
|
| 125 |
+
dropout: 0.1
|
| 126 |
+
tie_word_embeddings: false
|
| 127 |
+
strategy:
|
| 128 |
+
_target_: lightning.pytorch.strategies.DDPStrategy
|
| 129 |
+
find_unused_parameters: true
|
| 130 |
+
noise:
|
| 131 |
+
type: loglinear
|
| 132 |
+
sigma_min: 0.0001
|
| 133 |
+
sigma_max: 20
|
| 134 |
+
lr_scheduler:
|
| 135 |
+
_target_: transformers.get_constant_schedule_with_warmup
|
| 136 |
+
num_warmup_steps: 2500
|
| 137 |
+
parameterization:
|
| 138 |
+
name: multi-round-sdtt
|
| 139 |
+
log_loss_buckets: -1
|
| 140 |
+
checkpoint_path: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt
|
| 141 |
+
start_from_hf: false
|
| 142 |
+
distill_mode: kl-bwd
|
| 143 |
+
num_distill_steps: 2
|
| 144 |
+
min_num_sampling_steps: 8
|
| 145 |
+
grow_dt_every: 10000
|
| 146 |
+
orig_num_sampling_steps: 1024
|
| 147 |
+
sampling_mode: ancestral
|
| 148 |
+
loss_precision: null
|
| 149 |
+
reset_optimizer_on_growth: false
|
| 150 |
+
use_ema_on_growth: false
|
| 151 |
+
sampling:
|
| 152 |
+
uncond:
|
| 153 |
+
run: true
|
| 154 |
+
num_samples: 1024
|
| 155 |
+
batch_size: 16
|
| 156 |
+
from_ema: false
|
| 157 |
+
num_steps: 16
|
| 158 |
+
seq_len: 1024
|
| 159 |
+
sampler: ancestral
|
| 160 |
+
cache_preds: false
|
| 161 |
+
add_bos: false
|
| 162 |
+
add_eos: false
|
| 163 |
+
cond_prefix:
|
| 164 |
+
run: true
|
| 165 |
+
num_samples: 256
|
| 166 |
+
batch_size: 16
|
| 167 |
+
from_ema: false
|
| 168 |
+
dataset: webtext
|
| 169 |
+
seq_len: 100
|
| 170 |
+
prefix_len: 50
|
| 171 |
+
num_cont_per_prefix: 5
|
| 172 |
+
min_seq_len: 1024
|
| 173 |
+
num_steps: 128
|
| 174 |
+
sampler: ancestral
|
| 175 |
+
cache_preds: false
|
| 176 |
+
add_bos: false
|
| 177 |
+
add_eos: false
|
| 178 |
+
calc_sbleu: true
|
| 179 |
+
seed: 42
|
| 180 |
+
dlb_student_init: teacher
|
results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/recipe.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"algorithm": "di4c",
|
| 3 |
+
"checkpoint_every": 10000,
|
| 4 |
+
"dataset": "lm1b",
|
| 5 |
+
"default_per_device_batch_size": 1,
|
| 6 |
+
"distillation_loss": "dimensional_correlations",
|
| 7 |
+
"entrypoint": "../../adapters/train_di4c.py",
|
| 8 |
+
"evidence": "paper_appendix_d",
|
| 9 |
+
"global_batch_size": 2,
|
| 10 |
+
"learning_rate": 3e-05,
|
| 11 |
+
"learning_rate_override": "optim.lr",
|
| 12 |
+
"max_steps": 20000,
|
| 13 |
+
"max_steps_override": "trainer.max_steps",
|
| 14 |
+
"model": "duo_di4c",
|
| 15 |
+
"optimizer": "adam",
|
| 16 |
+
"output_override": "checkpointing.save_dir",
|
| 17 |
+
"precision": "bf16",
|
| 18 |
+
"release_evidence": null,
|
| 19 |
+
"release_script_max_steps": null,
|
| 20 |
+
"rounds": null,
|
| 21 |
+
"sampling_step": 20000,
|
| 22 |
+
"sequence_length": 128,
|
| 23 |
+
"source": "di4c",
|
| 24 |
+
"source_commit": "ac61ff9fe8e85120f9e1d2a8c5a332f8b8353dd3",
|
| 25 |
+
"source_path": "upstreams/di4c",
|
| 26 |
+
"steps_per_round": null,
|
| 27 |
+
"teacher_adapter": "uniform_to_absorbing",
|
| 28 |
+
"teacher_family": "uniform_duo",
|
| 29 |
+
"warmup_steps": 2500
|
| 30 |
+
}
|
results/_archive/rerun_di4c_gpu4_20260825_110721/checkpoints/reference_reproduction/duo_di4c/lm1b/stderr.log
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/opt/anaconda3/envs/dlb-di4c/lib/python3.10/site-packages/lightning/fabric/__init__.py:41: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
|
| 2 |
+
Seed set to 42
|
| 3 |
+
2026-08-25 10:57:51.062 | INFO | sdtt.main:di4c_train:77 - Starting training
|
| 4 |
+
2026-08-25 10:57:51.063 | INFO | sdtt.main:di4c_train:104 - Training starting from scratch (no checkpoint to reload)
|
| 5 |
+
Error executing job with overrides: ['mode=train', 'data.train=lm1b', 'data.valid=lm1b', 'tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594', 'data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b', 'data_preprocess.seq_len=128', 'data_preprocess.group_text=true', 'data_preprocess.remove_text=true', 'data_preprocess.add_bos=false', 'data_preprocess.add_eos=true', 'data_preprocess.legacy_start_end_bos=true', 'model=dit-orig-small', 'model.length=128', 'parameterization=multi-round-sdtt', 'parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt', 'parameterization.start_from_hf=false', 'parameterization.grow_dt_every=10000', 'parameterization.orig_num_sampling_steps=1024', 'loader.global_batch_size=2', 'loader.eval_global_batch_size=2', 'loader.batch_size=1', 'loader.eval_batch_size=1', 'trainer.devices=1', 'trainer.num_nodes=1', 'trainer.accumulate_grad_batches=2', 'trainer.max_steps=20000', 'trainer.precision=bf16-mixed', 'optim.lr=3e-05', 'lr_scheduler.num_warmup_steps=2500', 'callbacks.checkpoint_every_n_steps.every_n_train_steps=10000', 'checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b', 'checkpointing.resume_from_ckpt=true', 'checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt', 'wandb=null', '+seed=42', 'is_di4c=true', 'is_teacher_di4c=false', 'T=1024', 'latent_bsize=16', 'round=7', '+dlb_student_init=teacher']
|
| 6 |
+
Error locating target 'callbacks.text_throughput.TextThroughputMonitor', set env var HYDRA_FULL_ERROR=1 to see chained exception.
|
| 7 |
+
full_key: callbacks.text_throughput
|
| 8 |
+
|
| 9 |
+
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/config.yaml
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mode: train
|
| 2 |
+
time_conditioning: false
|
| 3 |
+
T: 1024
|
| 4 |
+
compile: false
|
| 5 |
+
eval_every: 5000000
|
| 6 |
+
is_di4c: true
|
| 7 |
+
is_teacher_di4c: false
|
| 8 |
+
latent_bsize: 16
|
| 9 |
+
alpha_t: sigmoid
|
| 10 |
+
alpha_const: 0.1
|
| 11 |
+
distil_delta: 0.02
|
| 12 |
+
log_unif: false
|
| 13 |
+
round: 7
|
| 14 |
+
data_preprocess:
|
| 15 |
+
data_cache: /home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b
|
| 16 |
+
min_seq_len: -1
|
| 17 |
+
seq_len: 128
|
| 18 |
+
group_text: true
|
| 19 |
+
remove_text: true
|
| 20 |
+
num_seqs: -1
|
| 21 |
+
add_bos: false
|
| 22 |
+
add_eos: true
|
| 23 |
+
legacy_start_end_bos: true
|
| 24 |
+
loader:
|
| 25 |
+
global_batch_size: 2
|
| 26 |
+
eval_global_batch_size: 2
|
| 27 |
+
batch_size: 1
|
| 28 |
+
eval_batch_size: 1
|
| 29 |
+
num_workers: ${eval:"len(__import__('os').sched_getaffinity(0))"}
|
| 30 |
+
pin_memory: true
|
| 31 |
+
persistent_workers: true
|
| 32 |
+
training:
|
| 33 |
+
ema: 0.9999
|
| 34 |
+
antithetic_sampling: true
|
| 35 |
+
importance_sampling: false
|
| 36 |
+
sampling_eps: 1.0e-05
|
| 37 |
+
change_of_variables: false
|
| 38 |
+
tokenizer:
|
| 39 |
+
name: /home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594
|
| 40 |
+
optim:
|
| 41 |
+
name: adamw
|
| 42 |
+
weight_decay: 0.0
|
| 43 |
+
lr: 3.0e-05
|
| 44 |
+
beta1: 0.9
|
| 45 |
+
beta2: 0.999
|
| 46 |
+
eps: 1.0e-08
|
| 47 |
+
trainer:
|
| 48 |
+
_target_: lightning.Trainer
|
| 49 |
+
accelerator: cuda
|
| 50 |
+
num_nodes: 1
|
| 51 |
+
devices: 1
|
| 52 |
+
accumulate_grad_batches: 2
|
| 53 |
+
gradient_clip_val: 1.0
|
| 54 |
+
precision: bf16-mixed
|
| 55 |
+
num_sanity_val_steps: 0
|
| 56 |
+
max_steps: 20000
|
| 57 |
+
log_every_n_steps: 10
|
| 58 |
+
limit_train_batches: 1.0
|
| 59 |
+
limit_val_batches: 1.0
|
| 60 |
+
val_check_interval: ${eval:${trainer.accumulate_grad_batches} * ${eval_every}}
|
| 61 |
+
check_val_every_n_epoch: null
|
| 62 |
+
benchmark: true
|
| 63 |
+
wandb: null
|
| 64 |
+
checkpointing:
|
| 65 |
+
save_dir: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 66 |
+
resume_from_ckpt: true
|
| 67 |
+
resume_ckpt_path: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt
|
| 68 |
+
eval:
|
| 69 |
+
valid:
|
| 70 |
+
n_samples: 16
|
| 71 |
+
num_steps: 128
|
| 72 |
+
ppl_with_ar:
|
| 73 |
+
run: true
|
| 74 |
+
model: gpt2-large
|
| 75 |
+
batch_size: 8
|
| 76 |
+
cond_ppl:
|
| 77 |
+
run: true
|
| 78 |
+
model: gpt2-large
|
| 79 |
+
batch_size: 8
|
| 80 |
+
mauve:
|
| 81 |
+
run: false
|
| 82 |
+
num_rounds: 5
|
| 83 |
+
max_num_tokens: 100
|
| 84 |
+
batch_size: 8
|
| 85 |
+
scaling_factor: 5
|
| 86 |
+
lambada_openai:
|
| 87 |
+
run: false
|
| 88 |
+
batch_size: 32
|
| 89 |
+
num_samples: 32
|
| 90 |
+
from_ema: false
|
| 91 |
+
add_bos: true
|
| 92 |
+
add_eos: true
|
| 93 |
+
callbacks:
|
| 94 |
+
checkpoint_every_n_steps:
|
| 95 |
+
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
| 96 |
+
save_top_k: -1
|
| 97 |
+
save_last: true
|
| 98 |
+
dirpath: ${checkpointing.save_dir}/checkpoints
|
| 99 |
+
verbose: true
|
| 100 |
+
auto_insert_metric_name: false
|
| 101 |
+
every_n_train_steps: 10000
|
| 102 |
+
learning_rate_monitor:
|
| 103 |
+
_target_: lightning.pytorch.callbacks.LearningRateMonitor
|
| 104 |
+
logging_interval: step
|
| 105 |
+
text_throughput:
|
| 106 |
+
_target_: callbacks.text_throughput.TextThroughputMonitor
|
| 107 |
+
grad_norm:
|
| 108 |
+
_target_: callbacks.gradient_norm.GradNormCallback
|
| 109 |
+
data:
|
| 110 |
+
train: lm1b
|
| 111 |
+
valid: lm1b
|
| 112 |
+
test: openwebtext-test
|
| 113 |
+
tokenizer_name_or_path: gpt2
|
| 114 |
+
wrap: true
|
| 115 |
+
streaming: false
|
| 116 |
+
model:
|
| 117 |
+
name: small
|
| 118 |
+
type: ddit-orig
|
| 119 |
+
hidden_size: 768
|
| 120 |
+
cond_dim: 128
|
| 121 |
+
length: 128
|
| 122 |
+
n_blocks: 12
|
| 123 |
+
n_heads: 12
|
| 124 |
+
scale_by_sigma: true
|
| 125 |
+
dropout: 0.1
|
| 126 |
+
tie_word_embeddings: false
|
| 127 |
+
strategy:
|
| 128 |
+
_target_: lightning.pytorch.strategies.DDPStrategy
|
| 129 |
+
find_unused_parameters: true
|
| 130 |
+
noise:
|
| 131 |
+
type: loglinear
|
| 132 |
+
sigma_min: 0.0001
|
| 133 |
+
sigma_max: 20
|
| 134 |
+
lr_scheduler:
|
| 135 |
+
_target_: transformers.get_constant_schedule_with_warmup
|
| 136 |
+
num_warmup_steps: 2500
|
| 137 |
+
parameterization:
|
| 138 |
+
name: multi-round-sdtt
|
| 139 |
+
log_loss_buckets: -1
|
| 140 |
+
checkpoint_path: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt
|
| 141 |
+
start_from_hf: false
|
| 142 |
+
distill_mode: kl-bwd
|
| 143 |
+
num_distill_steps: 2
|
| 144 |
+
min_num_sampling_steps: 8
|
| 145 |
+
grow_dt_every: 10000
|
| 146 |
+
orig_num_sampling_steps: 1024
|
| 147 |
+
sampling_mode: ancestral
|
| 148 |
+
loss_precision: null
|
| 149 |
+
reset_optimizer_on_growth: false
|
| 150 |
+
use_ema_on_growth: false
|
| 151 |
+
sampling:
|
| 152 |
+
uncond:
|
| 153 |
+
run: true
|
| 154 |
+
num_samples: 1024
|
| 155 |
+
batch_size: 16
|
| 156 |
+
from_ema: false
|
| 157 |
+
num_steps: 16
|
| 158 |
+
seq_len: 1024
|
| 159 |
+
sampler: ancestral
|
| 160 |
+
cache_preds: false
|
| 161 |
+
add_bos: false
|
| 162 |
+
add_eos: false
|
| 163 |
+
cond_prefix:
|
| 164 |
+
run: true
|
| 165 |
+
num_samples: 256
|
| 166 |
+
batch_size: 16
|
| 167 |
+
from_ema: false
|
| 168 |
+
dataset: webtext
|
| 169 |
+
seq_len: 100
|
| 170 |
+
prefix_len: 50
|
| 171 |
+
num_cont_per_prefix: 5
|
| 172 |
+
min_seq_len: 1024
|
| 173 |
+
num_steps: 128
|
| 174 |
+
sampler: ancestral
|
| 175 |
+
cache_preds: false
|
| 176 |
+
add_bos: false
|
| 177 |
+
add_eos: false
|
| 178 |
+
calc_sbleu: true
|
| 179 |
+
seed: 42
|
| 180 |
+
dlb_student_init: teacher
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/hydra.yaml
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
hydra:
|
| 2 |
+
run:
|
| 3 |
+
dir: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 4 |
+
sweep:
|
| 5 |
+
dir: multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
| 6 |
+
subdir: ${hydra.job.num}
|
| 7 |
+
launcher:
|
| 8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
| 9 |
+
sweeper:
|
| 10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
| 11 |
+
max_batch_size: null
|
| 12 |
+
params: null
|
| 13 |
+
help:
|
| 14 |
+
app_name: ${hydra.job.name}
|
| 15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
| 16 |
+
|
| 17 |
+
'
|
| 18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
| 19 |
+
|
| 20 |
+
Use --hydra-help to view Hydra specific help
|
| 21 |
+
|
| 22 |
+
'
|
| 23 |
+
template: '${hydra.help.header}
|
| 24 |
+
|
| 25 |
+
== Configuration groups ==
|
| 26 |
+
|
| 27 |
+
Compose your configuration from those groups (group=option)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
$APP_CONFIG_GROUPS
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
== Config ==
|
| 34 |
+
|
| 35 |
+
Override anything in the config (foo.bar=value)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
$CONFIG
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
${hydra.help.footer}
|
| 42 |
+
|
| 43 |
+
'
|
| 44 |
+
hydra_help:
|
| 45 |
+
template: 'Hydra (${hydra.runtime.version})
|
| 46 |
+
|
| 47 |
+
See https://hydra.cc for more info.
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
== Flags ==
|
| 51 |
+
|
| 52 |
+
$FLAGS_HELP
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
== Configuration groups ==
|
| 56 |
+
|
| 57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
| 58 |
+
to command line)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
$HYDRA_CONFIG_GROUPS
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
| 65 |
+
|
| 66 |
+
'
|
| 67 |
+
hydra_help: ???
|
| 68 |
+
hydra_logging:
|
| 69 |
+
version: 1
|
| 70 |
+
formatters:
|
| 71 |
+
simple:
|
| 72 |
+
format: '[%(asctime)s][HYDRA] %(message)s'
|
| 73 |
+
handlers:
|
| 74 |
+
console:
|
| 75 |
+
class: logging.StreamHandler
|
| 76 |
+
formatter: simple
|
| 77 |
+
stream: ext://sys.stdout
|
| 78 |
+
root:
|
| 79 |
+
level: INFO
|
| 80 |
+
handlers:
|
| 81 |
+
- console
|
| 82 |
+
loggers:
|
| 83 |
+
logging_example:
|
| 84 |
+
level: DEBUG
|
| 85 |
+
disable_existing_loggers: false
|
| 86 |
+
job_logging:
|
| 87 |
+
version: 1
|
| 88 |
+
formatters:
|
| 89 |
+
simple:
|
| 90 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
| 91 |
+
handlers:
|
| 92 |
+
console:
|
| 93 |
+
class: logging.StreamHandler
|
| 94 |
+
formatter: simple
|
| 95 |
+
stream: ext://sys.stdout
|
| 96 |
+
file:
|
| 97 |
+
class: logging.FileHandler
|
| 98 |
+
formatter: simple
|
| 99 |
+
filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log
|
| 100 |
+
root:
|
| 101 |
+
level: INFO
|
| 102 |
+
handlers:
|
| 103 |
+
- console
|
| 104 |
+
- file
|
| 105 |
+
disable_existing_loggers: false
|
| 106 |
+
env: {}
|
| 107 |
+
mode: RUN
|
| 108 |
+
searchpath: []
|
| 109 |
+
callbacks: {}
|
| 110 |
+
output_subdir: .hydra
|
| 111 |
+
overrides:
|
| 112 |
+
hydra:
|
| 113 |
+
- hydra.run.dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 114 |
+
- hydra.job.chdir=true
|
| 115 |
+
- hydra.mode=RUN
|
| 116 |
+
task:
|
| 117 |
+
- mode=train
|
| 118 |
+
- data.train=lm1b
|
| 119 |
+
- data.valid=lm1b
|
| 120 |
+
- tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594
|
| 121 |
+
- data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b
|
| 122 |
+
- data_preprocess.seq_len=128
|
| 123 |
+
- data_preprocess.group_text=true
|
| 124 |
+
- data_preprocess.remove_text=true
|
| 125 |
+
- data_preprocess.add_bos=false
|
| 126 |
+
- data_preprocess.add_eos=true
|
| 127 |
+
- data_preprocess.legacy_start_end_bos=true
|
| 128 |
+
- model=dit-orig-small
|
| 129 |
+
- model.length=128
|
| 130 |
+
- parameterization=multi-round-sdtt
|
| 131 |
+
- parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt
|
| 132 |
+
- parameterization.start_from_hf=false
|
| 133 |
+
- parameterization.grow_dt_every=10000
|
| 134 |
+
- parameterization.orig_num_sampling_steps=1024
|
| 135 |
+
- loader.global_batch_size=2
|
| 136 |
+
- loader.eval_global_batch_size=2
|
| 137 |
+
- loader.batch_size=1
|
| 138 |
+
- loader.eval_batch_size=1
|
| 139 |
+
- trainer.devices=1
|
| 140 |
+
- trainer.num_nodes=1
|
| 141 |
+
- trainer.accumulate_grad_batches=2
|
| 142 |
+
- trainer.max_steps=20000
|
| 143 |
+
- trainer.precision=bf16-mixed
|
| 144 |
+
- optim.lr=3e-05
|
| 145 |
+
- lr_scheduler.num_warmup_steps=2500
|
| 146 |
+
- callbacks.checkpoint_every_n_steps.every_n_train_steps=10000
|
| 147 |
+
- checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 148 |
+
- checkpointing.resume_from_ckpt=true
|
| 149 |
+
- checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt
|
| 150 |
+
- wandb=null
|
| 151 |
+
- +seed=42
|
| 152 |
+
- is_di4c=true
|
| 153 |
+
- is_teacher_di4c=false
|
| 154 |
+
- T=1024
|
| 155 |
+
- latent_bsize=16
|
| 156 |
+
- round=7
|
| 157 |
+
- +dlb_student_init=teacher
|
| 158 |
+
job:
|
| 159 |
+
name: train_di4c
|
| 160 |
+
chdir: true
|
| 161 |
+
override_dirname: +dlb_student_init=teacher,+seed=42,T=1024,callbacks.checkpoint_every_n_steps.every_n_train_steps=10000,checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt,checkpointing.resume_from_ckpt=true,checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b,data.train=lm1b,data.valid=lm1b,data_preprocess.add_bos=false,data_preprocess.add_eos=true,data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b,data_preprocess.group_text=true,data_preprocess.legacy_start_end_bos=true,data_preprocess.remove_text=true,data_preprocess.seq_len=128,is_di4c=true,is_teacher_di4c=false,latent_bsize=16,loader.batch_size=1,loader.eval_batch_size=1,loader.eval_global_batch_size=2,loader.global_batch_size=2,lr_scheduler.num_warmup_steps=2500,mode=train,model.length=128,model=dit-orig-small,optim.lr=3e-05,parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt,parameterization.grow_dt_every=10000,parameterization.orig_num_sampling_steps=1024,parameterization.start_from_hf=false,parameterization=multi-round-sdtt,round=7,tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594,trainer.accumulate_grad_batches=2,trainer.devices=1,trainer.max_steps=20000,trainer.num_nodes=1,trainer.precision=bf16-mixed,wandb=null
|
| 162 |
+
id: ???
|
| 163 |
+
num: ???
|
| 164 |
+
config_name: config
|
| 165 |
+
env_set: {}
|
| 166 |
+
env_copy: []
|
| 167 |
+
config:
|
| 168 |
+
override_dirname:
|
| 169 |
+
kv_sep: '='
|
| 170 |
+
item_sep: ','
|
| 171 |
+
exclude_keys: []
|
| 172 |
+
runtime:
|
| 173 |
+
version: 1.3.2
|
| 174 |
+
version_base: '1.3'
|
| 175 |
+
cwd: /home/ruizzhao/diffusion_baseline/upstreams/di4c
|
| 176 |
+
config_sources:
|
| 177 |
+
- path: hydra.conf
|
| 178 |
+
schema: pkg
|
| 179 |
+
provider: hydra
|
| 180 |
+
- path: /home/ruizzhao/diffusion_baseline/upstreams/di4c/sdtt/src/sdtt/configs
|
| 181 |
+
schema: file
|
| 182 |
+
provider: main
|
| 183 |
+
- path: ''
|
| 184 |
+
schema: structured
|
| 185 |
+
provider: schema
|
| 186 |
+
output_dir: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 187 |
+
choices:
|
| 188 |
+
parameterization: multi-round-sdtt
|
| 189 |
+
lr_scheduler: constant_warmup
|
| 190 |
+
noise: loglinear
|
| 191 |
+
strategy: ddp
|
| 192 |
+
model: dit-orig-small
|
| 193 |
+
data: openwebtext-split
|
| 194 |
+
hydra/env: default
|
| 195 |
+
hydra/callbacks: null
|
| 196 |
+
hydra/job_logging: default
|
| 197 |
+
hydra/hydra_logging: default
|
| 198 |
+
hydra/hydra_help: default
|
| 199 |
+
hydra/help: default
|
| 200 |
+
hydra/sweeper: basic
|
| 201 |
+
hydra/launcher: basic
|
| 202 |
+
hydra/output: default
|
| 203 |
+
verbose: false
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/.hydra/overrides.yaml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- mode=train
|
| 2 |
+
- data.train=lm1b
|
| 3 |
+
- data.valid=lm1b
|
| 4 |
+
- tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594
|
| 5 |
+
- data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b
|
| 6 |
+
- data_preprocess.seq_len=128
|
| 7 |
+
- data_preprocess.group_text=true
|
| 8 |
+
- data_preprocess.remove_text=true
|
| 9 |
+
- data_preprocess.add_bos=false
|
| 10 |
+
- data_preprocess.add_eos=true
|
| 11 |
+
- data_preprocess.legacy_start_end_bos=true
|
| 12 |
+
- model=dit-orig-small
|
| 13 |
+
- model.length=128
|
| 14 |
+
- parameterization=multi-round-sdtt
|
| 15 |
+
- parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt
|
| 16 |
+
- parameterization.start_from_hf=false
|
| 17 |
+
- parameterization.grow_dt_every=10000
|
| 18 |
+
- parameterization.orig_num_sampling_steps=1024
|
| 19 |
+
- loader.global_batch_size=2
|
| 20 |
+
- loader.eval_global_batch_size=2
|
| 21 |
+
- loader.batch_size=1
|
| 22 |
+
- loader.eval_batch_size=1
|
| 23 |
+
- trainer.devices=1
|
| 24 |
+
- trainer.num_nodes=1
|
| 25 |
+
- trainer.accumulate_grad_batches=2
|
| 26 |
+
- trainer.max_steps=20000
|
| 27 |
+
- trainer.precision=bf16-mixed
|
| 28 |
+
- optim.lr=3e-05
|
| 29 |
+
- lr_scheduler.num_warmup_steps=2500
|
| 30 |
+
- callbacks.checkpoint_every_n_steps.every_n_train_steps=10000
|
| 31 |
+
- checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b
|
| 32 |
+
- checkpointing.resume_from_ckpt=true
|
| 33 |
+
- checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt
|
| 34 |
+
- wandb=null
|
| 35 |
+
- +seed=42
|
| 36 |
+
- is_di4c=true
|
| 37 |
+
- is_teacher_di4c=false
|
| 38 |
+
- T=1024
|
| 39 |
+
- latent_bsize=16
|
| 40 |
+
- round=7
|
| 41 |
+
- +dlb_student_init=teacher
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/launch_argv.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"/opt/anaconda3/envs/dlb-di4c/bin/python",
|
| 3 |
+
"-u",
|
| 4 |
+
"/home/ruizzhao/diffusion_baseline/upstreams/di4c/../../adapters/train_di4c.py",
|
| 5 |
+
"mode=train",
|
| 6 |
+
"data.train=lm1b",
|
| 7 |
+
"data.valid=lm1b",
|
| 8 |
+
"tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594",
|
| 9 |
+
"data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b",
|
| 10 |
+
"data_preprocess.seq_len=128",
|
| 11 |
+
"data_preprocess.group_text=true",
|
| 12 |
+
"data_preprocess.remove_text=true",
|
| 13 |
+
"data_preprocess.add_bos=false",
|
| 14 |
+
"data_preprocess.add_eos=true",
|
| 15 |
+
"data_preprocess.legacy_start_end_bos=true",
|
| 16 |
+
"model=dit-orig-small",
|
| 17 |
+
"model.length=128",
|
| 18 |
+
"parameterization=multi-round-sdtt",
|
| 19 |
+
"parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt",
|
| 20 |
+
"parameterization.start_from_hf=false",
|
| 21 |
+
"parameterization.grow_dt_every=10000",
|
| 22 |
+
"parameterization.orig_num_sampling_steps=1024",
|
| 23 |
+
"loader.global_batch_size=2",
|
| 24 |
+
"loader.eval_global_batch_size=2",
|
| 25 |
+
"loader.batch_size=1",
|
| 26 |
+
"loader.eval_batch_size=1",
|
| 27 |
+
"trainer.devices=1",
|
| 28 |
+
"trainer.num_nodes=1",
|
| 29 |
+
"trainer.accumulate_grad_batches=2",
|
| 30 |
+
"trainer.max_steps=20000",
|
| 31 |
+
"trainer.precision=bf16-mixed",
|
| 32 |
+
"optim.lr=3e-05",
|
| 33 |
+
"lr_scheduler.num_warmup_steps=2500",
|
| 34 |
+
"callbacks.checkpoint_every_n_steps.every_n_train_steps=10000",
|
| 35 |
+
"checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b",
|
| 36 |
+
"checkpointing.resume_from_ckpt=true",
|
| 37 |
+
"checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt",
|
| 38 |
+
"hydra.run.dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b",
|
| 39 |
+
"hydra.job.chdir=true",
|
| 40 |
+
"wandb=null",
|
| 41 |
+
"+seed=42",
|
| 42 |
+
"is_di4c=true",
|
| 43 |
+
"is_teacher_di4c=false",
|
| 44 |
+
"T=1024",
|
| 45 |
+
"latent_bsize=16",
|
| 46 |
+
"round=7",
|
| 47 |
+
"+dlb_student_init=teacher"
|
| 48 |
+
]
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/provenance.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"command": [
|
| 3 |
+
"/opt/anaconda3/envs/dlb-di4c/bin/python",
|
| 4 |
+
"-u",
|
| 5 |
+
"/home/ruizzhao/diffusion_baseline/upstreams/di4c/../../adapters/train_di4c.py",
|
| 6 |
+
"mode=train",
|
| 7 |
+
"data.train=lm1b",
|
| 8 |
+
"data.valid=lm1b",
|
| 9 |
+
"tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594",
|
| 10 |
+
"data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b",
|
| 11 |
+
"data_preprocess.seq_len=128",
|
| 12 |
+
"data_preprocess.group_text=true",
|
| 13 |
+
"data_preprocess.remove_text=true",
|
| 14 |
+
"data_preprocess.add_bos=false",
|
| 15 |
+
"data_preprocess.add_eos=true",
|
| 16 |
+
"data_preprocess.legacy_start_end_bos=true",
|
| 17 |
+
"model=dit-orig-small",
|
| 18 |
+
"model.length=128",
|
| 19 |
+
"parameterization=multi-round-sdtt",
|
| 20 |
+
"parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt",
|
| 21 |
+
"parameterization.start_from_hf=false",
|
| 22 |
+
"parameterization.grow_dt_every=10000",
|
| 23 |
+
"parameterization.orig_num_sampling_steps=1024",
|
| 24 |
+
"loader.global_batch_size=2",
|
| 25 |
+
"loader.eval_global_batch_size=2",
|
| 26 |
+
"loader.batch_size=1",
|
| 27 |
+
"loader.eval_batch_size=1",
|
| 28 |
+
"trainer.devices=1",
|
| 29 |
+
"trainer.num_nodes=1",
|
| 30 |
+
"trainer.accumulate_grad_batches=2",
|
| 31 |
+
"trainer.max_steps=20000",
|
| 32 |
+
"trainer.precision=bf16-mixed",
|
| 33 |
+
"optim.lr=3e-05",
|
| 34 |
+
"lr_scheduler.num_warmup_steps=2500",
|
| 35 |
+
"callbacks.checkpoint_every_n_steps.every_n_train_steps=10000",
|
| 36 |
+
"checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b",
|
| 37 |
+
"checkpointing.resume_from_ckpt=true",
|
| 38 |
+
"checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt",
|
| 39 |
+
"hydra.run.dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b",
|
| 40 |
+
"hydra.job.chdir=true",
|
| 41 |
+
"wandb=null",
|
| 42 |
+
"+seed=42",
|
| 43 |
+
"is_di4c=true",
|
| 44 |
+
"is_teacher_di4c=false",
|
| 45 |
+
"T=1024",
|
| 46 |
+
"latent_bsize=16",
|
| 47 |
+
"round=7",
|
| 48 |
+
"+dlb_student_init=teacher"
|
| 49 |
+
],
|
| 50 |
+
"composed_config_sha256": "624ca67b5af09ff63ecd60efa7ff08d70ed8391b276f7ad6d3709607b4d43aa8",
|
| 51 |
+
"cwd": "/home/ruizzhao/diffusion_baseline/upstreams/di4c",
|
| 52 |
+
"data": {
|
| 53 |
+
"aliases": {
|
| 54 |
+
"lm1b_test_bs128_wrapped.dat": "/home/ruizzhao/diffusion_baseline/data/processed/lm1b-bert-128/validation",
|
| 55 |
+
"lm1b_train_bs128_wrapped.dat": "/home/ruizzhao/diffusion_baseline/data/processed/lm1b-bert-128/train"
|
| 56 |
+
},
|
| 57 |
+
"cache": "/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b",
|
| 58 |
+
"format": "hf_dataset_with_attention_mask_v1",
|
| 59 |
+
"mode": "materialized_bridge",
|
| 60 |
+
"processed_manifest_sha256": "a8465f3fba8c5dc529fc0751039c8ffa32a7710f480208779b55545cb141017c",
|
| 61 |
+
"processed_path": "/home/ruizzhao/diffusion_baseline/data/processed/lm1b-bert-128"
|
| 62 |
+
},
|
| 63 |
+
"devices": 1,
|
| 64 |
+
"effective_global_batch_size": 2,
|
| 65 |
+
"gradient_accumulation": 2,
|
| 66 |
+
"identity_sha256": "0e6b980c0ad2928f4fe7d0a431da99b5658749371a96429bd86e57bd5993ce49",
|
| 67 |
+
"nodes": 1,
|
| 68 |
+
"per_device_batch_size": 1,
|
| 69 |
+
"prepared_at": "2026-08-25T03:07:30.752620Z",
|
| 70 |
+
"recipe": {
|
| 71 |
+
"algorithm": "di4c",
|
| 72 |
+
"checkpoint_every": 10000,
|
| 73 |
+
"dataset": "lm1b",
|
| 74 |
+
"default_per_device_batch_size": 1,
|
| 75 |
+
"distillation_loss": "dimensional_correlations",
|
| 76 |
+
"entrypoint": "../../adapters/train_di4c.py",
|
| 77 |
+
"evidence": "paper_appendix_d",
|
| 78 |
+
"global_batch_size": 2,
|
| 79 |
+
"learning_rate": 3e-05,
|
| 80 |
+
"learning_rate_override": "optim.lr",
|
| 81 |
+
"max_steps": 20000,
|
| 82 |
+
"max_steps_override": "trainer.max_steps",
|
| 83 |
+
"model": "duo_di4c",
|
| 84 |
+
"optimizer": "adam",
|
| 85 |
+
"output_override": "checkpointing.save_dir",
|
| 86 |
+
"precision": "bf16",
|
| 87 |
+
"release_evidence": null,
|
| 88 |
+
"release_script_max_steps": null,
|
| 89 |
+
"rounds": null,
|
| 90 |
+
"sampling_step": 20000,
|
| 91 |
+
"sequence_length": 128,
|
| 92 |
+
"source": "di4c",
|
| 93 |
+
"source_commit": "ac61ff9fe8e85120f9e1d2a8c5a332f8b8353dd3",
|
| 94 |
+
"source_path": "upstreams/di4c",
|
| 95 |
+
"steps_per_round": null,
|
| 96 |
+
"teacher_adapter": "uniform_to_absorbing",
|
| 97 |
+
"teacher_family": "uniform_duo",
|
| 98 |
+
"warmup_steps": 2500
|
| 99 |
+
},
|
| 100 |
+
"schema_version": 1,
|
| 101 |
+
"seed": 42,
|
| 102 |
+
"source_commit": "ac61ff9fe8e85120f9e1d2a8c5a332f8b8353dd3",
|
| 103 |
+
"teacher_adaptation": {
|
| 104 |
+
"hidden_size": 768,
|
| 105 |
+
"output_path": "/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt",
|
| 106 |
+
"output_sha256": "5f34e31d2743d9851c4314f52861e5f2366bfdbea51b156a9bd102fc592f0b23",
|
| 107 |
+
"schema_version": 1,
|
| 108 |
+
"source_mask_index": null,
|
| 109 |
+
"source_path": "/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/flm_baselines/lm1b/lm1b_Duo.ckpt",
|
| 110 |
+
"source_sha256": "b11ee9a4cc533435adb9e1149cff74aec0872a9df2a459b4ab58f1867f6cddfb",
|
| 111 |
+
"source_vocab_size": 30522,
|
| 112 |
+
"state_keys_sha256": "8212d507b6931a59375f8127f0ccb9e51c24da74fe05e974648d92c5612fb803",
|
| 113 |
+
"target_mask_index": 30522,
|
| 114 |
+
"target_vocab_size": 30523,
|
| 115 |
+
"teacher_family": "uniform_duo",
|
| 116 |
+
"transformation": "uniform_to_absorbing",
|
| 117 |
+
"transformation_sha256": "656341f23524d65a7207e53a85fe06088ad7deaa15365d2ee91ac5fb6eac2cd0"
|
| 118 |
+
},
|
| 119 |
+
"teacher_sha256": "b11ee9a4cc533435adb9e1149cff74aec0872a9df2a459b4ab58f1867f6cddfb",
|
| 120 |
+
"teacher_transformation_sha256": "656341f23524d65a7207e53a85fe06088ad7deaa15365d2ee91ac5fb6eac2cd0"
|
| 121 |
+
}
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/recipe.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"algorithm": "di4c",
|
| 3 |
+
"checkpoint_every": 10000,
|
| 4 |
+
"dataset": "lm1b",
|
| 5 |
+
"default_per_device_batch_size": 1,
|
| 6 |
+
"distillation_loss": "dimensional_correlations",
|
| 7 |
+
"entrypoint": "../../adapters/train_di4c.py",
|
| 8 |
+
"evidence": "paper_appendix_d",
|
| 9 |
+
"global_batch_size": 2,
|
| 10 |
+
"learning_rate": 3e-05,
|
| 11 |
+
"learning_rate_override": "optim.lr",
|
| 12 |
+
"max_steps": 20000,
|
| 13 |
+
"max_steps_override": "trainer.max_steps",
|
| 14 |
+
"model": "duo_di4c",
|
| 15 |
+
"optimizer": "adam",
|
| 16 |
+
"output_override": "checkpointing.save_dir",
|
| 17 |
+
"precision": "bf16",
|
| 18 |
+
"release_evidence": null,
|
| 19 |
+
"release_script_max_steps": null,
|
| 20 |
+
"rounds": null,
|
| 21 |
+
"sampling_step": 20000,
|
| 22 |
+
"sequence_length": 128,
|
| 23 |
+
"source": "di4c",
|
| 24 |
+
"source_commit": "ac61ff9fe8e85120f9e1d2a8c5a332f8b8353dd3",
|
| 25 |
+
"source_path": "upstreams/di4c",
|
| 26 |
+
"steps_per_round": null,
|
| 27 |
+
"teacher_adapter": "uniform_to_absorbing",
|
| 28 |
+
"teacher_family": "uniform_duo",
|
| 29 |
+
"warmup_steps": 2500
|
| 30 |
+
}
|
results/_archive/rerun_di4c_gpu4_gpu7_20260825_111320/checkpoints/reference_reproduction/duo_di4c/lm1b/stderr.log
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/opt/anaconda3/envs/dlb-di4c/lib/python3.10/site-packages/lightning/fabric/__init__.py:41: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
|
| 2 |
+
Seed set to 42
|
| 3 |
+
2026-08-25 11:07:33.667 | INFO | sdtt.main:di4c_train:77 - Starting training
|
| 4 |
+
2026-08-25 11:07:33.667 | INFO | sdtt.main:di4c_train:104 - Training starting from scratch (no checkpoint to reload)
|
| 5 |
+
Error executing job with overrides: ['mode=train', 'data.train=lm1b', 'data.valid=lm1b', 'tokenizer.name=/home/ruizzhao/diffusion_baseline/data/raw/huggingface/hub/models--bert-base-uncased/snapshots/86b5e0934494bd15c9632b12f734a8a67f723594', 'data_preprocess.data_cache=/home/ruizzhao/diffusion_baseline/data/training_cache/di4c/lm1b', 'data_preprocess.seq_len=128', 'data_preprocess.group_text=true', 'data_preprocess.remove_text=true', 'data_preprocess.add_bos=false', 'data_preprocess.add_eos=true', 'data_preprocess.legacy_start_end_bos=true', 'model=dit-orig-small', 'model.length=128', 'parameterization=multi-round-sdtt', 'parameterization.checkpoint_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/inputs/teacher_adapted.ckpt', 'parameterization.start_from_hf=false', 'parameterization.grow_dt_every=10000', 'parameterization.orig_num_sampling_steps=1024', 'loader.global_batch_size=2', 'loader.eval_global_batch_size=2', 'loader.batch_size=1', 'loader.eval_batch_size=1', 'trainer.devices=1', 'trainer.num_nodes=1', 'trainer.accumulate_grad_batches=2', 'trainer.max_steps=20000', 'trainer.precision=bf16-mixed', 'optim.lr=3e-05', 'lr_scheduler.num_warmup_steps=2500', 'callbacks.checkpoint_every_n_steps.every_n_train_steps=10000', 'checkpointing.save_dir=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b', 'checkpointing.resume_from_ckpt=true', 'checkpointing.resume_ckpt_path=/home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/duo_di4c/lm1b/checkpoints/last.ckpt', 'wandb=null', '+seed=42', 'is_di4c=true', 'is_teacher_di4c=false', 'T=1024', 'latent_bsize=16', 'round=7', '+dlb_student_init=teacher']
|
| 6 |
+
Error locating target 'callbacks.text_throughput.TextThroughputMonitor', set env var HYDRA_FULL_ERROR=1 to see chained exception.
|
| 7 |
+
full_key: callbacks.text_throughput
|
| 8 |
+
|
| 9 |
+
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
|
results/conditional/metrics/lm1b/flm/steps_32/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 12.092915980161044,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 604250.9274902344,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 242416
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.0040720962619612555,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 2.0806292940402793,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -1.7365233051707354,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.639138127621003,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/flm/steps_32/samples.jsonl",
|
| 93 |
+
"samples_sha256": "82fa5f29b341c7ac071fd01cda78655310c334db743bb29a66f39deb731a34fb",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/flm/steps_8/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 6.00491602998456,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 551520.8259277344,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 307669
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.004179943930085514,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 1.8097444920868058,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -2.007408107124209,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.7593250173826942,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/flm/steps_8/samples.jsonl",
|
| 93 |
+
"samples_sha256": "f1128565f9be8e1b69c582877077a47ccfcfd5cd2241f885a716a5b812bd0ee7",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/fmlm/steps_32/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 81.08235208356075,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 658286.865234375,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 149765
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.025989271366052474,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.8008536082446445,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -0.01629899096637022,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.17032629629472096,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/fmlm/steps_32/samples.jsonl",
|
| 93 |
+
"samples_sha256": "5b7c05246e7f956179076ca9c842a1b14dc6734fd0bba053d5bd8d2128559e1c",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/langflow/steps_4/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 569.9517649484868,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 970647.3210449219,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 152965
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.01892402088384132,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.907618551504129,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": 0.09046595229311416,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.11599839640750607,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/langflow/steps_4/samples.jsonl",
|
| 93 |
+
"samples_sha256": "74fc4835733484a412b590f93d247262b657944ee3b85913a2fb0654cc874835",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/mdlm/steps_4/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 262.1196216839746,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 851876.1909179688,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 152973
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.050296948084236015,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.8223798230691886,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": 0.005227223858173868,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.13613229516483286,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/mdlm/steps_4/samples.jsonl",
|
| 93 |
+
"samples_sha256": "38162e6cad3600adda55df745f1d3bbb893fdaf0230284bb399a243d6d387561",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/mdlm_di4c/steps_4/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 231.35695695454112,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 838576.9855957031,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 154038
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.04114998801809082,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.8168931947858034,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131072,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -0.0002594044252113292,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.14171407583638762,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/mdlm_di4c/steps_4/samples.jsonl",
|
| 93 |
+
"samples_sha256": "3c3a6b94097f30264741bd498d0c2abfe9176dd46a30bf6bf27468f9628bdea7",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/rdlm/steps_1000/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 74.46873867971514,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 1168293.859375,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 271042
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.004072096261961257,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.2166159032733264,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131060,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -0.6005366959376883,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.4135529952805669,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/rdlm/steps_1000/samples.jsonl",
|
| 93 |
+
"samples_sha256": "72f973a27104f0523172262ab03479eb8b43158d25bcba5e5014273472ee747f",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/lm1b/rdlm/steps_1024/metrics.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "lm1b",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 72.79489092633567,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 1164507.44140625,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 271596
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.004101477293041155,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"logarithm": "natural",
|
| 44 |
+
"mean_entropy": 3.2101816164235553,
|
| 45 |
+
"sample_count": 2048,
|
| 46 |
+
"token_count": 131054,
|
| 47 |
+
"unit": "nats"
|
| 48 |
+
},
|
| 49 |
+
"generated_minus_reference": -0.6069709827874594,
|
| 50 |
+
"reference": {
|
| 51 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 52 |
+
"excluded_token_ids": [
|
| 53 |
+
0
|
| 54 |
+
],
|
| 55 |
+
"logarithm": "natural",
|
| 56 |
+
"mean_entropy": 3.8171525992110147,
|
| 57 |
+
"sample_count": 2048,
|
| 58 |
+
"token_count": 131072,
|
| 59 |
+
"unit": "nats"
|
| 60 |
+
},
|
| 61 |
+
"slice": "source_tokens_64_128_only"
|
| 62 |
+
},
|
| 63 |
+
"self_bleu": {
|
| 64 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 65 |
+
"completions_per_prompt": 5,
|
| 66 |
+
"ngram_order": 4,
|
| 67 |
+
"prompt_count": 256,
|
| 68 |
+
"sample_count": 1280,
|
| 69 |
+
"score": 0.41466255743446645,
|
| 70 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 71 |
+
"smoothing": "chen_cherry_method1",
|
| 72 |
+
"tokenization": "gpt2",
|
| 73 |
+
"weights": [
|
| 74 |
+
0.25,
|
| 75 |
+
0.25,
|
| 76 |
+
0.25,
|
| 77 |
+
0.25
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"prefix_length": 64,
|
| 82 |
+
"production_sample_count": 2048,
|
| 83 |
+
"protocol": "c64_zs_v1",
|
| 84 |
+
"requested_metrics": [
|
| 85 |
+
"conditional_gen_ppl",
|
| 86 |
+
"mauve_suffix",
|
| 87 |
+
"entropy",
|
| 88 |
+
"self_bleu",
|
| 89 |
+
"prefix_exact_match"
|
| 90 |
+
],
|
| 91 |
+
"sample_count": 2048,
|
| 92 |
+
"samples": "results/conditional/samples/lm1b/rdlm/steps_1024/samples.jsonl",
|
| 93 |
+
"samples_sha256": "dbb1b012c081d0613cc261ec5e156466ad70c9a24a952fb52360030280ba0895",
|
| 94 |
+
"schema_version": 1
|
| 95 |
+
}
|
results/conditional/metrics/owt/duo/steps_1/metrics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "owt",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 7616.547531539351,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 1155425.4033203125,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 129270
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.008434743053070988,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [],
|
| 41 |
+
"logarithm": "natural",
|
| 42 |
+
"mean_entropy": 3.855010164512828,
|
| 43 |
+
"sample_count": 2048,
|
| 44 |
+
"token_count": 131072,
|
| 45 |
+
"unit": "nats"
|
| 46 |
+
},
|
| 47 |
+
"generated_minus_reference": 0.04596160616690437,
|
| 48 |
+
"reference": {
|
| 49 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 50 |
+
"excluded_token_ids": [],
|
| 51 |
+
"logarithm": "natural",
|
| 52 |
+
"mean_entropy": 3.8090485583459235,
|
| 53 |
+
"sample_count": 2048,
|
| 54 |
+
"token_count": 131072,
|
| 55 |
+
"unit": "nats"
|
| 56 |
+
},
|
| 57 |
+
"slice": "source_tokens_64_128_only"
|
| 58 |
+
},
|
| 59 |
+
"self_bleu": {
|
| 60 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 61 |
+
"completions_per_prompt": 5,
|
| 62 |
+
"ngram_order": 4,
|
| 63 |
+
"prompt_count": 256,
|
| 64 |
+
"sample_count": 1280,
|
| 65 |
+
"score": 0.010727700253949337,
|
| 66 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 67 |
+
"smoothing": "chen_cherry_method1",
|
| 68 |
+
"tokenization": "gpt2",
|
| 69 |
+
"weights": [
|
| 70 |
+
0.25,
|
| 71 |
+
0.25,
|
| 72 |
+
0.25,
|
| 73 |
+
0.25
|
| 74 |
+
]
|
| 75 |
+
}
|
| 76 |
+
},
|
| 77 |
+
"prefix_length": 64,
|
| 78 |
+
"production_sample_count": 2048,
|
| 79 |
+
"protocol": "c64_zs_v1",
|
| 80 |
+
"requested_metrics": [
|
| 81 |
+
"conditional_gen_ppl",
|
| 82 |
+
"mauve_suffix",
|
| 83 |
+
"entropy",
|
| 84 |
+
"self_bleu",
|
| 85 |
+
"prefix_exact_match"
|
| 86 |
+
],
|
| 87 |
+
"sample_count": 2048,
|
| 88 |
+
"samples": "results/conditional/samples/owt/duo/steps_1/samples.jsonl",
|
| 89 |
+
"samples_sha256": "b1b04b977d413194f0bbbc3a4afc49ec7c2abf8e79cebe9ff9b00a0d064c2790",
|
| 90 |
+
"schema_version": 1
|
| 91 |
+
}
|
results/conditional/metrics/owt/duo/steps_2/metrics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "owt",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 1914.3004755774546,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 978290.2434082031,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 129453
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.017357582303251212,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [],
|
| 41 |
+
"logarithm": "natural",
|
| 42 |
+
"mean_entropy": 3.7864361846859653,
|
| 43 |
+
"sample_count": 2048,
|
| 44 |
+
"token_count": 131072,
|
| 45 |
+
"unit": "nats"
|
| 46 |
+
},
|
| 47 |
+
"generated_minus_reference": -0.022612373659958163,
|
| 48 |
+
"reference": {
|
| 49 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 50 |
+
"excluded_token_ids": [],
|
| 51 |
+
"logarithm": "natural",
|
| 52 |
+
"mean_entropy": 3.8090485583459235,
|
| 53 |
+
"sample_count": 2048,
|
| 54 |
+
"token_count": 131072,
|
| 55 |
+
"unit": "nats"
|
| 56 |
+
},
|
| 57 |
+
"slice": "source_tokens_64_128_only"
|
| 58 |
+
},
|
| 59 |
+
"self_bleu": {
|
| 60 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 61 |
+
"completions_per_prompt": 5,
|
| 62 |
+
"ngram_order": 4,
|
| 63 |
+
"prompt_count": 256,
|
| 64 |
+
"sample_count": 1280,
|
| 65 |
+
"score": 0.016527312143610067,
|
| 66 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 67 |
+
"smoothing": "chen_cherry_method1",
|
| 68 |
+
"tokenization": "gpt2",
|
| 69 |
+
"weights": [
|
| 70 |
+
0.25,
|
| 71 |
+
0.25,
|
| 72 |
+
0.25,
|
| 73 |
+
0.25
|
| 74 |
+
]
|
| 75 |
+
}
|
| 76 |
+
},
|
| 77 |
+
"prefix_length": 64,
|
| 78 |
+
"production_sample_count": 2048,
|
| 79 |
+
"protocol": "c64_zs_v1",
|
| 80 |
+
"requested_metrics": [
|
| 81 |
+
"conditional_gen_ppl",
|
| 82 |
+
"mauve_suffix",
|
| 83 |
+
"entropy",
|
| 84 |
+
"self_bleu",
|
| 85 |
+
"prefix_exact_match"
|
| 86 |
+
],
|
| 87 |
+
"sample_count": 2048,
|
| 88 |
+
"samples": "results/conditional/samples/owt/duo/steps_2/samples.jsonl",
|
| 89 |
+
"samples_sha256": "045cfd273537a749f872b6554ef12ecec9ee1d11d2ae9911a49dfca4588308cb",
|
| 90 |
+
"schema_version": 1
|
| 91 |
+
}
|
results/conditional/metrics/owt/flm/steps_2/metrics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "owt",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 731.4167663283406,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 809230.8466796875,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 122704
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.007053562744428921,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [],
|
| 41 |
+
"logarithm": "natural",
|
| 42 |
+
"mean_entropy": 3.3527193338463555,
|
| 43 |
+
"sample_count": 2048,
|
| 44 |
+
"token_count": 131072,
|
| 45 |
+
"unit": "nats"
|
| 46 |
+
},
|
| 47 |
+
"generated_minus_reference": -0.45632922449956803,
|
| 48 |
+
"reference": {
|
| 49 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 50 |
+
"excluded_token_ids": [],
|
| 51 |
+
"logarithm": "natural",
|
| 52 |
+
"mean_entropy": 3.8090485583459235,
|
| 53 |
+
"sample_count": 2048,
|
| 54 |
+
"token_count": 131072,
|
| 55 |
+
"unit": "nats"
|
| 56 |
+
},
|
| 57 |
+
"slice": "source_tokens_64_128_only"
|
| 58 |
+
},
|
| 59 |
+
"self_bleu": {
|
| 60 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 61 |
+
"completions_per_prompt": 5,
|
| 62 |
+
"ngram_order": 4,
|
| 63 |
+
"prompt_count": 256,
|
| 64 |
+
"sample_count": 1280,
|
| 65 |
+
"score": 0.05312529660547345,
|
| 66 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 67 |
+
"smoothing": "chen_cherry_method1",
|
| 68 |
+
"tokenization": "gpt2",
|
| 69 |
+
"weights": [
|
| 70 |
+
0.25,
|
| 71 |
+
0.25,
|
| 72 |
+
0.25,
|
| 73 |
+
0.25
|
| 74 |
+
]
|
| 75 |
+
}
|
| 76 |
+
},
|
| 77 |
+
"prefix_length": 64,
|
| 78 |
+
"production_sample_count": 2048,
|
| 79 |
+
"protocol": "c64_zs_v1",
|
| 80 |
+
"requested_metrics": [
|
| 81 |
+
"conditional_gen_ppl",
|
| 82 |
+
"mauve_suffix",
|
| 83 |
+
"entropy",
|
| 84 |
+
"self_bleu",
|
| 85 |
+
"prefix_exact_match"
|
| 86 |
+
],
|
| 87 |
+
"sample_count": 2048,
|
| 88 |
+
"samples": "results/conditional/samples/owt/flm/steps_2/samples.jsonl",
|
| 89 |
+
"samples_sha256": "14a4c9acb8742ced607da01aaf271c71202992eb1c4687aaf40823420f647799",
|
| 90 |
+
"schema_version": 1
|
| 91 |
+
}
|
results/conditional/metrics/owt/mdlm_di4c/steps_16/metrics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset": "owt",
|
| 3 |
+
"evaluation_continuation_length": 64,
|
| 4 |
+
"metrics": {
|
| 5 |
+
"conditional_generative_perplexity": {
|
| 6 |
+
"aggregation": "sum_nll_over_sum_valid_next_tokens",
|
| 7 |
+
"batch_size": 8,
|
| 8 |
+
"context_length": 1024,
|
| 9 |
+
"model_id": "gpt2-large",
|
| 10 |
+
"model_revision": "32b71b12589c2f8d625668d2335a01cac3249519",
|
| 11 |
+
"model_snapshot": "data/raw/huggingface/hub/models--gpt2-large/snapshots/32b71b12589c2f8d625668d2335a01cac3249519",
|
| 12 |
+
"offline": true,
|
| 13 |
+
"perplexity": 47.07727671992287,
|
| 14 |
+
"prompt_loss_excluded": true,
|
| 15 |
+
"sample_count": 2048,
|
| 16 |
+
"scored_slice": "source_tokens_64_128_only",
|
| 17 |
+
"tokenizer_id": "gpt2",
|
| 18 |
+
"tokenizer_revision": "607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 19 |
+
"tokenizer_snapshot": "data/raw/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e",
|
| 20 |
+
"total_nll": 503949.0018310547,
|
| 21 |
+
"truncation": "right",
|
| 22 |
+
"valid_token_count": 130835
|
| 23 |
+
},
|
| 24 |
+
"mauve_suffix": {
|
| 25 |
+
"comparison": "generated_suffix_vs_reference_suffix",
|
| 26 |
+
"prefix_included": false,
|
| 27 |
+
"sample_count": 2048,
|
| 28 |
+
"score": 0.5557158118486929,
|
| 29 |
+
"slice": "source_tokens_64_128_only"
|
| 30 |
+
},
|
| 31 |
+
"prefix_exact_match": {
|
| 32 |
+
"matched": 2048,
|
| 33 |
+
"rate": 1.0,
|
| 34 |
+
"required_rate": 1.0,
|
| 35 |
+
"sample_count": 2048
|
| 36 |
+
},
|
| 37 |
+
"sample_entropy": {
|
| 38 |
+
"generated": {
|
| 39 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 40 |
+
"excluded_token_ids": [],
|
| 41 |
+
"logarithm": "natural",
|
| 42 |
+
"mean_entropy": 3.737626109038477,
|
| 43 |
+
"sample_count": 2048,
|
| 44 |
+
"token_count": 131072,
|
| 45 |
+
"unit": "nats"
|
| 46 |
+
},
|
| 47 |
+
"generated_minus_reference": -0.07142244930744646,
|
| 48 |
+
"reference": {
|
| 49 |
+
"aggregation": "arithmetic_mean_of_per_sample_entropy",
|
| 50 |
+
"excluded_token_ids": [],
|
| 51 |
+
"logarithm": "natural",
|
| 52 |
+
"mean_entropy": 3.8090485583459235,
|
| 53 |
+
"sample_count": 2048,
|
| 54 |
+
"token_count": 131072,
|
| 55 |
+
"unit": "nats"
|
| 56 |
+
},
|
| 57 |
+
"slice": "source_tokens_64_128_only"
|
| 58 |
+
},
|
| 59 |
+
"self_bleu": {
|
| 60 |
+
"aggregation": "mean_prompt_group_self_bleu",
|
| 61 |
+
"completions_per_prompt": 5,
|
| 62 |
+
"ngram_order": 4,
|
| 63 |
+
"prompt_count": 256,
|
| 64 |
+
"sample_count": 1280,
|
| 65 |
+
"score": 0.053125032999678364,
|
| 66 |
+
"slice": "generated_source_tokens_64_128_only",
|
| 67 |
+
"smoothing": "chen_cherry_method1",
|
| 68 |
+
"tokenization": "gpt2",
|
| 69 |
+
"weights": [
|
| 70 |
+
0.25,
|
| 71 |
+
0.25,
|
| 72 |
+
0.25,
|
| 73 |
+
0.25
|
| 74 |
+
]
|
| 75 |
+
}
|
| 76 |
+
},
|
| 77 |
+
"prefix_length": 64,
|
| 78 |
+
"production_sample_count": 2048,
|
| 79 |
+
"protocol": "c64_zs_v1",
|
| 80 |
+
"requested_metrics": [
|
| 81 |
+
"conditional_gen_ppl",
|
| 82 |
+
"mauve_suffix",
|
| 83 |
+
"entropy",
|
| 84 |
+
"self_bleu",
|
| 85 |
+
"prefix_exact_match"
|
| 86 |
+
],
|
| 87 |
+
"sample_count": 2048,
|
| 88 |
+
"samples": "results/conditional/samples/owt/mdlm_di4c/steps_16/samples.jsonl",
|
| 89 |
+
"samples_sha256": "ba2b10ecc4f593ef3cc21daa230db6bf55a669e3af2315248faa5c6fb83fec53",
|
| 90 |
+
"schema_version": 1
|
| 91 |
+
}
|
results/conditional/samples/lm1b/candi/steps_1/samples.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
results/conditional/samples/lm1b/candi/steps_1/upstream_hydra/.hydra/config.yaml
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mode: sample_eval
|
| 2 |
+
seed: 42
|
| 3 |
+
scratch_dir: /home/patrick/.cache/discrete_diffusion
|
| 4 |
+
batch_size: 512
|
| 5 |
+
loader:
|
| 6 |
+
global_batch_size: ${batch_size}
|
| 7 |
+
eval_global_batch_size: 128
|
| 8 |
+
batch_size: 16
|
| 9 |
+
eval_batch_size: 2
|
| 10 |
+
num_workers: 4
|
| 11 |
+
pin_memory: true
|
| 12 |
+
sampling:
|
| 13 |
+
predictor: ancestral_cache
|
| 14 |
+
steps: 1
|
| 15 |
+
noise_removal: ancestral
|
| 16 |
+
use_float64: true
|
| 17 |
+
p_nucleus: 1.0
|
| 18 |
+
num_sample_batches: 1024
|
| 19 |
+
num_sample_log: 2
|
| 20 |
+
semi_ar: false
|
| 21 |
+
stride_length: 1
|
| 22 |
+
num_strides: 1
|
| 23 |
+
training:
|
| 24 |
+
ema: 0.9999
|
| 25 |
+
antithetic_sampling: true
|
| 26 |
+
importance_sampling: false
|
| 27 |
+
sampling_eps: 0.001
|
| 28 |
+
change_of_variables: false
|
| 29 |
+
loss_precision: float32
|
| 30 |
+
finetune_path: ''
|
| 31 |
+
eval:
|
| 32 |
+
checkpoint_path: /home/ruizzhao/diffusion_baseline/checkpoints/reference_reproduction/flm_baselines/lm1b/lm1b_CANDI.ckpt
|
| 33 |
+
disable_ema: false
|
| 34 |
+
compute_generative_perplexity: false
|
| 35 |
+
perplexity_batch_size: 8
|
| 36 |
+
compute_perplexity_on_sanity: false
|
| 37 |
+
gen_ppl_eval_model_name_or_path: gpt2-large
|
| 38 |
+
generate_samples: true
|
| 39 |
+
generated_samples_path: /home/ruizzhao/diffusion_baseline/results/conditional/samples/lm1b/candi/steps_1/upstream_samples.json
|
| 40 |
+
optim:
|
| 41 |
+
weight_decay: 0
|
| 42 |
+
lr: 0.001
|
| 43 |
+
beta1: 0.9
|
| 44 |
+
beta2: 0.999
|
| 45 |
+
eps: 1.0e-08
|
| 46 |
+
trainer:
|
| 47 |
+
_target_: lightning.Trainer
|
| 48 |
+
accelerator: cuda
|
| 49 |
+
num_nodes: 1
|
| 50 |
+
devices: 1
|
| 51 |
+
accumulate_grad_batches: 1
|
| 52 |
+
gradient_clip_val: 1.0
|
| 53 |
+
precision: bf16
|
| 54 |
+
num_sanity_val_steps: 2
|
| 55 |
+
max_steps: 1000000
|
| 56 |
+
log_every_n_steps: 100
|
| 57 |
+
limit_train_batches: 1.0
|
| 58 |
+
limit_val_batches: 1.0
|
| 59 |
+
val_check_interval: 10000
|
| 60 |
+
wandb:
|
| 61 |
+
project: flow-ode
|
| 62 |
+
notes: Flow ODEs for UDLM
|
| 63 |
+
group: null
|
| 64 |
+
job_type: null
|
| 65 |
+
name: null
|
| 66 |
+
id: null
|
| 67 |
+
tags:
|
| 68 |
+
- ${noise.type}
|
| 69 |
+
- ${data.train}
|
| 70 |
+
- ${data.valid}
|
| 71 |
+
- ${algo.name}
|
| 72 |
+
offline: true
|
| 73 |
+
checkpointing:
|
| 74 |
+
save_dir: /home/ruizzhao/diffusion_baseline/results/conditional/samples/lm1b/candi/steps_1/upstream_hydra
|
| 75 |
+
resume_from_ckpt: true
|
| 76 |
+
resume_ckpt_path: ${.save_dir}/checkpoints/last.ckpt
|
| 77 |
+
callbacks:
|
| 78 |
+
checkpoint_every_n_steps:
|
| 79 |
+
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
| 80 |
+
save_top_k: -1
|
| 81 |
+
save_last: true
|
| 82 |
+
dirpath: ${checkpointing.save_dir}/checkpoints
|
| 83 |
+
verbose: true
|
| 84 |
+
auto_insert_metric_name: false
|
| 85 |
+
every_n_train_steps: 500
|
| 86 |
+
checkpoint_monitor:
|
| 87 |
+
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
| 88 |
+
monitor: val/nll
|
| 89 |
+
mode: min
|
| 90 |
+
save_top_k: 1
|
| 91 |
+
save_last: false
|
| 92 |
+
dirpath: ${checkpointing.save_dir}/checkpoints
|
| 93 |
+
filename: best
|
| 94 |
+
auto_insert_metric_name: false
|
| 95 |
+
verbose: true
|
| 96 |
+
learning_rate_monitor:
|
| 97 |
+
_target_: lightning.pytorch.callbacks.LearningRateMonitor
|
| 98 |
+
logging_interval: step
|
| 99 |
+
data:
|
| 100 |
+
train: lm1b
|
| 101 |
+
valid: lm1b
|
| 102 |
+
tokenizer_name_or_path: bert-base-uncased
|
| 103 |
+
cache_dir: /share/kuleshov/ssahoo/textdiffusion/data
|
| 104 |
+
wrap: true
|
| 105 |
+
streaming: false
|
| 106 |
+
insert_train_eos: true
|
| 107 |
+
insert_valid_eos: true
|
| 108 |
+
model:
|
| 109 |
+
name: small
|
| 110 |
+
type: ddit
|
| 111 |
+
hidden_size: 768
|
| 112 |
+
cond_dim: 128
|
| 113 |
+
length: 128
|
| 114 |
+
n_blocks: 12
|
| 115 |
+
n_heads: 12
|
| 116 |
+
scale_by_sigma: true
|
| 117 |
+
dropout: 0.1
|
| 118 |
+
tie_word_embeddings: false
|
| 119 |
+
vocab_lookup: true
|
| 120 |
+
strategy:
|
| 121 |
+
_target_: lightning.pytorch.strategies.DDPStrategy
|
| 122 |
+
find_unused_parameters: false
|
| 123 |
+
noise:
|
| 124 |
+
type: log-linear
|
| 125 |
+
parameterization: log-linear
|
| 126 |
+
eps: 0
|
| 127 |
+
denoiser_latent_conditioning: -1
|
| 128 |
+
freeze_encoder: false
|
| 129 |
+
freeze_decoder: false
|
| 130 |
+
lr_scheduler:
|
| 131 |
+
_target_: transformers.get_constant_schedule
|
| 132 |
+
prior:
|
| 133 |
+
type: none
|
| 134 |
+
latent_width: 0
|
| 135 |
+
latent_height: 0
|
| 136 |
+
algo:
|
| 137 |
+
name: candi
|
| 138 |
+
backbone: cont_dit
|
| 139 |
+
causal_attention: false
|
| 140 |
+
parameterization: mean
|
| 141 |
+
T: 0
|
| 142 |
+
discretize_start_time: 1.0
|
| 143 |
+
time_conditioning: true
|
| 144 |
+
step_size: 1.0
|
| 145 |
+
mixed_coeff: 0.5
|
| 146 |
+
max_percentile: 0.25
|
| 147 |
+
min_percentile: 0.01
|
| 148 |
+
sigma_min: 0.01
|
| 149 |
+
sigma_max: 2.0
|
| 150 |
+
temp: 1.0
|
| 151 |
+
pure_continuous: false
|
| 152 |
+
sampler: cached
|
| 153 |
+
is_embed: false
|
| 154 |
+
use_percentile_scheduling: true
|
results/conditional/samples/lm1b/candi/steps_1024/stderr.log
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Seed set to 42
|
| 2 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/algo.py:691: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
|
| 3 |
+
self.continuous_noise = torch.tensor(self.continuous_noise)
|
| 4 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/algo.py:692: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
|
| 5 |
+
self.discrete_noise = torch.tensor(self.discrete_noise)
|
| 6 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/algo.py:861: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
|
| 7 |
+
with torch.cuda.amp.autocast(dtype=torch.float32):
|
| 8 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/models/dit_cont.py:533: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
|
| 9 |
+
with torch.cuda.amp.autocast(dtype=torch.bfloat16):
|
| 10 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/models/dit_cont.py:157: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
|
| 11 |
+
with torch.cuda.amp.autocast(enabled=False):
|
| 12 |
+
/home/ruizzhao/diffusion_baseline/upstreams/candi/models/dit_cont.py:112: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
|
| 13 |
+
with torch.cuda.amp.autocast(enabled=False):
|