mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5466] [Engine] q36: report need/free MiB on expert-buffer and staging OOM #5438
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5438
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5466
Author: @bahooo22
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:pr-serve-oom-mib📝 Commits (1)
e74ccf1q36: report need/free MiB on expert-buffer and staging OOM📊 Changes
1 file changed (+25 additions, -7 deletions)
View changed files
📝
src/qwen35/q36_engine.cu(+25 -7)📄 Description
Problem and result
A failed cudaMalloc in the q36 engine (place_experts) printed only "out of memory" with a line number, so the user could not tell whether to shrink the context, MTP, the slot count, the reserve or the quant. After this change every expert-buffer and staging allocation failure prints the buffer's need/free MiB and the launch parameters (ctx, chunk/tmax, top_k, n_embd), and the returned error string carries need/free too. A successful load is unchanged.
Related discussion
This fix previously went out as PR #5044 (bahooo22). #5044 was closed as superseded, but only its serve part landed upstream (
b3c63386); the q36 OOM diagnostic did NOT land in upstream/main (verified: git merge-base --is-ancestor 2e1c2a0454828c7eis false, and git grep alloc_vram54828c7e-- src/qwen35/q36_engine.cu is empty; 2e1c2a04 is a local fork commit). This PR carries the q36 diagnostic alone. Tracking issue: https://github.com/Niko1221/Strata/issues/5464.Approach
alloc_vram is hoisted above the expert-placement loop and wraps every device allocation that can OOM there: L.blobs (all-in-VRAM and per-layer slots), H.slot_of_d, E.ecpu, E.d_miss, and the two prompt staging buffers E.stage[0]/E.stage[1]. Diagnostic only: no allocation size, placement or control-flow change; the error text is built once at the failure site.
Validation
Passed:
e74ccf1e: cmake -S . -B build -G Ninja -DSTRATA_ENABLE_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86; cmake --build build --target strata-q36 -j; ctest --test-dir build --output-on-failure.Failed: none observed.
Not run: HIP, SYCL, Metal and CPU-only builds; other models. Draft until the touched backends are built or targeted help is requested.
Limits
The message text is the whole change; it does not recover from an OOM or change the placement decision.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.