diffusion_baseline / upstreams /candi /configs /conditional_eval.yaml
jyliuAI's picture
Add files using upload-large-folder tool
93cd35a verified
Raw History Blame Contribute Delete
3.08 kB
defaults:
- _self_
- /callbacks: [checkpoint_every_n_steps, checkpoint_monitor, learning_rate_monitor]
- /data: text8
- /model: tiny
- /strategy: ddp
- /noise: log-linear
- /lr_scheduler: constant
- /prior: none
- /algo: candi
mode: train # train / ppl_eval / sample_eval
seed: 1
scratch_dir: /home/patrick/.cache/discrete_diffusion
batch_size: 512
loader:
global_batch_size: ${batch_size}
eval_global_batch_size: 64
# Note: batch_size and eval_batch_size are **per machine**
batch_size: ${div_up:${.global_batch_size}, ${eval:${trainer.devices} * ${trainer.num_nodes} * ${trainer.accumulate_grad_batches}}}
eval_batch_size: ${div_up:${.eval_global_batch_size}, ${eval:${trainer.devices} * ${trainer.num_nodes} * ${trainer.accumulate_grad_batches}}}
num_workers: 4
pin_memory: True
sampling:
predictor: ancestral_cache # ancestral_cache (only for MDLM), ancestral, analytic
steps: 1024
noise_removal: ancestral # 'ancestral', 'greedy', 'none'
use_float64: True
p_nucleus: 1.0
num_sample_batches: 2 # Total samples: `num_gpus` * `loader.eval_batch_size` * num_sample_batches
num_sample_log: 2
semi_ar: False
stride_length: 1
num_strides: 1
training:
ema: 0.9999
antithetic_sampling: True
importance_sampling: False
sampling_eps: 1e-3
change_of_variables: False
loss_precision: 'float32' # bf16, float32, float64
finetune_path: ''
eval:
checkpoint_path: '' # Used to evaluate a checkpoint after training.
disable_ema: False
compute_generative_perplexity: False
perplexity_batch_size: 8
compute_perplexity_on_sanity: False
gen_ppl_eval_model_name_or_path: gpt2-large # gpt2-large, meta-llama/Llama-2-7b-hf
generate_samples: True
generated_samples_path: ${cwd:}/samples.json
num_conditional_samples: 128
conditional_batch_size: 128
revealed_fraction: 0.5
prompt_type: "prefix"
optim:
weight_decay: 0
lr: 1e-3
beta1: 0.9
beta2: 0.999
eps: 1e-8
trainer:
_target_: lightning.Trainer
accelerator: cuda
num_nodes: 1
devices: ${device_count:}
accumulate_grad_batches: 4
gradient_clip_val: 1.0
precision: 'bf16'
num_sanity_val_steps: 2
max_steps: 1_000_000
log_every_n_steps: 100
limit_train_batches: 1.0 # train on full dataset, can be used to toggle quick run
limit_val_batches: 1.0 # validate on full dataset, can be used to toggle quick run
val_check_interval: 10000
wandb:
project: flow-ode
notes: Flow ODEs for UDLM
group: null
job_type: null
name: null
id: null
tags:
- ${noise.type}
- ${data.train}
- ${data.valid}
- ${algo.name}
hydra:
run:
dir: ${scratch_dir}/${data.train}/${now:%Y.%m.%d}/${now:%H%M%S}
# dir: /home/patrick/.cache/text8/text8/2025.04.26/000214/
job:
chdir: true
checkpointing:
# Use custom `save_dir` if, e.g., saving to S3 bucket, otherwise leave this parameter as is
save_dir: ${cwd:}
# Note: `checkpoints` path should correspond to `checkpoint_every_n_steps.dirpath`
resume_from_ckpt: true
resume_ckpt_path: ${.save_dir}/checkpoints/last.ckpt