B=64
N=8
L=1024

export VLLM_SERVER_HOSTNAME=cr1-h200-p5en48xlarge-360

python3 -m verl.trainer.main_ppo \
    algorithm.adv_estimator=grpo \
    data.train_files=/checkpoint/ram/tianjian/wildchat10k.parquet \
    data.val_files=/checkpoint/ram/tianjian/creative_writing_data/valid.parquet \
    data.prompt_key="prompt" \
    data.train_batch_size=${B} \
    data.max_prompt_length=512 \
    data.max_response_length=${L} \
    data.filter_overlong_prompts=True \
    data.truncation='error' \
    actor_rollout_ref.model.path=/datasets/pretrained-llms/Llama-3.1-8B-Instruct \
    actor_rollout_ref.actor.optim.lr=1e-6 \
    actor_rollout_ref.model.use_remove_padding=True \
    actor_rollout_ref.actor.ppo_max_token_len_per_gpu=20000 \
    actor_rollout_ref.actor.use_dynamic_bsz=True \
    actor_rollout_ref.actor.use_kl_loss=True \
    actor_rollout_ref.actor.kl_loss_coef=0.001 \
    actor_rollout_ref.actor.kl_loss_type=low_var_kl \
    actor_rollout_ref.actor.entropy_coeff=0 \
    actor_rollout_ref.model.enable_gradient_checkpointing=True \
    actor_rollout_ref.actor.fsdp_config.param_offload=False \
    actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \
    actor_rollout_ref.rollout.log_prob_use_dynamic_bsz=True \
    actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
    actor_rollout_ref.rollout.name=vllm \
    actor_rollout_ref.rollout.gpu_memory_utilization=0.7 \
    actor_rollout_ref.rollout.n=${N} \
    actor_rollout_ref.rollout.val_kwargs.n=8 \
    actor_rollout_ref.rollout.val_kwargs.do_sample=True \
    actor_rollout_ref.rollout.temperature=1.0 \
    actor_rollout_ref.rollout.val_kwargs.temperature=1.0 \
    actor_rollout_ref.ref.log_prob_use_dynamic_bsz=True \
    actor_rollout_ref.ref.fsdp_config.param_offload=True \
    algorithm.use_kl_in_reward=False \
    algorithm.norm_adv_by_std_in_grpo=False \
    reward_model.reward_manager=diversity \
    reward_model.enable=True \
    reward_model.model.input_tokenizer=/checkpoint/ram/tianjian/reward_models/Athene-RM-8B \
    reward_model.model.path=/checkpoint/ram/tianjian/reward_models/Athene-RM-8B \
    reward_model.micro_batch_size_per_gpu=16 \
    trainer.critic_warmup=0 \
    trainer.logger=['console','wandb'] \
    trainer.project_name='llama_70b_wildchat' \
    trainer.experiment_name=partiton_multiplicative_no_norm \
    trainer.n_gpus_per_node=4 \
    trainer.nnodes=1 \
    trainer.save_freq=200 \
    trainer.test_freq=200 \
    trainer.default_local_dir=/checkpoint/ram/tianjian/llama_70b_wildchat/wildchat10k_quality_partition_multiplicative_no_norm_b${B}_n${N}_l${L}_new \
    trainer.validation_data_dir=/checkpoint/ram/tianjian/llama_70b_wildchat/wildchat10k_quality_partition_multiplicative_no_norm_b${B}_n${N}_l${L}_new/rollouts \
    trainer.total_epochs=8 $@ +reward_model.multiplicative=True \
    +reward_model.custom_diversity_function.path=/home/$USER/darling/verl/verl/utils/reward_score/partition_reward_vllm_serve_modernbert.py \
    +reward_model.custom_diversity_function.name=partition 
