Skip to content

Qwen3-VL-2B export#68

Merged
carinapeng merged 11 commits into
apple:mainfrom
carinapeng:carina/qwen3vl-export
Jun 30, 2026
Merged

Qwen3-VL-2B export#68
carinapeng merged 11 commits into
apple:mainfrom
carinapeng:carina/qwen3vl-export

Conversation

@carinapeng

Copy link
Copy Markdown
Contributor

CoreAI export for Qwen3-VL-2B

Add Qwen3-VL vision-language model export support.

- gpu/qwen3_vl.py: Qwen3VLForCausalLM (text decoder, input_ids) and
  Qwen3VLForCausalLMEmbeddings (inputs_embeds variant for VLM fusion)
- primitives/macos/cache_scatter.py: slice_scatter-based explicit KV cache
  (avoids stateful mutable_slice_update Metal kernel issues)
- export_qwen3vl_explicit_kv.py: text decoder export (inputs_embeds, explicit KV)
- export_vision_encoder_224.py: vision encoder export (448x448 -> 196 visual tokens)
- registry.py: register qwen3_vl model entry
@carinapeng carinapeng requested a review from stikves June 29, 2026 17:35
Comment thread python/src/coreai_models/primitives/macos/cache_scatter.py
Comment thread python/export_qwen3vl.py Outdated
Comment thread python/src/coreai_models/models/gpu/__init__.py

@stikves stikves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but we might want to move the model to a better home

models/qwen3-vl or models/vlm?

Comment thread .gitignore

@stikves stikves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, please run one final end to end test before merging

@carinapeng

carinapeng commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! There is a gap in our VLM runner to show perf metrics, let's take that as a todo, will file an issue

@carinapeng carinapeng merged commit de896bf into apple:main Jun 30, 2026
3 checks passed
from coreai_models.primitives.macos.sdpa import SDPA


class Attention(nn.Module):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we miss unit tests for this authored model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants