feat(rocm): enable bitwise Qwen3 Dense VIME alignment - #388
Merged
Conversation
Signed-off-by: frank-2077 <siruhe666@gmail.com>
Signed-off-by: frank-2077 <siruhe666@gmail.com>
Signed-off-by: frank-2077 <siruhe666@gmail.com>
Signed-off-by: frank-2077 <siruhe666@gmail.com>
inaniloquentee
requested review from
EthanZero2Hero,
Flink-ddd,
KJLdefeated and
bitborne
as code owners
September 5, 2026 10:52
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Add VIME Qwen3-8B TP4/CP2 consistency experiment and results
Signed-off-by: Codex <codex@openai.com>
Add the ROCm R/R VIME path for Megatron TP4/CP2 and two vLLM TP4 engines, reusing the strict PR377 integrations. Preserve zero-copy KV cache views and deterministic attention, FFN, collectives, and log-prob execution.
Restore the PR377 CUDA deterministic GEMM facade unchanged and bind ROCm Triton GEMM through a platform-selected module. Keep strict ROCm Attention and RCCL integration in ROCm-owned modules while reusing the shared fixed-tree collective from main.
Reuse the PR377 RoPE table and layout helpers while keeping the HIP kernel and autograd dispatch in a ROCm-owned module. This leaves the CUDA implementation unchanged relative to main.
Add the isolated ROCm fixed-tree collective and fused vocab-parallel logp paths, and validate RCCL CP plans without changing the CUDA contract.
inaniloquentee
force-pushed
the
rocm-vime-qwen3-bitwise
branch
from
September 5, 2026 13:51
9814114 to
6152f16
Compare
Signed-off-by: lamentropetion <3051000145@qq.com> # Conflicts: # csrc/ops.cpp # rl_engine/_C.pyi # rl_engine/distributed/collectives.py # rl_engine/integrations/framework_operators.py # rl_engine/kernels/attention_contract.py # rl_engine/kernels/ops/rocm/attention/strict_runtime.py # rl_engine/kernels/ops/rocm/loss/vocab_parallel_logp.py # rl_engine/kernels/ops/triton/matmul/det_gemm.py # tests/test_framework_runtime_adapters.py
maxiaosong1124
self-requested a review
September 5, 2026 15:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Topology
Performance
The runtime keeps the PR377 scheduling path. The KV fix uses vLLM's native zero-copy transpose/split views. It adds no tensor copy, device synchronization, kernel launch, or TP communication. Layer diagnostics are environment-gated and install no probes in the default path.
Validation
R/R MI300X validation run v22:
torch_equal=trueelement_count=64mismatch_count=0max_abs_diff=0.0train_rollout_logprob_abs_diff=0.0Tests:
pytest -q tests/test_framework_runtime_adapters.py: 31 passedpytest -q tests/test_vime_rocm_attention_topology.py tests/test_rocm_packed_ffn.py: 11 passedgit diff --check: passedThis PR intentionally prioritizes the strict R/R arm; the full four-arm ablation matrix was not rerun.
Hot-cache R/R vs production Attention
This is an Attention-only isolated comparison, not a fully native-stack comparison. P/P uses production Attention for both Megatron training and vLLM rollout; R/R uses RL-Kernel strict Attention for both. FFN and linear Logp remain on the same RL-Kernel R/R path in both arms.
Configuration:
872780c75b3f783e2842aaae3ea1e86bffc94f3d(tracked sources clean and frozen fingerprints matched)gfx942)2.12.0+rocm7.14.0a20260608, HIP7.14.60850, vLLM0.26.1rc1.dev543+g11d76fc72round_robin, eager mode, custom all-reduce disabledoffload_train=false,offload_rollout=truerollout_batch_size=2,samples_per_prompt=1,global_batch_size=2max_response_length=32,max_tokens_per_gpu=2561234, rollout42Single-step Vime timer results after JIT caches were populated:
rollout_timeeffective_tokens_per_gpu_per_secupdate_weights_timelog_probs_timeactor_train_timetrain_timeactor_train_tok_per_sstep_timeThe strict path costs 2.872x rollout latency and 65.18% rollout throughput in this small workload, while the strict training path is faster; the measured end-to-end step time is 20.29% lower. This is a single-step directional comparison rather than a long-run throughput benchmark.
Strict R/R bitwise result (fresh independent sidecar validation):
passed=true,require_exact=true,torch_equal=truesample_count=2,element_count=64mismatch_count=0,max_abs_diff=0.0train_rollout_logprob_abs_diff=0.0mismatch_kl=0.0,mismatch_k3_kl=0.0For contrast, P/P production Attention was not bitwise aligned:
torch_equal=false,mismatch_count=37/64,max_abs_diff=0.2500038146972656, and mean absolute train/rollout Logp difference0.016262680292129517.Run artifacts on the AMD host:
/app/model/vime-runs/rocm-dense-attention-pp-8gpu-tp4-v31/app/model/vime-runs/rocm-dense-attention-rr-8gpu-tp4-v32