Skip to content

fix(mps): stale wgp_config regeneration, Z Image float64→float32, smoke test#1770

Closed
huangyebiaoke wants to merge 1 commit into
deepbeepmeep:MPSfrom
huangyebiaoke:fix/mps-ux-and-float64
Closed

fix(mps): stale wgp_config regeneration, Z Image float64→float32, smoke test#1770
huangyebiaoke wants to merge 1 commit into
deepbeepmeep:MPSfrom
huangyebiaoke:fix/mps-ux-and-float64

Conversation

@huangyebiaoke

Copy link
Copy Markdown

Follow-up to #1768. Addresses remaining issues from @cn0ss's systematic MPS test report in #1750.

Changes

1. setup.py — stale wgp_config.json detection

create_wgp_config() previously skipped generation if the file existed, leaving stale configs with blank attention_mode after branch switches or upgrades. On MPS, blank attention_mode causes the model to load but produce no output files (reported by @cn0ss).

Fix: Validate existing config — if attention_mode or video_profile are missing/empty, force regeneration.

2. pipeline_z_image.py — MPS float64 → float32

Z Image Turbo was the only tested feature still failing on MPS, crashing with:

Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64

Root cause: The DPM-Solver ODE steps use torch.float64 at 5 sites. On CUDA this works; on MPS the backend rejects float64 entirely.

Fix: Detect MPS device and use solver_dtype = torch.float32. For 4-step distilled models this is numerically fine.

3. shared/mps/test_mps_smoke.py — Quick validation script

Runs in <30 seconds without model weights. Validates:

  • macOS + Apple Silicon detection
  • PyTorch MPS availability, float32/bfloat16 tensor ops
  • Float64 rejection (MPS sanity check)
  • device_patch application + nn.Parameter duck-typing
  • Core model imports (wan_handler, ltx2, z_image)
  • attention modes enumeration
  • wgp_config.json validity
  • Memory reporting

Testing

  • Tested on M4 Max 36GB (if @cn0ss or @SquishedSquirrel can re-test Z Image Turbo with this branch)
  • Smoke test verified to run on macOS without model weights

- setup.py: re-generate wgp_config.json when attention_mode is blank
  (prevents silent generation failures after branch switch or upgrade)
- pipeline_z_image.py: use float32 for DPM-Solver ODE steps on MPS
  (MPS backend does not support float64; fall back to solver_dtype)
- shared/mps/test_mps_smoke.py: quick validation script (<30s, no models)
  tests MPS availability, basic matmul, device_patch, model imports,
  wgp_config validity, and memory reporting
@huangyebiaoke

Copy link
Copy Markdown
Author

Closing — most fixes were already in @deepbeepmeep's commit a60b152. Will contribute separately if there's new work to do.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant