Skip to content

fix(flow-grpo): install cv2 system libs, cut OCR nightly to 240 min - #4696

Merged
yuki-97 merged 2 commits into
r0.8.0from
yukih/flow-grpo-ocr-nightly-fix
Oct 15, 2026
Merged

yuki-97 merged 2 commits into
r0.8.0from
yukih/flow-grpo-ocr-nightly-fix

Conversation

@yuki-97

@yuki-97 yuki-97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Gets the Flow-GRPO OCR nightly to start, and moves it from 1n8g to 2n8g so rollout fits in H100 memory. Test-suite scripts and recipe only, no library change.

What changed

1. Cut NUM_MINUTES 360 -> 240 in the nightly script. The nightly can only be scheduled with a 240-minute budget.

2. Install the cv2 system libs before uv sync in common.env. The reward worker failed at startup:

File "/opt/ray_venvs/flow_grpo.environments.image_reward_environment._RewardWorker/lib/python3.13/site-packages/paddleocr/paddleocr.py", line 25, in <module>
    import cv2
ImportError: libxcb.so.1: cannot open shared object file: No such file or directory

paddleocr 2.10.0 depends on the full opencv-python and opencv-contrib-python wheels (uv.lock), and the root pyproject.toml excludes opencv-python-headless from the container, so the system libs have to come from apt. A headless swap inside the worker venv would be undone by the uv run --locked sync on every worker start.

3. Run the nightly on 2 nodes x 8 GPUs and rename it flow_grpo-qwen-image-ocr-2n8g-dp16-lora. On 1n8g each of the 8 workers rolls out 4 prompts x 16 generations = 64 samples, and sample_trajectory OOMs on the 80 GB H100 after 2 steps:

torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 1.50 GiB. GPU 0 has a total capacity of 79.11 GiB of which 1.17 GiB is free.

On 2n8g each of the 16 workers rolls out 32 samples and the run passes all four checks (60 steps, val/reward_mean 0.786 -> 0.886, train/grad_norm max 0.0076). Slurm wall time is 3h18m of the 240-minute budget, about 40 minutes of which is the one-off source build of flash-attn, transformer-engine and friends in the container. train_micro_batch_size stays 2: it only splits train_step and does not touch rollout. The recipe, log_dir, checkpoint_dir, W&B name, nightly.txt and the README row follow the new name.

Tests

1. Validated the 2n8g nightly on H100. All checks pass.

2. Raise the nightly GPU-hour guard 4793 -> 4820 in test_recipes_and_test_suites.py. The recipe goes from 32 to 64 GPU-hours (16 GPUs x 240 min), taking the tools/launch dry-run total to 4809; 4820 is that + 20, rounded down to ten.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuki-97 yuki-97 added the cherry-pick-to-main Opt in: cherry-pick this PR's commit from the release branch back into main label Oct 13, 2026
@yuki-97
yuki-97 force-pushed the yukih/flow-grpo-ocr-nightly-fix branch from c0851ed to 3720560 Compare October 15, 2026 03:20
…e nightly GPU-hour guard to 4820

Signed-off-by: Yuki Huang <[email protected]>
@yuki-97 yuki-97 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Oct 15, 2026
@yuki-97

yuki-97 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9686e4a

@yuki-97
yuki-97 marked this pull request as ready for review October 15, 2026 15:37
@yuki-97
yuki-97 requested review from sajadn and terrykong October 15, 2026 15:39
@yuki-97
yuki-97 enabled auto-merge (squash) October 15, 2026 17:00
@yuki-97
yuki-97 merged commit c33d59e into r0.8.0 Oct 15, 2026
101 checks passed
@yuki-97
yuki-97 deleted the yukih/flow-grpo-ocr-nightly-fix branch October 15, 2026 17:48
terrykong pushed a commit that referenced this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-to-main Opt in: cherry-pick this PR's commit from the release branch back into main CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants