Jaswanth1210 Claude Sonnet 4.6 commited on
Commit
aaa7c61
·
1 Parent(s): b7d3a14

fix: dtype kwarg (torch_dtype deprecated), vLLM max_model_len=4096

Browse files

- grpo_train: torch_dtype → dtype (transformers 4.45+ renamed it)
- secalign_agent: add max_model_len=4096 to vLLM LLM() init; vLLM was
trying to allocate KV cache for full 131072-token context (16 GiB)
but only 5.4 GiB is free after Qwen bf16 occupies ~3 GiB. With
max_model_len=4096 the KV cache drops to ~500 MB — fits easily.
SecAlign agent tasks never need more than 4096 tokens.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

env/defenses/secalign_agent.py CHANGED
@@ -84,6 +84,7 @@ class SecAlignAgent:
84
  max_lora_rank=64,
85
  trust_remote_code=True,
86
  gpu_memory_utilization=self._gpu_memory_utilization,
 
87
  )
88
  self._sampling_params = SamplingParams(
89
  temperature=0.0,
 
84
  max_lora_rank=64,
85
  trust_remote_code=True,
86
  gpu_memory_utilization=self._gpu_memory_utilization,
87
+ max_model_len=4096,
88
  )
89
  self._sampling_params = SamplingParams(
90
  temperature=0.0,
train/grpo_train.py CHANGED
@@ -115,7 +115,7 @@ def _load_model_and_tokenizer(model_id: str, seed: int):
115
 
116
  model = AutoModelForCausalLM.from_pretrained(
117
  model_id,
118
- torch_dtype=torch.bfloat16,
119
  device_map="auto",
120
  trust_remote_code=True,
121
  )
 
115
 
116
  model = AutoModelForCausalLM.from_pretrained(
117
  model_id,
118
+ dtype=torch.bfloat16,
119
  device_map="auto",
120
  trust_remote_code=True,
121
  )