# @package _global_ # # OpenCode / R2E-Gym on Qwen3-Coder-30B-A3B-Instruct, 4-node H20. # # Set before launching: checkpoint_path, hf_model_path, data_source.dataset.prompt_data_path. # The first two must live on storage reachable by every node. # hf download Qwen/Qwen3-Coder-30B-A3B-Instruct --local-dir # hf download loongsage/R2E-Gym --include "opencode/data/*.parquet" --repo-type=dataset --local-dir # # Launch: # bash examples/start_ray_cluster.sh # on every node first # bash examples/start.sh qwen3_coder_30b_a3b/opencode_h20_4node defaults: - /default - _self_ checkpoint_path: ??? hf_model_path: ??? colocate: true total_steps: 300 data_source: sandbox: type: k8s command_exec_timeout_seconds: 3600 sandbox_creation_timeout_seconds: 600 # R2E-Gym repositories live under /testbed. working_dir: /testbed kubeconfig: k8s/kubeconfig.yaml pod_manifest_path: k8s/pod_manifest.yaml dataset: prompt_data_path: ??? data_pre_processor: r2e_gym input_key: prompt label_key: label metadata_key: metadata agent: name: opencode # Qwen3-Coder-30B-A3B-Instruct has a native 262144 (256K) context. 64K is # restored because 32K pushed OpenCode to auto-compact early and fork a # storm of subagents. Activation memory is bounded by CP=2 instead: with # use_dynamic_batch_size=false and micro_batch_size=1 one full trajectory # is one microbatch, and CP splits that single sequence across 2 GPUs. context_length: 65536 max_output_tokens: 32768 reward: name: r2e_gym num_trajectories_per_prompt: 8 num_prompts_per_step: 32 max_response_len_per_trajectory: 63488 rollout: retry_limit: 5 num_gpus_per_node: 8 partial: true mask_offpolicy_in_partial_rollout: true sampler: num_oversample: 4 sglang_replicas: regular: num_nodes: 4 num_gpus_per_replica: 8 sglang_args: # Qwen3-Coder-30B-A3B is MoE: tensor + expert parallelism. tp_size: 8 ep_size: 8 mem_fraction_static: 0.8 disable_cuda_graph: false # skip_server_warmup: false # enable_fp32_lm_head: false # max_prefill_tokens: 16384 use_fault_tolerance: true agentflow: dump_trajectory_path: "log/trajectories" router: proxy_timeout_seconds: 1800 tokenizer: generation_prompt_kwargs: {} trainer: num_gpus_per_node: 8 num_nodes: 4 mini_batch_size: 64 micro_batch_size: 2 max_tokens_per_gpu: 8192 use_dynamic_batch_size: true save_freq: 5 # Routing replay (R3) is MoE-only; Qwen3-Coder-30B-A3B is MoE. use_rollout_routing_replay: true use_fp32_lm_head: true megatron: model: # Qwen3-Coder-30B-A3B is MoE: tensor + expert parallelism (mirrors the # proven opencode-swe-rebench setup for this same model). tensor_model_parallel_size: 1 pipeline_model_parallel_size: 2 virtual_pipeline_model_parallel_size: null # CP=2 splits each sequence along the token dimension across 2 GPUs, so a # single long trajectory's activation is halved per GPU (the only way to # shard ONE sequence — dynamic batching can't). Requires 16 GPUs across 2 # nodes: TP1 x PP1 x EP8 x CP2 x DP1. context_parallel_size: 2 expert_model_parallel_size: 8 expert_tensor_parallel_size: 1 dsa_indexer_loss_coeff: 0.0 apply_dsa_kernel_fusion: true recompute_granularity: full # selective|full recompute_method: uniform recompute_num_layers: 1 optimizer: lr: 5.0e-7 optimizer_cpu_offload: true optimizer_offload_fraction: 1 algorithm: advantage_estimator: grpo advantage_norm_mode: group_zscore policy_loss: grpo loss_agg_mode: seq-mean-token-mean #clip_ratio_low: 3e-4 #clip_ratio_high: 4e-4 is_correction: enable: false action: mask level: token lower_bound: 0.5 upper_bound: 2