Repository navigation
gemma4: one image.zig for Metal and CUDA, the picture steps over the caller's core/picture - #1589
Merged
Merged
Conversation
…caller's core/picture cuda_image.zig was image.zig line for line but for its picture import: Metal's build reaches core/picture by path, the CUDA module by name. image.zig now keeps the processor's constants, sizes and budgets as they were and gives the picture-side steps (Error, decoderProblem, prepare) through For(picture), as glm/image_core.zig does. gemma4.zig instantiates it as image_steps for Metal, cuda_vision.zig with @import("core").picture; the twin test loses its image pair and cuda_image.zig is gone. The bytes each step produces are unchanged.
ashhart
force-pushed
the
gemma4-one-image
branch
from
October 29, 2026 23:43
83850d4 to
d16ed6c
Compare
Owner
|
Thank you @jschmied. This is in TensorFold 1.2.0, released today: https://github.com/ashhart/TensorFold/releases/tag/v1.2.0 It landed with your commits under your own name, so you're listed as a TensorFold contributor, and it's credited to you in the release notes and the changelog. |
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.
What
families/gemma4/cuda_image.zigwasimage.zigline for line, except for its picture import. Metal's build reachescore/pictureby path; the CUDA module can only reach it by name. The twin test incuda.zigkept the two copies equal.Now there is one file.
image.zigkeeps the processor's constants,targetSizeandbudgetat the top level. These now return a narrowerSizeError. The picture-side steps (Error,decoderProblem,prepare) come throughFor(picture), the patternglm/image_core.zigalready uses:gemma4.zigexportsimage_steps = image.For(@import("../../core/picture/picture.zig")). Its users change fromimage.preparetoimage_steps.prepare:native/gemma4.zigandtests/gemma4/vision.zig.cuda_vision.ziginstantiates it with@import("core").picture.cuda_tower.zig,cuda_backend.zigandcuda.zigimportimage.zig.cuda_image.zigis deleted, and its pair leaves the twin test.The function bodies move unchanged, only re-indented into
For, so the patches each step produces are the same bytes.Checks
zig build testpasses.zig buildpasses, includingtf-gemma4-vision;zig build nativepasses;zig build testpasses: 568/568 steps.tf-gemma4-visionagainst its fixtures. There is no Gemma 4 checkpoint on that Mac.