Repository navigation
Conversation
| # Step 2: Use the dynamic matrix in the build-test job | ||
| build-test: | ||
| needs: set-matrix | ||
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ciflow/rl') |
There was a problem hiding this comment.
This line is moved to first step set-matrix. This bug is only in RL integration test yaml file, didn't find the same issue in other yaml files
| 5. From the TorchTitan repository root, add the checkout to `PYTHONPATH`. Monarch-spawned RL worker processes inherit this environment variable, so they can import the local `torchtitan` package: | ||
| ```bash | ||
| uv pip install -e . | ||
| export PYTHONPATH="$PWD:${PYTHONPATH:-}" |
There was a problem hiding this comment.
yeah, i never did this, and it works fine. Perhaps this is necessary for worktree? I think that for worktree this is actually necessary.
can you ask claude to create a new env and verify this claim (i.e. do with it and without it, confirm that it fails without it?)
but in any case, we would still need to run uv pip install -e no?
| # python grpo.py as a subprocess | ||
| uv pip install -e . | ||
| # 4. Make the checkout importable for subprocesses spawned by the test. | ||
| export PYTHONPATH="$PWD:${PYTHONPATH:-}" |
There was a problem hiding this comment.
same here, wouldnt we need to still run pip install -e? otherwise, how is torchtitan installed?
There was a problem hiding this comment.
torchtitan doesn't need to be installed to run?
There was a problem hiding this comment.
i have always used pip install -e . as a way for programs to find imports, right? as if the library is installed and is importable. "from torchtitan.X import Y"
I guess the export PYTHONPATH also works? i just haven't seen similar instruction in other libraries. So i dont know if this is a good solution, or claude slop
But if both of you are confident, lets go with it
There was a problem hiding this comment.
wouldnt we need to still run pip install -e?
No, export PYTHONPATH also works for the same purpose of "from trochtitan.X import Y", We don't use pip install -e . because it will have permission issue in CI, eg: https://github.com/pytorch/torchtitan/actions/runs/27032930788/job/79789585434#step:17:14902 This stops us running the CI.
There was a problem hiding this comment.
torchtitan doesn't need to be installed to run?
The main purpose we'll have this is for Monarch / vllm spawned children process - The children process need to know where to import torchtitan. To let them know the torchtitan path, we'd put it in a env variable which will be inherited by child process, or install torchtitan via editable mode pip install -e .
I don't know if there's a better work around, but the env variable could be a possible one
…vllm runtime issue
|
|
||
| Command to run: | ||
| python3 torchtitan/experiments/rl/train.py \ | ||
| --module rl --config rl_grpo_qwen3_0_6b \ |
There was a problem hiding this comment.
This config field is renamed to rl_grpo_qwen3_0_6b_varlen, but test is not updated
| "--group_size 2", | ||
| "--batcher.batch.seq_len 1024", | ||
| "--renderer.enable-thinking False", | ||
| "--generator.sampling.max_tokens 256", |
There was a problem hiding this comment.
Increase the number of tokens being generated, to include meaningful answer to the SumDigts task
| """Destroy the worker's torch.distributed process group.""" | ||
| if torch.distributed.is_initialized(): | ||
| torch.distributed.destroy_process_group() | ||
| """Close actor-local resources before the process mesh stops. |
There was a problem hiding this comment.
This change is because CI hang during tear down, so I vibe coded this solution which looks reasonable - cc @felipemello1 @pzhan9 , I might want to land this PR first and if it breaks the shutdown, would love to have a forward fix
…ermission error (pytorch#3541) Fix 3 things related to experimental CI: 1. In RL integration test: editable install `torchtitan` caused permission issue 2. When first create a RL PR (with `ciflow/rl` tag), the first commit doesn't trigger the CI run, only triggered a `set-matrix` 3. `is-experimental` flag in `set-matrix` will trigger a empty ROCm matrix but runs nothing. After fix, the CI trigger will be: - experimental + labeled -> CUDA only - experimental + main push -> CUDA only - experimental + schedule -> CUDA only - non-experimental ROCm label/tag behavior preserved. Other changes need to be fixed when RL CI is down: - Updates RL integration tests to run via python -m torchtitan.experiments.rl.train. - Uses varlen RL configs in CI, disables Qwen3 thinking, sets group_size=2, raises seq_len to 1024, and caps generation with generator.sampling.max_tokens=256 so rollout rows are not all filtered as overlength. - Splits H100 bitwise parity into separate Varlen and Flex torchrun invocations so each gets a fresh process group / vLLM lifecycle. - Fixes teardown hangs by not destroying Monarch-owned distributed state from actor close() methods: VLLMGenerator.close() only shuts down renderer-local resources, and PolicyTrainer.close() leaves process group teardown to ProcMesh.stop(). cc @felipemello1 @pzhan9 - Routes trainer checkpoint/debug dump paths through the CI output directory to avoid permission/path issues. - Renames/updates RL docs and helper imports to the varlen config names.
Fix 3 things related to experimental CI:
torchtitancaused permission issueciflow/rltag), the first commit doesn't trigger the CI run, only triggered aset-matrixis-experimentalflag inset-matrixwill trigger a empty ROCm matrix but runs nothing.After fix, the CI trigger will be:
Other changes need to be fixed when RL CI is down: