Skip to content

[Bug] Prompt completely ignored in MLX runtime (Apple Silicon) - identical outputs across different prompts, confirmed on QAD-1.3B and FP8-1.3B #1736

Description

@Carlwang1026

Bug Report: Prompt Ignored in MLX Runtime (Apple Silicon) - All Prompts Generate Identical/Unrelated Videos

Summary

When using FastVideo's MLX runtime on Apple Silicon (M4 Mac mini, 16GB), the text prompt is completely ignored during generation. Different prompts produce identical videos (same seed), and the generated content is unrelated to the prompt. This has been confirmed across two different model variants (FastWan-QAD-1.3B and FastWan-QAD-FP8-1.3B), ruling out model-specific corruption.

Environment

Hardware:

  • Mac mini, Apple M4, 16GB unified memory
  • macOS 26.6.2

Software:

  • Python 3.12
  • torch 2.12.0
  • mlx 0.32.1
  • mlx-metal 0.32.1
  • fastvideo (GitHub main, 2026-08-21)
  • diffusers 0.33.0.dev0
  • transformers 5.0.0

Models tested (both fail):

  • FastVideo/FastWan-QAD-1.3B (27GB, standard)
  • FastVideo/FastWan-QAD-FP8-1.3B (32GB, FP8 quantized)

Steps to Reproduce

python examples/inference/basic/mlx_wan_prompt_to_video.py \
  --model-root <model_dir> \
  --prompt "<ANY_PROMPT>" \
  --height 480 --width 480 \
  --num-frames 25 --fps 8 \
  --seed 42 \
  --output out.mp4

Test 1: Different Prompts, Same Seed → IDENTICAL output

Prompt Seed Output MD5
"A cute cat playing with a ball of yarn in a sunny garden" 42 c2cd2fad32949aae669ca0d346c12ec9
"A golden retriever dog running on a beach with waves" 42 c2cd2fad32949aae669ca0d346c12ec9

Both prompts produce the EXACT SAME video (bit-identical MD5). The video shows a female tennis player — unrelated to cat or dog.

Test 2: Different Seeds, Same Prompt → output varies (seed works)

Prompt Seed Output MD5 VLM-analyzed content
"A cute cat..." 100 543388aae4049c321c3d3f5206a194ae Female figure, outdoor
"A cute cat..." 200 216a7721e3fb5fc49cee99dd1d85727b Female figure, motion
"A cute cat..." 300 2e7f2e741e037edab488daa3701df264 Fluorescent parrot

✅ Random seed DOES affect output. ❌ Prompt NEVER affects output.

Test 3: FP8 model also ignores prompt

Model Prompt Seed Output MD5 Content
FastWan-QAD-FP8-1.3B "A cute cat playing with a ball of yarn in a sunny garden" 42 5d290df28f4a5d1d6141366b28777274 Male figure covering face

FP8 model generates different content than standard model (weights loaded correctly), but still completely ignores the prompt.

What Was Ruled Out

  1. Model weight corruption — Two independently downloaded model variants (27GB + 32GB) both fail identically. Transformer weights verified: 825 tensors, correct shapes.
  2. Cache issue — Cleared MLX cache and ~/.cache/fastvideo/prompt_embeds/, re-ran: identical MD5 output.
  3. Random seed broken — Different seeds produce different videos, so RNG works.
  4. Obvious code path breakencoder_hidden_states is correctly created (line 839) and passed to DiT (line 924); _forward in fastvideo/mlx_runtime/fastwan.py correctly calls self.condition(timestep, encoder_hidden_states) and passes embeddings to every block.

Likely Root Cause

The bug is in the MLX runtime's handling of cross-attention (attn2) — the prompt embeddings are being silently ignored inside the DiT transformer blocks. Possible sub-causes:

  1. Weight mapping issue in mlx_dit_from_diffusers_safetensors / _WAN_BLOCK_KEY_MAP — attn2 (cross-attention) weights may not be correctly mapped/loaded, causing cross-attention to compute with wrong or zeroed context.
  2. mx.compile graph caching — compiled graph may not properly capture encoder_hidden_states as an input dependency.
  3. Attention backend bug — MLX attention implementation may ignore the context argument.

Request

This is a critical bug — the MLX runtime is unusable for text-to-video on Apple Silicon since prompts have zero effect. Please investigate:

  1. Verify cross-attention (attn2) weight loading in the MLX DiT loader
  2. Test with mx.compile disabled to isolate graph caching issues
  3. Compare against the working NVIDIA path (examples/inference/optimizations/FastWan_QAD_TAEHV.py)

I can provide full logs, prompt embedding cache files, and any additional diagnostics.


Reporter: Carl Wang (ManLing Tech)
Date: 2026-08-21 18:35 GMT+8
Tested on: Mac mini M4 16GB, macOS 26.6.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance and memory issuesplatformPlatform-specific (Windows/macOS)scope: attentionAttention backends (VSA, STA, Flash, etc.)scope: docsDocumentationscope: inferenceInference pipeline, serving, CLIscope: modelModel architecture (DiTs, encoders, VAEs)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions