{"id": "hard-zero_batch-006", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 16.0, \"zero_stage\": 3, \"world_size\": 4, \"per_device_batch_size\": 75, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 51}, \"work\": {\"bytes_per_param_per_rank\": 4.0, \"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 128.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-014", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-013", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 102400 examples;\n3 epochs. A checkpoint audit happens at step 900 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 900 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 6.5e-05, \"grad_accum_steps\": 8, \"planned_total_steps\": 1200}, \"work\": {\"audit_step\": 900, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-008", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 16.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 64, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 80 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 48}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-000", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 10000, \"dataset_size_gb\": 50.0, \"examples_per_rank\": 10000, \"shard_size_gb\": 50.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-014", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 8.0, \"zero_stage\": 3, \"world_size\": 8, \"per_device_batch_size\": 40, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 80 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"bytes_per_param_per_rank\": 2.0, \"fixed_memory_gb\": 16.0, \"remaining_memory_gb\": 64.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-003", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question for a run that has not started:\ndataset 80000 examples, seq_len 1024, 2 epochs, throughput\n12000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.4740740740740741}, \"work\": {\"total_tokens\": 163840000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-013", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 64.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 4, \"per_device_batch_size\": 48, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-013", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 4.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 46, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 40}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-001", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 20000, \"dataset_size_gb\": 50.0, \"examples_per_rank\": 20000, \"shard_size_gb\": 50.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 10000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_lora_vocab-001", "archetype": "two_lora_vocab", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"method\": \"lora\", \"lora_r\": 16, \"adapter_requires_grad\": false, \"base_model_frozen\": true, \"embedding_vocab_size\": 32000, \"tokenizer_vocab_size\": 32064}\nPreflight report:\n trainable params: 0\n forward smoke test: IndexError: index out of range in self (embedding lookup)\n max token id in tokenizer: 32063\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"ADAPTERS_FROZEN_ZERO_TRAINABLE\", \"EMBEDDING_VOCAB_MISMATCH\"], \"fix\": {\"adapter_requires_grad\": true, \"embedding_vocab_size\": 32064}}", "meta": "{\"archetype\": \"two_lora_vocab\", \"computations\": [\"R8\", \"R11\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-optimizer_batch-003", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 2.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 116, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 104}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 24.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-000", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"per_device_batch_size\": 27, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 272, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 17}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 17}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-012", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 26, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 80 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 10}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-005", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 10000, \"dataset_size_gb\": 120.0, \"examples_per_rank\": 10000, \"shard_size_gb\": 120.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 60.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-004", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 64; dataset 6400 examples; 4 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 2, \"planned_total_steps\": 400}, \"work\": {\"steps_per_epoch\": 100}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-009", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 8, \"dataset_examples\": 40000, \"dataset_size_gb\": 200.0, \"examples_per_rank\": 40000, \"shard_size_gb\": 200.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-013", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-007", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 512; dataset 204800 examples;\n2 epochs. A checkpoint audit happens at step 200 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 200 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000155, \"grad_accum_steps\": 16, \"planned_total_steps\": 800}, \"work\": {\"audit_step\": 200, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-006", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 20000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-001", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 750}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 15}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-lr_at_step-001", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 4000}\nLog: a checkpoint audit at step 3000 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 3000 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000195}, \"work\": {\"step_fraction\": 0.75}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-011", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-013", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 8.0, \"zero_stage\": 2, \"world_size\": 2, \"per_device_batch_size\": 120, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 104}, \"work\": {\"bytes_per_param_per_rank\": 11.0, \"fixed_memory_gb\": 88.0, \"remaining_memory_gb\": 104.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-005", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05}\nTraining plan: effective batch exactly 256; dataset 25600 examples;\n3 epochs. A checkpoint audit happens at step 225 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 225 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000195, \"grad_accum_steps\": 4, \"planned_total_steps\": 300}, \"work\": {\"audit_step\": 225, \"steps_per_epoch\": 100}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-004", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 64.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 33, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 25}, \"work\": {\"fixed_memory_gb\": 128.0, \"params_per_rank_billions\": 8.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-004", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question for a run that has not started:\ndataset 40000 examples, seq_len 2048, 3 epochs, throughput\n15000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.5688888888888889}, \"work\": {\"total_tokens\": 245760000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-010", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05}\nTraining plan: effective batch exactly 256; dataset 51200 examples;\n3 epochs. A checkpoint audit happens at step 150 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 150 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.0002325, \"grad_accum_steps\": 16, \"planned_total_steps\": 600}, \"work\": {\"audit_step\": 150, \"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-005", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 8.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-001", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 1, \"world_size\": 8, \"per_device_batch_size\": 77, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 61}, \"work\": {\"bytes_per_param_per_rank\": 9.0, \"fixed_memory_gb\": 36.0, \"remaining_memory_gb\": 92.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-002", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 2.0, \"optimizer\": \"adafactor\", \"per_device_batch_size\": 24, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 40 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 12}, \"work\": {\"bytes_per_param\": 8, \"fixed_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_and_steps-011", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 25600 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 400}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_v100_dataloader-003", "archetype": "two_v100_dataloader", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"dtype\": \"bf16\", \"use_grad_scaler\": false, \"dataloader_num_workers\": 8, \"dataloader_multiprocessing_context\": \"fork\"}\nGPU: NVIDIA V100 32GB\nDataset code: __init__ builds self.embed_cache = torch.zeros(..., device=\"cuda\").\nLog A:\n RuntimeError: \"bfloat16\" not implemented for this device / falling back to slow path\nLog B (after the team restarted with a device workaround):\n epoch 1 completes, then no output for 38 minutes, GPU util 0%, workers blocked.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"PRECISION_UNSUPPORTED_ON_GPU\", \"DATALOADER_FORK_WITH_CUDA\"], \"fix\": {\"dataloader_multiprocessing_context\": \"spawn\", \"dtype\": \"fp16\", \"use_grad_scaler\": true}}", "meta": "{\"archetype\": \"two_v100_dataloader\", \"computations\": [\"R5\", \"R9\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-training_time-001", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question for a run that has not started:\ndataset 20000 examples, seq_len 1024, 2 epochs, throughput\n8000 tokens/sec per GPU, world_size 4.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.35555555555555557}, \"work\": {\"total_tokens\": 40960000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-014", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 64.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 48, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 128.0, \"params_per_rank_billions\": 8.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-007", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 1.5, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 750}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 31}, \"work\": {\"checkpoint_size_gb\": 24.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_v100_dataloader-000", "archetype": "two_v100_dataloader", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"dtype\": \"bf16\", \"use_grad_scaler\": false, \"dataloader_num_workers\": 8, \"dataloader_multiprocessing_context\": \"fork\"}\nGPU: NVIDIA V100 32GB\nDataset code: __init__ builds self.embed_cache = torch.zeros(..., device=\"cuda\").\nLog A:\n RuntimeError: \"bfloat16\" not implemented for this device / falling back to slow path\nLog B (after the team restarted with a device workaround):\n epoch 1 completes, then no output for 38 minutes, GPU util 0%, workers blocked.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"PRECISION_UNSUPPORTED_ON_GPU\", \"DATALOADER_FORK_WITH_CUDA\"], \"fix\": {\"dataloader_multiprocessing_context\": \"spawn\", \"dtype\": \"fp16\", \"use_grad_scaler\": true}}", "meta": "{\"archetype\": \"two_v100_dataloader\", \"computations\": [\"R5\", \"R9\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-shard_size-014", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 4, \"dataset_examples\": 40000, \"dataset_size_gb\": 50.0, \"examples_per_rank\": 40000, \"shard_size_gb\": 50.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 10000, \"shard_size_gb\": 12.5}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-004", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 2, \"world_size\": 8, \"per_device_batch_size\": 124, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 108}, \"work\": {\"bytes_per_param_per_rank\": 7.25, \"fixed_memory_gb\": 29.0, \"remaining_memory_gb\": 163.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-001", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 4.0, \"per_device_batch_size\": 20, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 6}, \"work\": {\"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-003", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 64.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 4, \"per_device_batch_size\": 37, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 21}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-000", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 300 tokens, padded\nseq_len 1024, 3 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 245760000, \"total_real_tokens\": 72000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-000", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 4, \"per_device_batch_size\": 48, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-013", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 50000, \"dataset_size_gb\": 50.0, \"examples_per_rank\": 50000, \"shard_size_gb\": 50.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 25000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_sampler_accum-000", "archetype": "two_sampler_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 8, \"grad_accum_steps\": 1, \"sampler\": \"RandomSampler\"}\nTraining plan: effective batch size exactly 128.\nData audit (first 4 example ids per rank):\n rank 0: [811, 42, 1907, 55]\n rank 1: [811, 42, 1907, 55]\n rank 2: [811, 42, 1907, 55]\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\", \"EFFECTIVE_BATCH_MISMATCH\"], \"fix\": {\"grad_accum_steps\": 2, \"sampler\": \"DistributedSampler\"}}", "meta": "{\"archetype\": \"two_sampler_accum\", \"computations\": [\"R7\", \"R3\"], \"depth\": 3, \"interaction\": \"sampler+accum\", \"tier\": \"two_fault\"}"} {"id": "hard-batch_from_components-003", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 2.0, \"per_device_batch_size\": 52, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 32.0, \"remaining_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-012", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question for a run that has not started:\ndataset 100000 examples, seq_len 2048, 2 epochs, throughput\n15000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.9481481481481482}, \"work\": {\"total_tokens\": 409600000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-002", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 16.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 80, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 64}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-005", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 4, \"per_device_batch_size\": 46, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 2.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 38}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-004", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"optimizer\": \"adamw_8bit\", \"per_device_batch_size\": 100, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 88}, \"work\": {\"bytes_per_param\": 10, \"fixed_memory_gb\": 40.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-003", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 2, \"world_size\": 2, \"per_device_batch_size\": 50, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 34}, \"work\": {\"bytes_per_param_per_rank\": 11.0, \"fixed_memory_gb\": 44.0, \"remaining_memory_gb\": 52.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-008", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 1, \"world_size\": 8, \"per_device_batch_size\": 78, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 62}, \"work\": {\"bytes_per_param_per_rank\": 9.0, \"fixed_memory_gb\": 36.0, \"remaining_memory_gb\": 156.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-006", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 84, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 4.0 GB.\nTraining plan: effective batch size exactly 1184, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 8, \"per_device_batch_size\": 74}, \"work\": {\"activation_per_sample_gb\": 1.0, \"max_per_device_batch\": 74}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-012", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 25, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 10 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 60, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 2, \"per_device_batch_size\": 15}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 15}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-012", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 2048, 3 epochs, throughput 15000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 491520000, \"total_real_tokens\": 216000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-012", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05}\nTraining plan: effective batch exactly 512; dataset 128000 examples;\n2 epochs. A checkpoint audit happens at step 250 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 250 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000165, \"grad_accum_steps\": 16, \"planned_total_steps\": 500}, \"work\": {\"audit_step\": 250, \"steps_per_epoch\": 250}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-004", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 4}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-003", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"per_device_batch_size\": 32, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 704, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 8, \"per_device_batch_size\": 22}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 22}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-parallel_batch-010", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 16.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 122, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 106}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-001", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 30, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 10 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 320, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 20}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 20}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-008", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 1.5, \"per_device_batch_size\": 42, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 28}, \"work\": {\"fixed_memory_gb\": 24.0, \"remaining_memory_gb\": 56.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_sampler_accum-003", "archetype": "two_sampler_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 4, \"grad_accum_steps\": 1, \"sampler\": \"RandomSampler\"}\nTraining plan: effective batch size exactly 256.\nData audit (first 4 example ids per rank):\n rank 0: [811, 42, 1907, 55]\n rank 1: [811, 42, 1907, 55]\n rank 2: [811, 42, 1907, 55]\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\", \"EFFECTIVE_BATCH_MISMATCH\"], \"fix\": {\"grad_accum_steps\": 16, \"sampler\": \"DistributedSampler\"}}", "meta": "{\"archetype\": \"two_sampler_accum\", \"computations\": [\"R7\", \"R3\"], \"depth\": 3, \"interaction\": \"sampler+accum\", \"tier\": \"two_fault\"}"} {"id": "hard-batch_from_components-009", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 4.0, \"per_device_batch_size\": 36, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 16}, \"work\": {\"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-010", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 2048, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 327680000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-two_oom_clipping-000", "archetype": "two_oom_clipping", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 22, \"max_grad_norm\": 0.0, \"learning_rate\": 0.00002, \"warmup_ratio\": 0.03, \"dtype\": \"bf16\", \"gradient_checkpointing\": true}\nGPU: 1 x GPU with 40 GB VRAM\nProfiler: fixed memory 14 GB; activation memory per sample 2.5 GB.\nLog:\n step 40 loss=1.92 grad_norm=2.3\n step 41 loss=1.90 grad_norm=320\n step 42 loss=8.44 grad_norm=21.0\n step 52 torch.OutOfMemoryError: CUDA out of memory.\nThe corrected config must fix both problems seen in this one run.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"OOM_BATCH_TOO_LARGE\", \"NO_GRADIENT_CLIPPING\"], \"fix\": {\"max_grad_norm\": 1.0, \"per_device_batch_size\": 10}}", "meta": "{\"archetype\": \"two_oom_clipping\", \"computations\": [\"R1\", \"R12\"], \"depth\": 3, \"interaction\": \"oom+clipping\", \"tier\": \"two_fault\"}"} {"id": "hard-training_time-006", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question for a run that has not started:\ndataset 20000 examples, seq_len 1024, 3 epochs, throughput\n8000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.26666666666666666}, \"work\": {\"total_tokens\": 61440000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-optimizer_batch-014", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 7.0, \"optimizer\": \"adamw_8bit\", \"per_device_batch_size\": 32, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 96 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 26}, \"work\": {\"bytes_per_param\": 10, \"fixed_memory_gb\": 70.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-008", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nPlanning question for a run that has not started:\ndataset 50000 examples, seq_len 2048, 3 epochs, throughput\n8000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 1.3333333333333333}, \"work\": {\"total_tokens\": 307200000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-014", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question for a run that has not started:\ndataset 100000 examples, seq_len 2048, 2 epochs, throughput\n8000 tokens/sec per GPU, world_size 4.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 3.5555555555555554}, \"work\": {\"total_tokens\": 409600000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-010", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 2, \"world_size\": 4, \"per_device_batch_size\": 102, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 94}, \"work\": {\"bytes_per_param_per_rank\": 8.5, \"fixed_memory_gb\": 34.0, \"remaining_memory_gb\": 94.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-010", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"per_device_batch_size\": 22, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 16}, \"work\": {\"fixed_memory_gb\": 48.0, \"remaining_memory_gb\": 32.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_lora_vocab-002", "archetype": "two_lora_vocab", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"method\": \"lora\", \"lora_r\": 16, \"adapter_requires_grad\": false, \"base_model_frozen\": true, \"embedding_vocab_size\": 128000, \"tokenizer_vocab_size\": 128256}\nPreflight report:\n trainable params: 0\n forward smoke test: IndexError: index out of range in self (embedding lookup)\n max token id in tokenizer: 128255\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"ADAPTERS_FROZEN_ZERO_TRAINABLE\", \"EMBEDDING_VOCAB_MISMATCH\"], \"fix\": {\"adapter_requires_grad\": true, \"embedding_vocab_size\": 128256}}", "meta": "{\"archetype\": \"two_lora_vocab\", \"computations\": [\"R8\", \"R11\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-optimizer_batch-012", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 2.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 20, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 40 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 8}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 24.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-006", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 4}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_oom_clipping-003", "archetype": "two_oom_clipping", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 40, \"max_grad_norm\": 0.0, \"learning_rate\": 0.00002, \"warmup_ratio\": 0.03, \"dtype\": \"bf16\", \"gradient_checkpointing\": true}\nGPU: 1 x GPU with 40 GB VRAM\nProfiler: fixed memory 6 GB; activation memory per sample 1.0 GB.\nLog:\n step 40 loss=1.92 grad_norm=2.3\n step 41 loss=1.90 grad_norm=180\n step 42 loss=8.44 grad_norm=21.0\n step 52 torch.OutOfMemoryError: CUDA out of memory.\nThe corrected config must fix both problems seen in this one run.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"OOM_BATCH_TOO_LARGE\", \"NO_GRADIENT_CLIPPING\"], \"fix\": {\"max_grad_norm\": 1.0, \"per_device_batch_size\": 34}}", "meta": "{\"archetype\": \"two_oom_clipping\", \"computations\": [\"R1\", \"R12\"], \"depth\": 3, \"interaction\": \"oom+clipping\", \"tier\": \"two_fault\"}"} {"id": "hard-optimizer_batch-009", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 2.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 75, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 69}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 24.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-005", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question for a run that has not started:\ndataset 80000 examples, seq_len 1024, 3 epochs, throughput\n10000 tokens/sec per GPU, world_size 4.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 1.7066666666666668}, \"work\": {\"total_tokens\": 245760000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-012", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 8, \"dataset_examples\": 40000, \"dataset_size_gb\": 200.0, \"examples_per_rank\": 40000, \"shard_size_gb\": 200.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-002", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question for a run that has not started:\ndataset 100000 examples, seq_len 1024, 2 epochs, throughput\n15000 tokens/sec per GPU, world_size 4.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.9481481481481482}, \"work\": {\"total_tokens\": 204800000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-001", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 16.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 56, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 48}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-011", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"world_size\": 4, \"dataset_examples\": 20000, \"dataset_size_gb\": 100.0, \"examples_per_rank\": 20000, \"shard_size_gb\": 100.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-000", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 16.0, \"zero_stage\": 2, \"world_size\": 8, \"per_device_batch_size\": 32, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 8}, \"work\": {\"bytes_per_param_per_rank\": 7.25, \"fixed_memory_gb\": 116.0, \"remaining_memory_gb\": 12.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-002", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 200}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 1}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_v100_dataloader-001", "archetype": "two_v100_dataloader", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"dtype\": \"bf16\", \"use_grad_scaler\": false, \"dataloader_num_workers\": 8, \"dataloader_multiprocessing_context\": \"fork\"}\nGPU: NVIDIA V100 32GB\nDataset code: __init__ builds self.embed_cache = torch.zeros(..., device=\"cuda\").\nLog A:\n RuntimeError: \"bfloat16\" not implemented for this device / falling back to slow path\nLog B (after the team restarted with a device workaround):\n epoch 1 completes, then no output for 38 minutes, GPU util 0%, workers blocked.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"PRECISION_UNSUPPORTED_ON_GPU\", \"DATALOADER_FORK_WITH_CUDA\"], \"fix\": {\"dataloader_multiprocessing_context\": \"spawn\", \"dtype\": \"fp16\", \"use_grad_scaler\": true}}", "meta": "{\"archetype\": \"two_v100_dataloader\", \"computations\": [\"R5\", \"R9\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-shard_size-008", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 8, \"dataset_examples\": 40000, \"dataset_size_gb\": 200.0, \"examples_per_rank\": 40000, \"shard_size_gb\": 200.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-010", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 256; dataset 128000 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 16, \"planned_total_steps\": 1000}, \"work\": {\"steps_per_epoch\": 500}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-001", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nPlanning question. Sequence packing is ON.\ndataset 40000 examples, average length 900 tokens, padded\nseq_len 2048, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 72000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-006", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 2.0, \"optimizer\": \"adafactor\", \"per_device_batch_size\": 38, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 80 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"bytes_per_param\": 8, \"fixed_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-002", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 51200 examples;\n2 epochs. A checkpoint audit happens at step 100 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 100 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000155, \"grad_accum_steps\": 8, \"planned_total_steps\": 400}, \"work\": {\"audit_step\": 100, \"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-two_oom_clipping-001", "archetype": "two_oom_clipping", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 11, \"max_grad_norm\": 0.0, \"learning_rate\": 0.00002, \"warmup_ratio\": 0.03, \"dtype\": \"bf16\", \"gradient_checkpointing\": true}\nGPU: 1 x GPU with 24 GB VRAM\nProfiler: fixed memory 14 GB; activation memory per sample 2.0 GB.\nLog:\n step 40 loss=1.92 grad_norm=2.3\n step 41 loss=1.90 grad_norm=180\n step 42 loss=8.44 grad_norm=21.0\n step 52 torch.OutOfMemoryError: CUDA out of memory.\nThe corrected config must fix both problems seen in this one run.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"OOM_BATCH_TOO_LARGE\", \"NO_GRADIENT_CLIPPING\"], \"fix\": {\"max_grad_norm\": 1.0, \"per_device_batch_size\": 5}}", "meta": "{\"archetype\": \"two_oom_clipping\", \"computations\": [\"R1\", \"R12\"], \"depth\": 3, \"interaction\": \"oom+clipping\", \"tier\": \"two_fault\"}"} {"id": "hard-two_lora_vocab-000", "archetype": "two_lora_vocab", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"method\": \"lora\", \"lora_r\": 16, \"adapter_requires_grad\": false, \"base_model_frozen\": true, \"embedding_vocab_size\": 50257, \"tokenizer_vocab_size\": 50304}\nPreflight report:\n trainable params: 0\n forward smoke test: IndexError: index out of range in self (embedding lookup)\n max token id in tokenizer: 50303\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"ADAPTERS_FROZEN_ZERO_TRAINABLE\", \"EMBEDDING_VOCAB_MISMATCH\"], \"fix\": {\"adapter_requires_grad\": true, \"embedding_vocab_size\": 50304}}", "meta": "{\"archetype\": \"two_lora_vocab\", \"computations\": [\"R8\", \"R11\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-zero_batch-011", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 2, \"world_size\": 4, \"per_device_batch_size\": 95, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 79}, \"work\": {\"bytes_per_param_per_rank\": 8.5, \"fixed_memory_gb\": 34.0, \"remaining_memory_gb\": 158.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-006", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 5000}\nLog: a checkpoint audit at step 1250 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 1250 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000465}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_oom_clipping-004", "archetype": "two_oom_clipping", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 41, \"max_grad_norm\": 0.0, \"learning_rate\": 0.00002, \"warmup_ratio\": 0.03, \"dtype\": \"bf16\", \"gradient_checkpointing\": true}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: fixed memory 10 GB; activation memory per sample 2.0 GB.\nLog:\n step 40 loss=1.92 grad_norm=2.3\n step 41 loss=1.90 grad_norm=320\n step 42 loss=8.44 grad_norm=21.0\n step 52 torch.OutOfMemoryError: CUDA out of memory.\nThe corrected config must fix both problems seen in this one run.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"OOM_BATCH_TOO_LARGE\", \"NO_GRADIENT_CLIPPING\"], \"fix\": {\"max_grad_norm\": 1.0, \"per_device_batch_size\": 35}}", "meta": "{\"archetype\": \"two_oom_clipping\", \"computations\": [\"R1\", \"R12\"], \"depth\": 3, \"interaction\": \"oom+clipping\", \"tier\": \"two_fault\"}"} {"id": "hard-checkpoint_retention-003", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 1000}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 20}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-007", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 25600 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 400}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-006", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"world_size\": 8, \"dataset_examples\": 100000, \"dataset_size_gb\": 480.0, \"examples_per_rank\": 100000, \"shard_size_gb\": 480.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 12500, \"shard_size_gb\": 60.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-006", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 80, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 64}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_and_steps-006", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 25600 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 400}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-012", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 8.0, \"zero_stage\": 3, \"world_size\": 4, \"per_device_batch_size\": 27, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 80 GB VRAM.\nProfiler: activation memory per sample 2.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 19}, \"work\": {\"bytes_per_param_per_rank\": 4.0, \"fixed_memory_gb\": 32.0, \"remaining_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-004", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.00033}, \"work\": {\"step_fraction\": 0.5}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-002", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 64; dataset 12800 examples; 3 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 600}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-014", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 25600 examples; 4 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 2, \"planned_total_steps\": 800}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-004", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 2048, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 8.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 327680000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-two_v100_dataloader-004", "archetype": "two_v100_dataloader", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"dtype\": \"bf16\", \"use_grad_scaler\": false, \"dataloader_num_workers\": 8, \"dataloader_multiprocessing_context\": \"fork\"}\nGPU: NVIDIA V100 32GB\nDataset code: __init__ builds self.embed_cache = torch.zeros(..., device=\"cuda\").\nLog A:\n RuntimeError: \"bfloat16\" not implemented for this device / falling back to slow path\nLog B (after the team restarted with a device workaround):\n epoch 1 completes, then no output for 38 minutes, GPU util 0%, workers blocked.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"PRECISION_UNSUPPORTED_ON_GPU\", \"DATALOADER_FORK_WITH_CUDA\"], \"fix\": {\"dataloader_multiprocessing_context\": \"spawn\", \"dtype\": \"fp16\", \"use_grad_scaler\": true}}", "meta": "{\"archetype\": \"two_v100_dataloader\", \"computations\": [\"R5\", \"R9\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-training_time-010", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nPlanning question for a run that has not started:\ndataset 40000 examples, seq_len 1024, 3 epochs, throughput\n20000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.21333333333333335}, \"work\": {\"total_tokens\": 122880000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_sampler_accum-004", "archetype": "two_sampler_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 8, \"grad_accum_steps\": 1, \"sampler\": \"RandomSampler\"}\nTraining plan: effective batch size exactly 256.\nData audit (first 4 example ids per rank):\n rank 0: [811, 42, 1907, 55]\n rank 1: [811, 42, 1907, 55]\n rank 2: [811, 42, 1907, 55]\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\", \"EFFECTIVE_BATCH_MISMATCH\"], \"fix\": {\"grad_accum_steps\": 8, \"sampler\": \"DistributedSampler\"}}", "meta": "{\"archetype\": \"two_sampler_accum\", \"computations\": [\"R7\", \"R3\"], \"depth\": 3, \"interaction\": \"sampler+accum\", \"tier\": \"two_fault\"}"} {"id": "hard-batch_from_components-004", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 1.5, \"per_device_batch_size\": 28, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 40 GB VRAM\nProfiler: activation memory per sample 2.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 8}, \"work\": {\"fixed_memory_gb\": 24.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-000", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 512; dataset 51200 examples;\n2 epochs. A checkpoint audit happens at step 50 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 50 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000155, \"grad_accum_steps\": 8, \"planned_total_steps\": 200}, \"work\": {\"audit_step\": 50, \"steps_per_epoch\": 100}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-010", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 7.0, \"optimizer\": \"adamw_8bit\", \"per_device_batch_size\": 31, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 96 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 13}, \"work\": {\"bytes_per_param\": 10, \"fixed_memory_gb\": 70.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-005", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 16.0, \"zero_stage\": 2, \"world_size\": 8, \"per_device_batch_size\": 16, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 8}, \"work\": {\"bytes_per_param_per_rank\": 7.25, \"fixed_memory_gb\": 116.0, \"remaining_memory_gb\": 12.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-012", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"per_device_batch_size\": 26, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 12}, \"work\": {\"fixed_memory_gb\": 48.0, \"remaining_memory_gb\": 32.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-003", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 3 epochs, throughput 15000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 245760000, \"total_real_tokens\": 216000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-012", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 4000}\nLog: a checkpoint audit at step 1000 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 1000 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000465}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-007", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nPlanning question. Sequence packing is ON.\ndataset 40000 examples, average length 900 tokens, padded\nseq_len 2048, 3 epochs, throughput 15000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 245760000, \"total_real_tokens\": 108000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-002", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 3, \"world_size\": 8, \"per_device_batch_size\": 24, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 40 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 16}, \"work\": {\"bytes_per_param_per_rank\": 2.0, \"fixed_memory_gb\": 8.0, \"remaining_memory_gb\": 32.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-013", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 750}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 6}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-zero_batch-007", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 2, \"world_size\": 8, \"per_device_batch_size\": 57, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 49}, \"work\": {\"bytes_per_param_per_rank\": 7.25, \"fixed_memory_gb\": 29.0, \"remaining_memory_gb\": 99.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_and_steps-013", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 256; dataset 128000 examples; 3 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 16, \"planned_total_steps\": 1500}, \"work\": {\"steps_per_epoch\": 500}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-013", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 27, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 14 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 272, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 17}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 17}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-011", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nPlanning question for a run that has not started:\ndataset 20000 examples, seq_len 1024, 3 epochs, throughput\n20000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.10666666666666667}, \"work\": {\"total_tokens\": 61440000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_sampler_accum-002", "archetype": "two_sampler_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 4, \"grad_accum_steps\": 1, \"sampler\": \"RandomSampler\"}\nTraining plan: effective batch size exactly 128.\nData audit (first 4 example ids per rank):\n rank 0: [811, 42, 1907, 55]\n rank 1: [811, 42, 1907, 55]\n rank 2: [811, 42, 1907, 55]\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\", \"EFFECTIVE_BATCH_MISMATCH\"], \"fix\": {\"grad_accum_steps\": 8, \"sampler\": \"DistributedSampler\"}}", "meta": "{\"archetype\": \"two_sampler_accum\", \"computations\": [\"R7\", \"R3\"], \"depth\": 3, \"interaction\": \"sampler+accum\", \"tier\": \"two_fault\"}"} {"id": "hard-accum_and_steps-009", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 64; dataset 32000 examples; 3 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 1, \"planned_total_steps\": 1500}, \"work\": {\"steps_per_epoch\": 500}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-optimizer_batch-001", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 4.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 44, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 80 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-shard_size-002", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"world_size\": 4, \"dataset_examples\": 20000, \"dataset_size_gb\": 100.0, \"examples_per_rank\": 20000, \"shard_size_gb\": 100.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 25.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-lr_at_step-003", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 250 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 250 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000465}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-000", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question for a run that has not started:\ndataset 50000 examples, seq_len 1024, 3 epochs, throughput\n8000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.6666666666666666}, \"work\": {\"total_tokens\": 153600000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-checkpoint_retention-008", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 1000}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 20}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-optimizer_batch-011", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 7.0, \"optimizer\": \"adamw_8bit\", \"per_device_batch_size\": 12, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 80 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 6}, \"work\": {\"bytes_per_param\": 10, \"fixed_memory_gb\": 70.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_and_steps-008", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 256; dataset 102400 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 8, \"planned_total_steps\": 800}, \"work\": {\"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-011", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 102400 examples;\n2 epochs. A checkpoint audit happens at step 200 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 200 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000155, \"grad_accum_steps\": 8, \"planned_total_steps\": 800}, \"work\": {\"audit_step\": 200, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-000", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 4}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-checkpoint_retention-010", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 1.5, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 20}, \"work\": {\"checkpoint_size_gb\": 24.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-002", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 76, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 14 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 4.0 GB.\nTraining plan: effective batch size exactly 264, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 2, \"per_device_batch_size\": 66}, \"work\": {\"activation_per_sample_gb\": 1.0, \"max_per_device_batch\": 66}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-optimizer_batch-000", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 7.0, \"optimizer\": \"adafactor\", \"per_device_batch_size\": 78, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 72}, \"work\": {\"bytes_per_param\": 8, \"fixed_memory_gb\": 56.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-012", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 200}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 4}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-batch_from_components-007", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"per_device_batch_size\": 26, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 16}, \"work\": {\"fixed_memory_gb\": 48.0, \"remaining_memory_gb\": 32.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-009", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05}\nTraining plan: effective batch exactly 512; dataset 204800 examples;\n2 epochs. A checkpoint audit happens at step 600 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 600 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 9.75e-05, \"grad_accum_steps\": 16, \"planned_total_steps\": 800}, \"work\": {\"audit_step\": 600, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-011", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 4.0, \"per_device_batch_size\": 24, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 10}, \"work\": {\"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-007", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"per_device_batch_size\": 47, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 296, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 37}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 37}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-011", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 10}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-batch_from_components-000", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 2.0, \"per_device_batch_size\": 33, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 19}, \"work\": {\"fixed_memory_gb\": 32.0, \"remaining_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-013", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question for a run that has not started:\ndataset 50000 examples, seq_len 2048, 2 epochs, throughput\n10000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.7111111111111111}, \"work\": {\"total_tokens\": 204800000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-001", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 256; dataset 102400 examples; 4 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 1600}, \"work\": {\"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-packing_time-002", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 2048, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 8.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 327680000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-007", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 2000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000465}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-003", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 50000, \"dataset_size_gb\": 25.0, \"examples_per_rank\": 50000, \"shard_size_gb\": 25.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 25000, \"shard_size_gb\": 12.5}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-007", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 10000, \"dataset_size_gb\": 80.0, \"examples_per_rank\": 10000, \"shard_size_gb\": 80.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 40.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_sampler_accum-001", "archetype": "two_sampler_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 8, \"grad_accum_steps\": 1, \"sampler\": \"RandomSampler\"}\nTraining plan: effective batch size exactly 128.\nData audit (first 4 example ids per rank):\n rank 0: [811, 42, 1907, 55]\n rank 1: [811, 42, 1907, 55]\n rank 2: [811, 42, 1907, 55]\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\", \"EFFECTIVE_BATCH_MISMATCH\"], \"fix\": {\"grad_accum_steps\": 2, \"sampler\": \"DistributedSampler\"}}", "meta": "{\"archetype\": \"two_sampler_accum\", \"computations\": [\"R7\", \"R3\"], \"depth\": 3, \"interaction\": \"sampler+accum\", \"tier\": \"two_fault\"}"} {"id": "hard-optimizer_batch-005", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 3.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 40, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 80 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 22}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 36.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-014", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 2000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000465}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-shard_size-004", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 4, \"dataset_examples\": 20000, \"dataset_size_gb\": 50.0, \"examples_per_rank\": 20000, \"shard_size_gb\": 50.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 5000, \"shard_size_gb\": 12.5}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-lr_at_step-002", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 750 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 750 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000195}, \"work\": {\"step_fraction\": 0.75}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-batch_from_components-005", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 1.5, \"per_device_batch_size\": 38, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 2.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 28}, \"work\": {\"fixed_memory_gb\": 24.0, \"remaining_memory_gb\": 56.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-012", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 64; dataset 25600 examples; 3 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 1200}, \"work\": {\"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-optimizer_batch-008", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 4.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 50, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 80 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-009", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 7.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 1000}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 8}, \"work\": {\"checkpoint_size_gb\": 112.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-004", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 43, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 14 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 1056, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 8, \"per_device_batch_size\": 33}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 33}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-013", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000165}, \"work\": {\"step_fraction\": 0.5}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-009", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 50, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 128 GB VRAM.\nProfiler: activation memory per sample 1.5 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 42}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-zero_batch-009", "archetype": "zero_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 4.0, \"zero_stage\": 1, \"world_size\": 8, \"per_device_batch_size\": 86, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 192 GB VRAM.\nProfiler: activation memory per sample 2.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nThe run uses ZeRO. Compute the per-rank fixed memory with the runbook, then\nthe largest batch that fits on one rank.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param_per_rank\", \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ZERO_SHARDED_BATCH_SIZE\", \"fix\": {\"per_device_batch_size\": 78}, \"work\": {\"bytes_per_param_per_rank\": 9.0, \"fixed_memory_gb\": 36.0, \"remaining_memory_gb\": 156.0}}", "meta": "{\"archetype\": \"zero_batch\", \"computations\": [\"R19\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"zero x memory\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-000", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05, \"total_steps\": 2000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.0002325}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-001", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05}\nTraining plan: effective batch exactly 128; dataset 25600 examples;\n3 epochs. A checkpoint audit happens at step 150 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 150 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.0002325, \"grad_accum_steps\": 2, \"planned_total_steps\": 600}, \"work\": {\"audit_step\": 150, \"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-accum_and_steps-005", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 12800 examples; 4 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 8, \"planned_total_steps\": 400}, \"work\": {\"steps_per_epoch\": 100}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-training_time-009", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nPlanning question for a run that has not started:\ndataset 50000 examples, seq_len 2048, 3 epochs, throughput\n12000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.8888888888888888}, \"work\": {\"total_tokens\": 307200000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-008", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 43, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 14 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 528, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 8, \"per_device_batch_size\": 33}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 33}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-checkpoint_retention-005", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 3.0, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 500}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 10}, \"work\": {\"checkpoint_size_gb\": 48.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-004", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05}\nTraining plan: effective batch exactly 512; dataset 102400 examples;\n3 epochs. A checkpoint audit happens at step 300 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 300 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000165, \"grad_accum_steps\": 32, \"planned_total_steps\": 600}, \"work\": {\"audit_step\": 300, \"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-005", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 32, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 88, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 2, \"per_device_batch_size\": 22}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 22}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-008", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 2048, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 8.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 0.5}, \"work\": {\"total_padded_tokens\": 327680000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-014", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"per_device_batch_size\": 27, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 8.0 GB.\nTraining plan: effective batch size exactly 136, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 17}, \"work\": {\"activation_per_sample_gb\": 2.0, \"max_per_device_batch\": 17}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-packing_time-009", "archetype": "packing_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nPlanning question. Sequence packing is ON.\ndataset 80000 examples, average length 900 tokens, padded\nseq_len 1024, 2 epochs, throughput 10000 tokens/sec per GPU,\nworld_size 4.\nThe planner estimated planned_time_hours using padded tokens. Using the\nrunbook, what is the correct planned_time_hours with packing?\n\nAlso include a \"work\" object with these computed intermediates: \"total_real_tokens\", \"total_padded_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PACKED_TRAINING_TIME\", \"fix\": {\"planned_time_hours\": 1.0}, \"work\": {\"total_padded_tokens\": 163840000, \"total_real_tokens\": 144000000}}", "meta": "{\"archetype\": \"packing_time\", \"computations\": [\"R23\", \"R16\"], \"depth\": 4, \"interaction\": \"packing x time\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-013", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 3.0, \"per_device_batch_size\": 46, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 48.0, \"remaining_memory_gb\": 32.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-006", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 25600 examples;\n3 epochs. A checkpoint audit happens at step 150 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 150 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.00011, \"grad_accum_steps\": 32, \"planned_total_steps\": 300}, \"work\": {\"audit_step\": 150, \"steps_per_epoch\": 100}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-ckpt_batch_accum-009", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 40, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 10 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 4.0 GB.\nTraining plan: effective batch size exactly 240, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 30}, \"work\": {\"activation_per_sample_gb\": 1.0, \"max_per_device_batch\": 30}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-batch_from_components-014", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 4.0, \"per_device_batch_size\": 16, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 10}, \"work\": {\"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-007", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 16.0, \"tensor_parallel\": 4, \"pipeline_parallel\": 2, \"per_device_batch_size\": 80, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 64}, \"work\": {\"fixed_memory_gb\": 32.0, \"params_per_rank_billions\": 2.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-014", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 2, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 64000 examples;\n2 epochs. A checkpoint audit happens at step 250 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 250 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.00011, \"grad_accum_steps\": 8, \"planned_total_steps\": 500}, \"work\": {\"audit_step\": 250, \"steps_per_epoch\": 250}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-two_lora_vocab-004", "archetype": "two_lora_vocab", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"method\": \"lora\", \"lora_r\": 16, \"adapter_requires_grad\": false, \"base_model_frozen\": true, \"embedding_vocab_size\": 128000, \"tokenizer_vocab_size\": 128256}\nPreflight report:\n trainable params: 0\n forward smoke test: IndexError: index out of range in self (embedding lookup)\n max token id in tokenizer: 128255\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"ADAPTERS_FROZEN_ZERO_TRAINABLE\", \"EMBEDDING_VOCAB_MISMATCH\"], \"fix\": {\"adapter_requires_grad\": true, \"embedding_vocab_size\": 128256}}", "meta": "{\"archetype\": \"two_lora_vocab\", \"computations\": [\"R8\", \"R11\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-two_lora_vocab-003", "archetype": "two_lora_vocab", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"method\": \"lora\", \"lora_r\": 16, \"adapter_requires_grad\": false, \"base_model_frozen\": true, \"embedding_vocab_size\": 50257, \"tokenizer_vocab_size\": 50304}\nPreflight report:\n trainable params: 0\n forward smoke test: IndexError: index out of range in self (embedding lookup)\n max token id in tokenizer: 50303\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"ADAPTERS_FROZEN_ZERO_TRAINABLE\", \"EMBEDDING_VOCAB_MISMATCH\"], \"fix\": {\"adapter_requires_grad\": true, \"embedding_vocab_size\": 50304}}", "meta": "{\"archetype\": \"two_lora_vocab\", \"computations\": [\"R8\", \"R11\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-lr_at_step-009", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.00033}, \"work\": {\"step_fraction\": 0.5}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-batch_from_components-006", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"params_billions\": 4.0, \"per_device_batch_size\": 30, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 80 GB VRAM\nProfiler: activation memory per sample 1.5 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 10}, \"work\": {\"fixed_memory_gb\": 64.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-lr_at_step-008", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 750 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 750 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.000195}, \"work\": {\"step_fraction\": 0.75}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-000", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 8, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 256; dataset 51200 examples; 4 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 4, \"planned_total_steps\": 800}, \"work\": {\"steps_per_epoch\": 200}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-parallel_batch-011", "archetype": "parallel_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"params_billions\": 32.0, \"tensor_parallel\": 2, \"pipeline_parallel\": 4, \"per_device_batch_size\": 48, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\"}\nGPU: each rank has 96 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError on rank 0 at step 1.\nModel states are sharded across the tensor and pipeline parallel ranks.\nCompute the per-rank fixed memory, then the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"params_per_rank_billions\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"PARALLEL_SHARDED_BATCH\", \"fix\": {\"per_device_batch_size\": 32}, \"work\": {\"fixed_memory_gb\": 64.0, \"params_per_rank_billions\": 4.0}}", "meta": "{\"archetype\": \"parallel_batch\", \"computations\": [\"R22\", \"R13\", \"R1\"], \"depth\": 4, \"interaction\": \"parallelism x memory\", \"tier\": \"interacting\"}"} {"id": "hard-training_time-007", "archetype": "training_time", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nPlanning question for a run that has not started:\ndataset 80000 examples, seq_len 1024, 3 epochs, throughput\n20000 tokens/sec per GPU, world_size 8.\nThe config field planned_time_hours currently says 1. Using the runbook,\nwhat is the correct planned_time_hours?\n\nAlso include a \"work\" object with these computed intermediates: \"total_tokens\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"TRAINING_TIME_ESTIMATE\", \"fix\": {\"planned_time_hours\": 0.4266666666666667}, \"work\": {\"total_tokens\": 245760000}}", "meta": "{\"archetype\": \"training_time\", \"computations\": [\"R16\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-010", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 56, \"world_size\": 2, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 80 GB VRAM. Fixed memory per rank 10 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 368, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 46}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 46}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-011", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: code-instruct-90k\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0003, \"min_lr\": 2.9999999999999997e-05, \"total_steps\": 5000}\nLog: a checkpoint audit at step 1250 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 1250 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.0002325}, \"work\": {\"step_fraction\": 0.25}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_steps_lr-003", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"per_device_batch_size\": 4, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05}\nTraining plan: effective batch exactly 256; dataset 102400 examples;\n3 epochs. A checkpoint audit happens at step 600 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 600 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.00011, \"grad_accum_steps\": 16, \"planned_total_steps\": 1200}, \"work\": {\"audit_step\": 600, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-two_oom_clipping-002", "archetype": "two_oom_clipping", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: wiki-books-mix\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"per_device_batch_size\": 19, \"max_grad_norm\": 0.0, \"learning_rate\": 0.00002, \"warmup_ratio\": 0.03, \"dtype\": \"bf16\", \"gradient_checkpointing\": true}\nGPU: 1 x GPU with 40 GB VRAM\nProfiler: fixed memory 6 GB; activation memory per sample 2.5 GB.\nLog:\n step 40 loss=1.92 grad_norm=2.3\n step 41 loss=1.90 grad_norm=180\n step 42 loss=8.44 grad_norm=21.0\n step 52 torch.OutOfMemoryError: CUDA out of memory.\nThe corrected config must fix both problems seen in this one run.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"OOM_BATCH_TOO_LARGE\", \"NO_GRADIENT_CLIPPING\"], \"fix\": {\"max_grad_norm\": 1.0, \"per_device_batch_size\": 13}}", "meta": "{\"archetype\": \"two_oom_clipping\", \"computations\": [\"R1\", \"R12\"], \"depth\": 3, \"interaction\": \"oom+clipping\", \"tier\": \"two_fault\"}"} {"id": "hard-batch_from_components-002", "archetype": "batch_from_components", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"params_billions\": 1.5, \"per_device_batch_size\": 30, \"optimizer\": \"adamw\", \"mixed_precision\": \"bf16\", \"gradient_checkpointing\": false}\nGPU: 1 x GPU with 40 GB VRAM\nProfiler: activation memory per sample 1.0 GB at seq_len 2048.\nLog:\n torch.OutOfMemoryError: CUDA out of memory.\nThe fix is the largest per_device_batch_size that fits. Compute the fixed\nmemory from the parameter count using the runbook, do not guess it.\n\nAlso include a \"work\" object with these computed intermediates: \"fixed_memory_gb\", \"remaining_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"BATCH_FROM_MEMORY_COMPONENTS\", \"fix\": {\"per_device_batch_size\": 16}, \"work\": {\"fixed_memory_gb\": 24.0, \"remaining_memory_gb\": 16.0}}", "meta": "{\"archetype\": \"batch_from_components\", \"computations\": [\"R13\", \"R1\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-lr_at_step-010", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Lyra-1.5B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05, \"total_steps\": 1000}\nLog: a checkpoint audit at step 750 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 750 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 6.5e-05}, \"work\": {\"step_fraction\": 0.75}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-accum_and_steps-003", "archetype": "accum_and_steps", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [warn] pin_memory=True but no pinned buffers observed in profile\n\nConfig: {\"per_device_batch_size\": 16, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999}\nTraining plan: effective batch size exactly 128; dataset 32000 examples; 2 epochs.\nBoth grad_accum_steps and planned_total_steps in the config are wrong.\nCompute both correct values using the runbook.\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_AND_TOTAL_STEPS\", \"fix\": {\"grad_accum_steps\": 2, \"planned_total_steps\": 500}, \"work\": {\"steps_per_epoch\": 250}}", "meta": "{\"archetype\": \"accum_and_steps\", \"computations\": [\"R3\", \"R14\"], \"depth\": 3, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-two_v100_dataloader-002", "archetype": "two_v100_dataloader", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nIMPORTANT: this case has TWO independent faults. diagnosis must be a JSON array with both codes, for example {\"diagnosis\": [\"CODE_A\", \"CODE_B\"], \"fix\": {...}}, and fix must contain the corrected fields for both faults. Order of the codes does not matter.\n\nConfig: {\"dtype\": \"bf16\", \"use_grad_scaler\": false, \"dataloader_num_workers\": 8, \"dataloader_multiprocessing_context\": \"fork\"}\nGPU: NVIDIA V100 32GB\nDataset code: __init__ builds self.embed_cache = torch.zeros(..., device=\"cuda\").\nLog A:\n RuntimeError: \"bfloat16\" not implemented for this device / falling back to slow path\nLog B (after the team restarted with a device workaround):\n epoch 1 completes, then no output for 38 minutes, GPU util 0%, workers blocked.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": [\"PRECISION_UNSUPPORTED_ON_GPU\", \"DATALOADER_FORK_WITH_CUDA\"], \"fix\": {\"dataloader_multiprocessing_context\": \"spawn\", \"dtype\": \"fp16\", \"use_grad_scaler\": true}}", "meta": "{\"archetype\": \"two_v100_dataloader\", \"computations\": [\"R5\", \"R9\"], \"depth\": 2, \"interaction\": \"mixed\", \"tier\": \"two_fault\"}"} {"id": "hard-shard_size-010", "archetype": "shard_size", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Kite-27B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"world_size\": 2, \"dataset_examples\": 25000, \"dataset_size_gb\": 80.0, \"examples_per_rank\": 25000, \"shard_size_gb\": 80.0}\nLog: the launch script precomputes the two shard fields and both are wrong:\nevery rank loaded the entire dataset and two ranks OOMed on host RAM.\nCompute the correct examples_per_rank and shard_size_gb using the runbook.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"SHARD_SIZE_PER_RANK\", \"fix\": {\"examples_per_rank\": 12500, \"shard_size_gb\": 40.0}}", "meta": "{\"archetype\": \"shard_size\", \"computations\": [\"R18\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-optimizer_batch-007", "archetype": "optimizer_batch", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Vega-8B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n\nConfig: {\"params_billions\": 4.0, \"optimizer\": \"sgd_momentum\", \"per_device_batch_size\": 86, \"mixed_precision\": \"bf16\"}\nGPU: 1 x GPU with 128 GB VRAM.\nProfiler: activation memory per sample 1.0 GB.\nLog: torch.OutOfMemoryError at step 1.\nThis run does NOT use AdamW. Use the runbook bytes-per-parameter table for\nthis optimiser, then compute the largest batch that fits.\n\nAlso include a \"work\" object with these computed intermediates: \"bytes_per_param\", \"fixed_memory_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"OPTIMIZER_MEMORY_BATCH\", \"fix\": {\"per_device_batch_size\": 80}, \"work\": {\"bytes_per_param\": 12, \"fixed_memory_gb\": 48.0}}", "meta": "{\"archetype\": \"optimizer_batch\", \"computations\": [\"R21\", \"R1\"], \"depth\": 3, \"interaction\": \"optimizer x memory\", \"tier\": \"interacting\"}"} {"id": "hard-accum_steps_lr-008", "archetype": "accum_steps_lr", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: support-tickets-v3\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 8, \"world_size\": 4, \"grad_accum_steps\": 1, \"planned_total_steps\": 9999, \"schedule\": \"linear_decay\", \"peak_lr\": 0.0006, \"min_lr\": 5.9999999999999995e-05}\nTraining plan: effective batch exactly 512; dataset 204800 examples;\n2 epochs. A checkpoint audit happens at step 600 of the true schedule.\nCompute grad_accum_steps, planned_total_steps, and the learning rate the\naudit should see at step 600 (field current_learning_rate).\n\nAlso include a \"work\" object with these computed intermediates: \"steps_per_epoch\", \"audit_step\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"ACCUM_STEPS_AND_LR\", \"fix\": {\"current_learning_rate\": 0.000195, \"grad_accum_steps\": 16, \"planned_total_steps\": 800}, \"work\": {\"audit_step\": 600, \"steps_per_epoch\": 400}}", "meta": "{\"archetype\": \"accum_steps_lr\", \"computations\": [\"R3\", \"R14\", \"R15\"], \"depth\": 5, \"interaction\": \"accum x schedule\", \"tier\": \"interacting\"}"} {"id": "hard-lr_at_step-005", "archetype": "lr_at_step", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Atlas-13B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [info] torch version 2.4.1, cuda 12.4, nccl 2.21\n\nConfig: {\"schedule\": \"linear_decay\", \"peak_lr\": 0.0002, \"min_lr\": 2e-05, \"total_steps\": 5000}\nLog: a checkpoint audit at step 2500 shows the optimiser learning rate is\n0.000000 (the scheduler never stepped). What should the learning rate be at\nstep 2500 under this schedule? Give it as the field current_learning_rate.\n\nAlso include a \"work\" object with these computed intermediates: \"step_fraction\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"LR_VALUE_AT_STEP\", \"fix\": {\"current_learning_rate\": 0.00011}, \"work\": {\"step_fraction\": 0.5}}", "meta": "{\"archetype\": \"lr_at_step\", \"computations\": [\"R15\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-checkpoint_retention-014", "archetype": "checkpoint_retention", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Orion-3B\nDataset: med-notes-synth\nExtra log lines (may be unrelated):\n [warn] dataloader: 2 workers reported slow first batch (cold cache)\n [info] checkpoint saved to ./ckpt/step-500 (12.4 GB)\n\nConfig: {\"params_billions\": 1.5, \"max_checkpoints_to_keep\": 999, \"checkpoint_disk_budget_gb\": 200}\nLog: the checkpoint directory filled the disk and the run died at step 3100.\nFull checkpoints include optimiser state. Using the runbook, how many full\ncheckpoints fit in the disk budget? That is the correct max_checkpoints_to_keep.\n\nAlso include a \"work\" object with these computed intermediates: \"checkpoint_size_gb\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINT_RETENTION_LIMIT\", \"fix\": {\"max_checkpoints_to_keep\": 8}, \"work\": {\"checkpoint_size_gb\": 24.0}}", "meta": "{\"archetype\": \"checkpoint_retention\", \"computations\": [\"R17\"], \"depth\": 2, \"interaction\": null, \"tier\": \"computed\"}"} {"id": "hard-ckpt_batch_accum-011", "archetype": "ckpt_batch_accum", "split": "hard", "prompt": "You are debugging a failed or misbehaving LLM training run.\nPick exactly ONE diagnosis code and give the minimal fix: only the config fields that must change, with corrected values.\n\nDiagnosis codes:\n- OOM_BATCH_TOO_LARGE\n- ACTIVATION_MEMORY_NO_CHECKPOINTING\n- EFFECTIVE_BATCH_MISMATCH\n- LR_TOO_HIGH_NO_WARMUP\n- PRECISION_UNSUPPORTED_ON_GPU\n- FP16_NO_GRAD_SCALER\n- DUPLICATE_DATA_NO_DISTRIBUTED_SAMPLER\n- ADAPTERS_FROZEN_ZERO_TRAINABLE\n- DATALOADER_FORK_WITH_CUDA\n- DEVICE_MISMATCH_LOSS\n- EMBEDDING_VOCAB_MISMATCH\n- NO_GRADIENT_CLIPPING\n- BATCH_FROM_MEMORY_COMPONENTS\n- ACCUM_AND_TOTAL_STEPS\n- LR_VALUE_AT_STEP\n- TRAINING_TIME_ESTIMATE\n- CHECKPOINT_RETENTION_LIMIT\n- SHARD_SIZE_PER_RANK\n- ZERO_SHARDED_BATCH_SIZE\n- CHECKPOINTED_BATCH_AND_ACCUM\n- PACKED_TRAINING_TIME\n- OPTIMIZER_MEMORY_BATCH\n- ACCUM_STEPS_AND_LR\n- PARALLEL_SHARDED_BATCH\n\nRunbook (applies to all runs):\nR1. Total memory = fixed (weights+optimizer+grads) + batch * per-sample activations. Must fit in VRAM. Use the largest batch that fits.\nR2. If batch is already 1 and activations are >80% of memory, gradient checkpointing fixes activation memory.\nR3. effective_batch = per_device_batch_size * world_size * grad_accum_steps.\nR4. Full fine-tuning: max stable learning_rate is 2e-5 with warmup_ratio 0.03. Sustained divergence to NaN with no preceding grad spike means the rate is too high.\nR5. V100 (Volta) has no BF16 support. On V100 use FP16, and FP16 requires a gradient scaler (R6).\nR6. FP16 without a gradient scaler: gradients shrink toward 1e-8 and loss plateaus, while trainable params are > 0.\nR7. Distributed training: each rank must get a disjoint shard, which requires DistributedSampler.\nR8. LoRA: base model frozen is correct, but adapters must have requires_grad true. trainable params = 0 means nothing can learn and loss is exactly constant.\nR9. If the dataset initialises CUDA in __init__, dataloader workers must use multiprocessing context \"spawn\"; \"fork\" after CUDA init deadlocks (hang, no error).\nR10. Loss must be computed on the same device as the model outputs.\nR11. embedding_vocab_size must equal tokenizer_vocab_size exactly (tokenizers gain special tokens after model creation).\nR12. A single-step loss jump immediately after a grad_norm spike (>50) is a clipping problem: set max_grad_norm to 1.0. 0.0 disables clipping. Check the learning rate is at its R4 value before blaming R4.\nR13. Mixed-precision AdamW fixed memory is 16 bytes per parameter in total: bf16 weights 2 + bf16 grads 2 + fp32 master weights 4 + Adam m 4 + Adam v 4. Fixed GB = params_in_billions * 16.\nR14. steps_per_epoch = dataset_examples / effective_batch. total_steps = steps_per_epoch * epochs.\nR15. Linear decay schedule: lr_at_step = peak_lr - (peak_lr - min_lr) * (step / total_steps).\nR16. total_tokens = dataset_examples * seq_len * epochs. time_hours = total_tokens / (tokens_per_sec_per_gpu * world_size) / 3600.\nR17. A full checkpoint is 16 bytes per parameter (same components as R13). max_checkpoints_to_keep = floor(disk_budget_GB / checkpoint_GB).\nR18. Data sharding: examples_per_rank = dataset_examples / world_size. shard_size_gb = dataset_size_gb / world_size.\nR19. ZeRO sharding of the 16 bytes per parameter (R13), per rank: ZeRO-1 shards optimiser states (8 bytes): 8 + 8/world_size bytes per param. ZeRO-2 also shards gradients (2 more): 6 + 10/world_size. ZeRO-3 shards everything: 16/world_size.\nR20. Gradient checkpointing reduces activation memory per sample to 25% of its uncheckpointed value.\nR21. Bytes per parameter by optimiser (weights 2 + grads 2 + fp32 master 4 included): AdamW 16 total (m and v are fp32, 8 bytes). AdamW-8bit 10 total (states are 1 byte each). SGD with momentum 12 total (fp32 momentum, 4 bytes). Adafactor 8 total (factored states, ~0 bytes).\nR22. Tensor and pipeline parallelism shard all model states: params_per_rank = total_params / (tp * pp), and fixed memory per rank is params_per_rank * 16 (R13).\nR23. Sequence packing: real tokens = dataset_examples * avg_len; padded tokens = dataset_examples * seq_len. With packing on, the tokens actually processed are the real tokens, and R16 time uses those.\n\nModel: Nova-7B\nDataset: chat-logs-anon\nExtra log lines (may be unrelated):\n [warn] pin_memory=True but no pinned buffers observed in profile\n [warn] tokenizers: sequence length 2048 is longer than model default 1024 (truncation off)\n\nConfig: {\"per_device_batch_size\": 32, \"world_size\": 4, \"grad_accum_steps\": 1, \"gradient_checkpointing\": true, \"dtype\": \"bf16\"}\nGPU: each rank has 40 GB VRAM. Fixed memory per rank 6 GB.\nProfiler: activation memory per sample WITHOUT checkpointing 6.0 GB.\nTraining plan: effective batch size exactly 352, checkpointing stays on.\nCompute the largest per-device batch that fits WITH checkpointing, and the\ngrad_accum_steps that reaches the target effective batch.\n\nAlso include a \"work\" object with these computed intermediates: \"activation_per_sample_gb\", \"max_per_device_batch\". Each must be a number.\n\n\nAnswer with ONLY a JSON object, no prose, in this exact shape:\n{\"diagnosis\": \"\", \"work\": {\"\": }, \"fix\": {\"\": }}\nBooleans must be true/false, numbers must be numbers, strings quoted.", "gold": "{\"diagnosis\": \"CHECKPOINTED_BATCH_AND_ACCUM\", \"fix\": {\"grad_accum_steps\": 4, \"per_device_batch_size\": 22}, \"work\": {\"activation_per_sample_gb\": 1.5, \"max_per_device_batch\": 22}}", "meta": "{\"archetype\": \"ckpt_batch_accum\", \"computations\": [\"R20\", \"R1\", \"R3\"], \"depth\": 4, \"interaction\": \"checkpointing x accum\", \"tier\": \"interacting\"}"}