Repository navigation
HIP: no device printf in the MoE expert prefix (stacked on #264) - #483
Open
LeoBorcherding wants to merge 1 commit into
Open
LeoBorcherding wants to merge 1 commit into
LeoBorcherding wants to merge 1 commit into
Conversation
HIP's device printf needs hostcall, and hostcall needs PCIe atomics on the CPU-GPU link. On a host without them mm_ids_expert_prefix fails to launch (hipErrorIllegalState), so every MoE prompt of 512+ tokens aborts. Keep the __trap, drop only the printf on HIP.
This was referenced Dec 6, 2026
This branch has not been deployed
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.
Stacked on #264. On AMD hosts without PCIe atomics, every MoE prompt of 512+ tokens aborts in the counting sort:
mm_ids_expert_prefixcalls deviceprintf. HIP's printf goes through hostcall, and clr only allows hostcall when the CPU-GPU link reports PCIe atomics, so without them the kernel never launches and returnshipErrorIllegalState. This drops theprintfon HIP and keeps the__trap, so out-of-range ids still stop the kernel. CUDA is unchanged.Who hits it: GPU passthrough VMs (Proxmox/QEMU root ports usually don't advertise AtomicOps), plus some riser and Thunderbolt setups. Seen so far:
b12966-mix-e49c75fRepro on an RX 9060 XT (gfx1200), Linux Mint, hiding atomics with an
LD_PRELOADshim that clearsatomic_support_*from the link info. Same model and flags, 1213-token prompt:fd6fae5mmid.cu:513Not run: a host that really lacks atomics. The failing dispatch and the error string match the reports. Workaround until this ships:
GGML_CUDA_MM_IDS_SORT=0, or--ubatch-sizeunder 512.