Repository navigation
fix(sampling): preserve per-row parameters in active chunks - #464
MichaelCao0 wants to merge 3 commits into
Conversation
Signed-off-by: MichaelCaoo <139663530+MichaelCao0@users.noreply.github.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe sampling wrapper now accepts shared or per-original-row parameters, validates their sizes, and selects per-row values using original row indices for each chunk. Tests cover parameter forms, active-row selections, padding, invalid sizes, and empty batches. ChangesSampling parameter alignment
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Flink-ddd
left a comment
There was a problem hiding this comment.
Could you share the commands, commit SHAs, and before and after test logs, including the TP=2 smoke test? A representative failure before the fix and its passing result afterward would help verify the change.
|
I reran the before/after comparison against the current PR head. The attached The revisions used were:
For the baseline run, I copied only From each source directory, with python -m pytest tests/test_complete_sampling.py \
-q --tb=short -p no:cacheprovider
# Fixed version: related tests, including the sampling file above.
python -m pytest tests/test_complete_sampling.py \
tests/test_vllm_rollout_sampler.py \
tests/test_vllm_worker_top_p_replay.py \
-q --tb=short -p no:cacheprovider
A representative regression is With the fix, the same test is included in: The TP=2 smoke uses a real NCCL process group and compares each rank's output against an independent per-original-row scalar reference. It covers FP32/BF16, scalar and per-row parameters, CPU/CUDA parameter placement, active subsets, no active rows, partial chunks, and padded vocabulary shards. The baseline fails on both ranks with: The fixed version completes all 180 combinations on each rank. The baseline stops at its first failing per-row case; it does not complete the matrix. To reproduce the complete comparison, extract the attachment and run this from an RL-Kernel Git clone, selecting two free GPUs: RLK_PY=python CUDA_VISIBLE_DEVICES=0,1 \
bash /path/to/extracted/reproduce-pr-464.shThe wrapper fetches the PR, exports the pinned revisions into temporary directories, and runs both pytest and the included I also extracted the original ZIP and executed this wrapper end to end in a separate checkout. It reproduced the same results; that additional session is included under These results validate the helper-level fix, including real TP=2 execution; they do not claim full-model training validation or a performance improvement.pr-464-evidence-v2.zip |
Flink-ddd
left a comment
There was a problem hiding this comment.
LGTM, Thanks for adding the before and after logs and TP=2 results. This addresses my review.
vocab_parallel_sampling_keep_maskselects and chunks logits by original row IDs, but previously passed full-batchtemperature,top_p, andtop_kvectors into each chunk. Per-row parameters therefore failed with shape errors when the batch was split, compacted to active rows, or entirely inactive.Normalize parameter shapes once and select per-row values using the same original row IDs as the logits. Scalars and singleton tensors retain broadcasting behavior; inactive rows remain unmasked and active vocabulary padding remains excluded. Document the contract and add independent per-row reference tests.
Validation on NVIDIA H200 with PyTorch 2.8.0+cu128:
The helper currently has direct in-repository callers in the distributed validation script; this change does not claim a full-model training or vLLM integration result. Parameter indexing adds small per-chunk operations; no performance improvement is claimed.
Summary by CodeRabbit