Skip to content

fix: add cd to SLIME_ROOT and derive MEGATRON_ROOT dynamically#21

Open
JasonOA888 wants to merge 2 commits intoGen-Verse:mainfrom
JasonOA888:fix/add-cd-to-slime-root
Open

fix: add cd to SLIME_ROOT and derive MEGATRON_ROOT dynamically#21
JasonOA888 wants to merge 2 commits intoGen-Verse:mainfrom
JasonOA888:fix/add-cd-to-slime-root

Conversation

@JasonOA888
Copy link

Fixes #5, Fixes #3

Summary

  • Add cd "${SLIME_ROOT}" before train_async.py calls
  • Derive MEGATRON_ROOT dynamically instead of hardcoded path

Changes

  • openclaw-rl/run_qwen3_4b_openclaw_rl.sh
  • openclaw-opd/run_qwen3_4b_openclaw_opd.sh

Test plan

  • Verified paths resolve correctly
  • Pattern matches existing SLIME_ROOT computation

Fixes Gen-Verse#5

## Summary
- train_async.py requires the working directory to be slime/, otherwise it cannot find the necessary modules and configs
- Added cd "${SLIME_ROOT}" after sourcing the model config in all three training scripts

## Changes
- openclaw-rl/run_qwen3_4b_openclaw_rl.sh
- openclaw-opd/run_qwen3_4b_openclaw_opd.sh
- openclaw-opd/run_qwen3_4b_openclaw_opd_topk.sh

Each script now includes:
```bash
source "${SLIME_ROOT}/scripts/models/qwen3-4B.sh"
cd "${SLIME_ROOT}"
echo "Current Working Directory: $(pwd)"
```

## Test plan
- [x] Verified cd command is added after source
- [x] Verified SLIME_ROOT variable is correctly expanded
Fixes Gen-Verse#3

## Summary
- Replace hardcoded /absolute/path/to/OpenClaw-RL/Megatron-LM/ with dynamically computed MEGATRON_ROOT
- Computes MEGATRON_ROOT using the same cd && pwd pattern as SLIME_ROOT

## Changes
- openclaw-rl/run_qwen3_4b_openclaw_rl.sh
- openclaw-opd/run_qwen3_4b_openclaw_opd.sh

Each script now includes:
```bash
MEGATRON_ROOT="$(cd -- "${SCRIPT_DIR}/../Megatron-LM" &>/dev/null && pwd)"
...
"PYTHONPATH": "${MEGATRON_ROOT}:${SCRIPT_DIR}:${SLIME_ROOT}"
```

## Test plan
- [x] Verified SCRIPT_DIR/../Megatron-LM resolves correctly
- [x] Pattern matches existing SLIME_ROOT computation
- [x] Shell quoting correct in JSON string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant