Skip to content

MoE model decode hangs on Jetson Orin AGX (SM87) since b7309 #19219

Description

@BusinessBuilders

Bug Description

MoE model inference (decode/warmup) hangs indefinitely on NVIDIA Jetson Orin AGX (SM87, compute capability 8.7) on all commits after b7309 (017761daf, Dec 6 2025). The model loads successfully but decode never produces tokens — the CUDA kernel appears to hang.

This affects all MoE models tested, not just one specific model or quantization:

  • GLM-4.7-Flash Q8_0 (Unsloth, DeepSeek2 architecture, 64x2.6B MoE, 3B active)
  • Qwen3-Coder-30B-A3B Q4_K_M (Qwen3 MoE architecture, 30B params, 3B active)

Both models work perfectly on b7309 (017761daf) but hang on latest master (bd90fc74c).

Environment

  • Device: NVIDIA Jetson Orin AGX 64GB (unified memory)
  • GPU: Orin (SM87, compute capability 8.7)
  • JetPack: R36.4.7
  • CUDA: 12.6
  • Build flags: -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=87 -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_CUDA_F16=ON -DCMAKE_BUILD_TYPE=Release

How to Reproduce

# Build latest master
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=87 -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

# This hangs indefinitely (never produces tokens):
build/bin/llama-server \
  --model GLM-4.7-Flash-Q8_0.gguf \
  -ngl 99 --ctx-size 8192 --port 11434 --host 0.0.0.0 --jinja -np 1 \
  --override-kv deepseek2.expert_gating_func=int:2

# Server starts, model loads, but hangs at:
# "warming up the model with an empty run"
# Using --no-warmup, the server starts but decode requests hang forever.

# Same behavior with Qwen3-Coder-30B-A3B Q4_K_M

Bisect Results

We performed a git bisect between 017761daf (good, b7309) and bd90fc74c (bad, master HEAD).

Finding 1: llama-cli decode hang

First bad commit: c8554b66e — "graph: use fill instead of scale_bias in grouped expert selection (#17867)"

- selection_probs = ggml_set_rows(ctx0, ggml_scale_bias(ctx0, selection_groups, 0.0f, -INFINITY), ...);
+ selection_probs = ggml_set_rows(ctx0, ggml_fill(ctx0, selection_groups, -INFINITY), ...);

This 1-line change replaces ggml_scale_bias(tensor, 0.0, -INFINITY) with ggml_fill(tensor, -INFINITY) for masking non-selected expert groups. Both are mathematically equivalent, but the ggml_fill path hangs during CUDA execution on SM87.

Finding 2: llama-server warmup still hangs even with revert

Reverting c8554b66e and rebuilding llama-server from master does not fix the hang. The server still hangs at warmup (which performs a llama_decode). This indicates there are additional breaking changes in master's decode/graph execution path for MoE models on SM87.

Finding 3: llama-cli loading hang

First bad commit: 6c2131773 — "cli: new CLI experience (#17824)"

The new llama-cli binary hangs during model loading on SM87. This only affects the new CLI, not llama-server.

Working Configuration

On b7309 (017761daf), both models run perfectly:

  • GLM-4.7-Flash Q8_0: 21.8 tok/s generation, 37.9 tok/s prompt processing
  • Qwen3-Coder-30B-A3B Q4_K_M: 37.1 tok/s generation, 57.2 tok/s prompt processing

Both with 100k context, all layers on GPU (-ngl 99), Flash Attention enabled.

Summary

Multiple commits between b7309 and master break MoE model decode on Jetson Orin (SM87). The most identifiable is c8554b66e which changes the expert selection masking from ggml_scale_bias to ggml_fill, but this is not the only breaking change — additional changes in the graph/backend/CUDA execution paths also contribute to the hang.

This may affect other SM87 devices and potentially other MoE models. Dense models were not tested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions