Repository navigation
zaya: ZAYA1-VL (vision LoRA on image tokens, bidirectional image attention, converter) - #18
Merged
Conversation
…ntion, converter)
Zyphra ZAYA1-VL-8B is the ZAYA1 language model with a Qwen2.5-VL vision tower
and two additions:
- vision-only LoRA, used on image tokens: rank 8 on CCA's q, k, both value
projections and o_proj; rank 32 on every expert's fc1 and fc2. mtmd decodes
an image as its own ubatch of embeddings, and graphs are only reused between
ubatches of the same kind, so a ubatch of embeddings takes the LoRA for every
token. The experts' LoRA needs the hidden state between fc1 and the SwiGLU,
so image ubatches run the experts explicitly (same top-1 choice and weight
as build_moe_ffn); o_proj's LoRA reads the attention output before wo.
- bidirectional attention within an image: the mmproj key
clip.vision.decode_non_causal makes mtmd decode image chunks non-causally,
for any vision projector (Gemma 3/4 decide it by projector type).
The converter reads ZAYA1-VL's checkpoint (layers.{i}.attn / layers.{i}.mlp,
the legacy Megatron-style tensors, rotary_base, rope_pct), stacks the
experts' LoRA, writes the ranks, fills the vision config's Qwen2.5-VL
defaults, and writes the mmproj (temporal patch 1: the second patch conv is
zeros). Its chat template takes llama.cpp's media markers (<__media_<id>__>,
random per server) as well as Zyphra's list form, and puts images in front of
the user turn as Zyphra's does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
bong-water-water-bong
merged commit Sep 26, 2026
f30cc43
into
1bit/hrx-vulkan-patched
10 of 27 checks passed
bong-water-water-bong
left a comment
Author
There was a problem hiding this comment.
Checked on strixhalo from a fresh build of f191edd (HRX + Vulkan). ZAYA1-8B text output is unchanged:
- Q4_K_M wikitext perplexity (
-c 512): Vulkan0 with one sequence per batch is 21.5731 and with four (-b 2048) 21.6213. HRX0 is 21.5518. All three are identical to the numbers before this PR. - F16 against transformers FP32, teacher-forced top-1: 95/96, the same as before.
test-llama-archs -a zaya: OK on Vulkan and CPU, including save/reload.- Converter: pyflakes is clean. The text-only path is gated on
vision_config. - The pending checks are the self-hosted-runner jobs, which never start on this fork. Every hosted build passes.
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.
Adds Zyphra ZAYA1-VL-8B: the ZAYA1 language model plus a Qwen2.5-VL vision tower, with two additions of Zyphra's.
Vision-only LoRA on image tokens
build_moe_ffn, because the fc1 LoRA sits before the SwiGLU.Bidirectional attention within an image
clip.vision.decode_non_causal, makes mtmd decode image chunks non-causally, for any vision projector.Converter
layers.{i}.attnandlayers.{i}.mlpsublayers, the legacy tensor names, androtary_base/rope_pct.Checked on Strix Halo (F16 text model, F16 mmproj)
zaya1-vl, FP32, CPU), teacher-forced on llama.cpp's greedy answers to three image questions (101 tokens). The prompts match exactly: 208 tokens, the image at the same position.test-llama-archs -a zayapasses on Vulkan and CPU, including save/reload.Note: a non-causal decode needs the whole image in one ubatch, so run with
-ubat least the image's token count;-b 4096 -ub 4096covers Qwen2.5-VL's 4,096-token cap.🤖 Generated with Claude Code