Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/workers/critic/test_special_dp_critic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import tempfile
import unittest
from unittest.mock import Mock, patch
Expand Down Expand Up @@ -60,7 +60,8 @@ def setUp(self):
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
self.temp_dir = tempfile.mkdtemp()

config = AutoConfig.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct")
config = AutoConfig.from_pretrained(model_path)
config.save_pretrained(self.temp_dir)

self.config = FSDPCriticConfig(
Expand All @@ -76,8 +77,8 @@ def setUp(self):
rollout_n=1,
optim=FSDPOptimizerConfig(lr=1e-6),
model=FSDPCriticModelCfg(
path="Qwen/Qwen2.5-0.5B-Instruct",
tokenizer_path="Qwen/Qwen2.5-0.5B-Instruct",
path=model_path,
tokenizer_path=model_path,
fsdp_config=FSDPEngineConfig(fsdp_size=-1),
use_remove_padding=False,
),
Expand Down
8 changes: 5 additions & 3 deletions tests/workers/test_fsdp_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ def test_actor_rollout_ref_worker_actor_ref_model():
os.environ["MASTER_ADDR"] = "127.0.0.1"
os.environ["MASTER_PORT"] = "8888"

config_str = """
actor_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct")
ref_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-1.5B-Instruct")
config_str = f"""
model:
path: Qwen/Qwen2.5-0.5B-Instruct
path: {actor_model_path}
actor:
_target_: verl.workers.config.FSDPActorConfig
strategy: fsdp
Expand All @@ -45,7 +47,7 @@ def test_actor_rollout_ref_worker_actor_ref_model():
stack_depth: 32
ref:
model:
path: Qwen/Qwen2.5-1.5B-Instruct
path: {ref_model_path}
fsdp_config:
_target_: verl.workers.config.FSDPEngineConfig
fsdp_size: -1
Expand Down