Repository navigation
Conversation
What: - Remove .agents/learnings and .plans/rocm-consolidation files from the branch. - Remove internal increment and plan-path references from source comments and public installation docs. - Keep implementation comments that explain correctness, ownership, profiler intent, source attribution, or ROCm safety behavior. - Clarify public ROCm documentation: gfx1100 has recorded serving smoke on ROCm 7.2.1; the ROCm 7.14.x container is a reference environment, and other target cells remain compile-only until physical serving evidence exists. Why: - Keep merge surface focused on code, tests, reproducibility tooling, and user-facing documentation. - Prevent private planning history, review workflow language, stale plan paths, and local process notes from entering the upstream repository. - Avoid presenting compile success or a reference container as cross-target serving or performance proof. Related upstream work informing this branch: - PR FlashML-org#132: portable ROCm/HIP foundation. - PR FlashML-org#133: TVM-FFI index/store portability. - PR FlashML-org#135: RCCL tensor-parallel communication. - PR FlashML-org#136: native GGUF ROCm build and Q4_0 kernels. - PR FlashML-org#137: earlier AMD serving bring-up. - PR FlashML-org#217: source-fork ROCm, Qwen3.5 GGUF, and performance experiments. - PR FlashML-org#241: gfx1150 build, JIT, Triton, and attention hardening. - PR FlashML-org#260: gfx1151 validation and fallback/build evidence. - PR FlashML-org#316: HIP graph-capture-safe expert copies. - PR FlashML-org#378: CPU/Hybrid MoE graph replay safety. - Local branch milestones: 436263f, 926c1e8, e1d1856, 8a70c7e, and e5fd30f. Evidence: - 170 focused tests passed after cleanup. - gfx1100 is the only target with end-to-end Qwen3.5 GGUF serving smoke recorded here. - Remaining matrix targets are compile-only; no new throughput claim is published without a matching A/B manifest.
|
Thanks for building this — we filed #350 and did not expect a fix, let alone one validated on the Two things below: a ROCm datapoint your HIP memop work bears on directly, and an offer. 1. Your HIP memop port has a second consumer, and it is the half that is still privateReading the diff, the thing that struck us is that the HIP #311's disk-streamed PLE table resolves its stream memops by
−27.3 % at 10k, −26.2 % at 100k, roughly 14 ms per token, against the −2.6 % … +0.2 % We can only bound the split, not measure it. Sampled from Where your PR lands on it: the eager half is now reachable — on ROCm your module-level And the ROCm-7.14 fact you documented in that file — that ordinary None of this is a request. It is a note that the two land in the same place. 2. An offer against your draft-exit criteriaYou list "reproduce the replay suite on RDNA3", "complete repeated graph rebuild/replay and We can help with parts of the middle one, on RDNA4 rather than RDNA3. We run two Radeon AI We can also exercise it at TP=2. To be exact about what is new there: we have reported TP=2 Three honest caveats before you count on any of it. We cannot give you the "long-running serving stability" half. We serve We cannot promise a date. The box is a shared machine with a live soak on it. Say what you It is a second gfx1201 datapoint, not a clean- No quality claim from us in any case — we have no fidelity instrument on this box, which is why Platform2 × AMD Radeon AI PRO R9700 ( Our tree is upstream Box labelling, since this box has two cards: every number in §1 — decode, TTFT, the 47.7 GiB |
e67f08e to
94f7724
Compare
|
Rebased this PR onto the refreshed AMD foundation (#132, head Conflict resolution kept the current upstream Engine/CpuMoeExecutor contracts ( Validation:
New head: |
94f7724 to
b395144
Compare
Apply PR 587 after FlashML-org#133, FlashML-org#134, and the incremental FlashML-org#378 commit. Retain the FlashML-org#378 CPU-MoE handshake and its runtime-only linkage because the overlapping FlashML-org#587 path previously failed on ROCm 10. Keep the FlashML-org#134 installation document; record the actual workspace environment outside this branch.
Integrate FlashML-org#133, FlashML-org#134, FlashML-org#135, FlashML-org#378 and FlashML-org#491 before FlashML-org#587. Preserve the tested FlashML-org#378 handshake and runtime-only linkage, and retain the FlashML-org#134 installation document. Exclude CI and closed GGUF PR FlashML-org#136.
Use upstream FlashML-org#638 and FlashML-org#134; integrate incremental FlashML-org#135 and FlashML-org#378 plus the updated standalone FlashML-org#491 before FlashML-org#587. Retain the probed FlashML-org#378 handshake and upstream installation document.
b395144 to
de45a14
Compare
FlashML-org#665 adopted with a negative-slot test, FlashML-org#378 deferred again (ROCm, now ready); FlashML-org#399 landed upstream via FlashML-org#662. Assisted-by: Claude Opus 5.5
Summary
Fixes #350: CPU/Hybrid MoE can return numerically wrong, finite outputs during graph replay on ROCm even though eager execution is correct. This PR makes the CPU/GPU handshake replay-safe when supported and disables graph capture when it is not. This follow-up is now based directly on main
95ac86f21567bc244c7a9d91972838fbf049b4ed; #132 is merged, and #491's hybrid orchestration refactor is not included.Validation
Author-run on one AMD Radeon AI PRO R9700 (gfx1201, 32 GiB), dual EPYC 9334 host, with test processes pinned to CPUs 32-39. Only one GPU was exposed and
torch.cuda.device_count() == 1was checked. Reference environment: PyTorch2.11.0+rocm7.14.0, HIP7.14.60850, Triton3.7.1, Python 3.12. Synthetic banks only; no model checkpoint, quality, serving-throughput, or full-suite claim.113 passed, 2 deselected. The exclusions are a slow GGML comparison and an existing test hard-coding CUDA FlashInfer; the latter was independently checked to fail identically on clean main and this branch on ROCm.
FREETOKEN_CPU_MOE_FLAG_SYNC=0: 63 passed, 13 skipped, 1 slow deselected. Unsupported native Graph cases skip; direct-capture safety and eager correctness remain tested._cpu_moeimports successfully without a GPU. No ROCm 10 GPU replay claim.git diff --checkpasses.Remaining validation
The original RDNA3 and NVIDIA physical-hardware checks and long-running CPU/Hybrid model-serving criteria are not yet satisfied by this author's evidence. Full TP>1 GPU replay remains untested. The AMD reference image uses Torch 2.11; the new main packaging defaults to Torch 2.14 and that default dependency environment was not validated here. These remain open validation items while this PR is ready for review.
Concrete ROCm counterexample (rerun 2026-10-13)
The required behavior is simple: capture a CPU MoE decode with input A, then replace the hidden states, expert IDs, and router weights in the same GPU tensors with input B and replay. The replay must compute B's result, matching eager execution of B.
CPU MoE needs an ordered sequence on every replay:
In the tested ROCm environment, main's native flag probe returns false and selects the host-function fallback. That fallback does not preserve this handshake correctly during graph replay. Replay and GPU synchronization complete without a runtime error, and the output is finite, but numerical comparison with the current-input reference fails. Graph API success alone therefore cannot establish correctness.
I reran main
95ac86f21567bc244c7a9d91972838fbf049b4edand this PRde45a143bbf11ec4728ba0235e6bc3ad55f76bf1on the same single R9700 and PyTorch/HIP environment listed above. A supplemental local BF16 script used identical banks and inputs for both checkouts, with an independent Torch reference for expert computation. It uses one layer, 8 experts, H=512, I=256, batch=4, and top_k=2.Error is
max(abs(actual - reference)) / max(abs(reference)); the BF16 acceptance threshold is0.02. Main fails 3/3 replays, while the PR passes 3/3 and its Graph errors equal its eager errors. These results establish incorrect replay; they do not imply that every incorrect output equals a particular capture-time or stale buffer.The supplemental script is local, not a committed test file. Reviewers can reproduce the same failure class with the repository's existing tests, without that script. In a separate fresh run:
Main: 4 failed. PR: 4 passed, with no skips. Exact failing errors may vary with execution. The smallest reproducer, run separately in each checkout after rebuilding its extensions, is:
CPU affinity 32-39 is specific to this host; select suitable cores elsewhere.
The fix makes the CPU/GPU notification and wait explicit HIP Graph nodes backed by signal memory, and enables them only after a real capture/instantiate/replay probe succeeds. In the successful probe path, the above numerical replay cases pass. If the handshake is unavailable, Engine disables Graph and executes eagerly; direct executor capture raises an explicit error. A separate run with
FREETOKEN_CPU_MOE_FLAG_SYNC=0confirmed correct eager output and the intended capture rejection.This counterexample concerns CPU/Hybrid MoE synchronization, including offload configurations with CPU layers. ROCm's general Graph support and pure-GPU computation are outside this failure. The measured benefit here is correctness; no end-to-end throughput improvement is claimed.