mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3876] [Engine] Metal: wrap a Gyro file without its PLE table (37.6 instead of 92 GB in GPU buffers) #4813
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#4813
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/3876
Author: @mnott
Created: 10/23/2026
Status: 🔄 Open
Base:
main← Head:metal-gyro-wrap-ple📝 Commits (1)
707ae68fix(metal): wrap a Gyro file without its PLE table: the head and tail ranges only, no read-ahead of the table📊 Changes
3 files changed (+74 additions, -26 deletions)
View changed files
📝
metal/src/engine/window.cpp(+39 -26)📝
metal/src/mtl_rt.h(+5 -0)📝
metal/src/mtl_rt.mm(+30 -0)📄 Description
Rebased onto v0.2.6 (same change as before).
Problem and result
On macOS the engine wraps the whole Gyro GGUF, including its PLE table, into Metal buffers. With Gyro-M TQ2_0 (92 GB file, about 54 GB of it the PLE table) the log shows
wrapped 91.97 GB as 2 overlapping buffers. With this change only the head and tail ranges around the PLE table are wrapped and the read-ahead skips the table:wrapped 37.57 GB as 2 separate ranges (of 91.97 GB).Related discussion
Overview of our related macOS / Metal contributions: #4128. Split out of #3299, whose Gyro-on-Metal kernel commits are upstream since v0.2.3.
Approach
When the file has a PLE table,
window.cppwraps the ranges before and after it as two separate no-copy buffers instead of one buffer over the whole file. Without a PLE table the existing span logic is unchanged.Validation
Branch head
707ae686aa671567a7172600969def327d004507, one commit onv0.2.6. Apple Silicon, 128 GB unified memory, Gyro-M TQ2_0,--ple-io direct --spec 2with the MTP draft, same flags for both builds.Passed:
strataon macOS.wrapped 91.97 GB as 2 overlapping buffers, this branchwrapped 37.57 GB as 2 separate ranges (of 91.97 GB).v0.2.6.Failed:
Not run:
Limits
Applies when the file carries a PLE table and the PLE is read directly (--ple-io direct); other files keep the existing span logic.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.