From d43a9e2b3c53685c9346e66a83f986af70a6604f Mon Sep 17 00:00:00 2001 From: "ys1087@partner.kit.edu" Date: Wed, 27 Aug 2025 12:23:43 +0200 Subject: [PATCH] Fix WandB configuration for proper logging - Configure DPPO_WANDB_ENTITY environment variable in dev script - Update README with clear WandB setup instructions - Remove wandb=null to enable logging when credentials are set --- README.md | 14 +++++++++++--- slurm/run_dppo_dev.sh | 13 +++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0225c1b..b81bac0 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,22 @@ tail -f logs/dppo_.out ### Configuration -Before running experiments, set your WandB credentials: +**Required for WandB logging**: Set your credentials as environment variables before submitting jobs: ```bash +# Set these in your shell before running experiments export WANDB_API_KEY= -export WANDB_ENTITY= +export DPPO_WANDB_ENTITY= + +# Then submit jobs normally +./submit_job.sh dev ``` -Or disable WandB by adding `wandb=null` to your python command. +**Alternative**: Modify the SLURM scripts directly to set your credentials: +- Edit `slurm/run_dppo_dev.sh` and replace `"your_wandb_username"` with your actual WandB username +- Uncomment and set `WANDB_API_KEY` in the scripts + +**Disable WandB**: Add `wandb=null` to python commands if you don't want logging. ### Repository Changes diff --git a/slurm/run_dppo_dev.sh b/slurm/run_dppo_dev.sh index 1487154..685c37f 100755 --- a/slurm/run_dppo_dev.sh +++ b/slurm/run_dppo_dev.sh @@ -14,11 +14,12 @@ # Load required modules module load devel/cuda/12.4 -# Set environment variables +# Set environment variables for WandB export WANDB_MODE=online export WANDB_PROJECT=dppo_dev_test -# export WANDB_API_KEY= # TODO: Set your API key -# export WANDB_ENTITY= # TODO: Set your entity (username or team) +export DPPO_WANDB_ENTITY=${DPPO_WANDB_ENTITY:-"your_wandb_username"} # TODO: Set your WandB username +# TODO: Set your WandB API key as environment variable: +# export WANDB_API_KEY= # Default paths (can be overridden by environment) export DPPO_DATA_DIR=${DPPO_DATA_DIR:-$SLURM_SUBMIT_DIR/data} @@ -41,11 +42,11 @@ echo "PyTorch version: $(python -c 'import torch; print(torch.__version__)')" echo "CUDA available: $(python -c 'import torch; print(torch.cuda.is_available())')" echo "" -# Run a quick pre-training test with reduced epochs (disable WandB for dev test) +# Run a quick pre-training test with reduced epochs +# Note: Will only log to WandB if WANDB_API_KEY and DPPO_WANDB_ENTITY are properly set python script/run.py --config-name=pre_diffusion_mlp \ --config-dir=cfg/gym/pretrain/hopper-medium-v2 \ train.n_epochs=2 \ - train.save_model_freq=1 \ - wandb=null + train.save_model_freq=1 echo "Dev test completed!" \ No newline at end of file