Codex interface with Purdue HPCs
Scratch working directory:
/scratch/gautschi/rmaulik/codex_test
Repo-managed scripts (mirror these into scratch):
mnist_diffusion.pysubmit_mnist_diffusion.slurmrequirements.txt
mkdir -p /scratch/gautschi/rmaulik/codex_test
cd /scratch/gautschi/rmaulik/codex_test
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtcd /scratch/gautschi/rmaulik/codex_test
source .venv/bin/activate
python mnist_diffusion.py --epochs 5 --batch-size 128 --num-workers 8 --outdir outputscd /scratch/gautschi/rmaulik/codex_test
sbatch submit_mnist_diffusion.slurm
squeue -u rmaulikNotes:
- The script targets partition
aiand requests 1 GPU with 14 CPUs (required ratio on Gautschi AI partition). - Generated images and checkpoints are written to
outputs/. - The script now runs posterior sampling after training for partial observations (default: 70% observed pixels).
Submit a longer run:
cd /scratch/gautschi/rmaulik/codex_test
sbatch submit_mnist_diffusion_long.slurmThis writes a run folder under outputs/<run_tag>/ with:
dashboard.htmlmnist_samples.pngloss_curve_step.pngloss_curve_epoch.pngarchitecture_schematic.pngposterior_conditioning_overview.pngposterior_samples.pngloss_history.csvmetrics.json
Serve the latest run on Gautschi:
cd /scratch/gautschi/rmaulik/codex_test
./serve_dashboard.shFrom your local machine, open an SSH tunnel and browse:
ssh -N -L 8080:localhost:8080 rmaulik@gautschi.rcac.purdue.eduThen open:
http://localhost:8080/dashboard.html
Notes:
http://localhost:8080/dashboard.htmlnow serves a live root dashboard that always followsoutputs/LATEST_RUN.txtandoutputs/current.- The run dashboard refreshes periodically and supports click-to-zoom controls (
+,-,reset) on images. - Refresh polling stops automatically when the run status becomes
completed.
Posterior sampling is likelihood-guided and configured via:
--posterior-digit(default7)--posterior-observed-fraction(default0.7)--posterior-guidance-scale(default1.5)--posterior-guidance-min-frac(default0.25, low-noise-end guidance floor as a fraction of full scale)--posterior-guidance-power(default1.5, annealing exponent for timestep-dependent guidance)--posterior-likelihood-sigma(default0.1)--posterior-noise-aware-coeff(default0.05, adds timestep noise term to effective likelihood variance)--posterior-disable-hard-consistency(if set, disables projection/data-consistency on observed pixels)--num-posterior-samples(default8)
Current posterior sampler improvements:
- Noise-aware likelihood variance scheduling with timestep-dependent effective sigma.
- Guidance annealing across denoising steps.
- Hard data-consistency projection on observed pixels during reverse sampling.
