Support DeepSWE on MaxText models in Tunix - #2051
Conversation
| images = self._extract_images(batch) | ||
| if images and self.fleet: | ||
| target_replicas = ( | ||
| self.max_warmpool_size |
There was a problem hiding this comment.
nit: this can be self.max_warmpool_size or self.num_generations
| NODE_SELECTOR_VAL = args.node_selector_val | ||
|
|
||
|
|
||
| # Monkeypatch r2egym DockerRuntime to dynamically configure Kubernetes nodeSelector. |
There was a problem hiding this comment.
put this this in a standalone r2e_gym_helper.py file? so we can reuse it later
There was a problem hiding this comment.
I also realized I didn't need the agentic sandbox patch. Only the patch for overriding the node selector in r2egym.
| "Fatal error in runner for pair %d: %s", | ||
| env.extra_kwargs["pair_index"], | ||
| "Fatal error in runner for pair %s: %s", | ||
| env.extra_kwargs.get("pair_index", "unknown"), |
There was a problem hiding this comment.
when will pair_index be None?
There was a problem hiding this comment.
I removed this entirely. It's possible this was happening in certain conditoins that are not common.
|
|
||
| RUN bash /app/scripts/install_tunix_vllm_requirement.sh | ||
| # Install SFT/MaxText dependencies (unconditional) | ||
| RUN pip install --upgrade flax && \ |
| max_concurrent=effective_max_concurrent, | ||
| window_size=batch_size, | ||
| max_warmpool_size=num_generations, | ||
| max_warmpool_size=max_warmpool_size if max_warmpool_size is not None else num_generations, |
There was a problem hiding this comment.
Is it better to use max_concurrency here?
There was a problem hiding this comment.
That will likely not be right? max_concurrency for my script is 256, but I want two replicas per stream so I set max_warmpool_size to 2 so that I have 512 sandboxes with 256 on standby at a time.
There was a problem hiding this comment.
I see, so the max_warmpool_size is per image. The naming is a bit misleading. nit, maybe max_warmpool_per_stream or per_image?
|
Hi Nitin, please squash the commits into one before submission. |
- Add train_maxtext_nb for agentic GRPO training with MaxText and vLLM. - Add r2e_gym_helper with nodeSelector patching for Kubernetes execution on GKE. - Add max_warmpool_size to swe_env to allow limiting warm pool replicas. - Pass tokenizer_pad_id in AutoModel for MaxText causal LM loading. - Update Dockerfile to optimize layer caching and configure DeepSWE MaxText dependencies.
-- f98e5632d4fc224a1b0213709b867cceee35e165 by Nitin Gangahar <niting@google.com>: Support DeepSWE on MaxText models in Tunix - Add train_maxtext_nb for agentic GRPO training with MaxText and vLLM. - Add r2e_gym_helper with nodeSelector patching for Kubernetes execution on GKE. - Add max_warmpool_replicas to swe_env to allow limiting warm pool replicas. - Pass tokenizer_pad_id in AutoModel for MaxText causal LM loading. - Update Dockerfile to optimize layer caching and configure DeepSWE MaxText dependencies. COPYBARA_INTEGRATE_REVIEW=#2051 from niting:deepswe f98e5632d4fc224a1b0213709b867cceee35e165 PiperOrigin-RevId: 974800060
|
This was merged separately: https://github.com/google/tunix/blob/main/examples/deepswe/train_maxtext_nb.py, due to some shenanigans with our internal (Google) importer. Closing this PR out. |
Primarily adds a script train_maxtext_nb.py that uses MaxText models on a DeepSWE setup. The DeepSWE setup uses agentic sandboxes which maintains warmpools for faster training execution. Modifies Dockerfile accordingly to install necessary dependencies, adds a flag to swe_env.py to allow limiting warmpool replicas. Makes various robustness fixes for error logging etc.