rl4phyx-backup / root_scripts /check_verl_structure.py
YUNTA88's picture
Upload root_scripts/check_verl_structure.py with huggingface_hub
a0810f6 verified
import os, sys
# 1. Find veRL install location
import verl
verl_dir = os.path.dirname(verl.__file__)
print(f"veRL dir: {verl_dir}")
# 2. Check main_ppo entry point
main_ppo = os.path.join(verl_dir, "trainer", "main_ppo.py")
if os.path.exists(main_ppo):
with open(main_ppo) as f:
content = f.read()
print(f"\nmain_ppo.py ({len(content)} chars):")
for i, line in enumerate(content.split("\n"), 1):
if any(k in line.lower() for k in ["compute_score", "reward", "data_domain", "def run", "def main"]):
print(f" L{i}: {line.rstrip()[:100]}")
else:
print(f"main_ppo.py not found at {main_ppo}")
# 3. Check model registry
reg = os.path.join(verl_dir, "models", "registry.py")
if os.path.exists(reg):
with open(reg) as f:
lines = f.readlines()
print(f"\nregistry.py ({len(lines)} lines):")
for i, line in enumerate(lines, 1):
if "qwen" in line.lower() or "supported" in line.lower() or "rmpad" in line.lower():
print(f" L{i}: {line.rstrip()[:100]}")
# 4. Check vLLM third_party
tp = os.path.join(verl_dir, "third_party", "vllm")
if os.path.isdir(tp):
print(f"\nthird_party/vllm/ contents:")
for f in os.listdir(tp):
print(f" {f}")
init = os.path.join(tp, "__init__.py")
if os.path.exists(init):
with open(init) as fh:
content = fh.read()
print(f"\nvllm __init__.py ({len(content)} chars):")
for i, line in enumerate(content.split("\n"), 1):
if any(k in line for k in ["version", "import", "0.6", "0.7", "spmd", "qwen"]):
print(f" L{i}: {line.rstrip()[:100]}")
else:
print(f"\nNo third_party/vllm dir")
# 5. Check if there's a reward_score util
rs = os.path.join(verl_dir, "utils", "reward_score")
if os.path.isdir(rs):
print(f"\nutils/reward_score/ contents:")
for root, dirs, files in os.walk(rs):
for f in files:
print(f" {os.path.relpath(os.path.join(root, f), rs)}")