Repository navigation
qwen4_exp PLE: check host-readback dtype before sizing the copy (no OOB device read) - #317
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 2, 2026 03:08
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>
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.
Summary
The
qwen4_expPLE host readers (weight_loader/qwen4_exp/ple_host.rs) size their device→host copy from the dtype they expect, not from the tensor.i64_hostreadsn*8bytes.ple_embedding.layer_multipliersas BF16[3](6 bytes) instead of I64[3]made the DtoH read 24 bytes off a 6-byte allocation:cuMemcpyDtoHAsync failed: status 1.Change: one shared
expect_dtypecheck runs before each host read:i64_host→ Int64,bf16_scalar→ BF16, andfp16_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
i64_host_rejects_a_bf16_multipliers_tensor.control.pybyte-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