Skip to content

qwen4_exp PLE: check host-readback dtype before sizing the copy (no OOB device read) - #317

Merged
AzeezIsh merged 1 commit into
mainfrom
fix/ple-metadata-guard
Nov 2, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
fix/ple-metadata-guard

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The qwen4_exp PLE host readers (weight_loader/qwen4_exp/ple_host.rs) size their device→host copy from the dtype they expect, not from the tensor. i64_host reads n*8 bytes.

Change: one shared expect_dtype check runs before each host read: i64_host → Int64, bf16_scalar → BF16, and fp16_host (which already had its own ad-hoc check). The error names the tensor and its actual dtype/shape. Well-formed checkpoints behave exactly as before.

Test plan

  • Unit test i64_host_rejects_a_bf16_multipliers_tensor.
  • fmt, clippy (CI env), 500-LoC cap.
  • sparky GB10 job 76, one variable vs a fresh build of base f506e92: control.py byte-identical on Flash-Next FP4-Local (the PLE path), Flash-Next NVFP4 and Qwen3.8-27B NVFP4 (K=2 verify); 4/4 requests answered on each.

Generated with Devin

AzeezIsh added a commit that referenced this pull request Nov 2, 2026
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh
AzeezIsh marked this pull request as ready for review November 2, 2026 03:08
@AzeezIsh
AzeezIsh merged commit bce5dd9 into main Nov 2, 2026
25 of 26 checks passed
AzeezIsh added a commit that referenced this pull request Nov 2, 2026
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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