mllm icon indicating copy to clipboard operation
mllm copied to clipboard

Added Qwen3.5 0.8B

Open FarmersWrap opened this issue 8 months ago • 1 comments

Please check Guidelines for Contributing.

Summary by CodeRabbit

  • New Features
    • Added support for Qwen3.5 model with hybrid attention architecture combining linear-attention GDN layers and full-attention blocks.
    • Introduced interactive CLI example for loading and chatting with Qwen3.5.
    • Added tokenizer implementation for Qwen3.5 with SentencePiece BPE integration.
    • Extended QNN AOT optimization with RoPE and SiLU operation handlers.

FarmersWrap avatar Mar 22 '26 00:03 FarmersWrap

[!IMPORTANT]

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7893796-2325-4e49-bb38-22d788da2387

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces comprehensive support for the Qwen3.5 language model, including model configuration, architecture with hybrid attention mechanisms (full attention and GDN layers), tokenization, and a CLI example. It also extends the QNN AOT backend with new lowering patterns for SiLU and RoPE operations.

Changes

Cohort / File(s) Summary
QNN AOT Lowering Visitors
mllm/backends/qnn/aot/passes/LLM2QnnLoweringPass.cpp, mllm/backends/qnn/aot/visitor/SiLU.*, mllm/backends/qnn/aot/visitor/RoPE.*
Added QNN AOT pattern handlers for SiLU and RoPE operations. SiLU decomposes into Sigmoid and ElementWiseMultiply nodes; RoPE creates a custom HTP node with pose_type parameter. Patterns are registered in the lowering pass registry.
Qwen3.5 Model Architecture
mllm/models/qwen3_5/configuration_qwen3_5.hpp, mllm/models/qwen3_5/modeling_qwen3_5.hpp, mllm/models/qwen3_5/modeling_qwen3_5_qnn_aot.hpp
Introduced Qwen3.5 configuration parsing (hybrid attention settings, partial RoPE, GDN parameters) and model implementation featuring 18 GDN layers with linear-attention-style computation and 6 full-attention layers with output gating, plus helper routines for partial RoPE rotation.
Qwen3.5 Tokenization
mllm/models/qwen3_5/tokenization_qwen3_5.hpp
Added Qwen3.5-compatible tokenizer with regex-based splitting, BPE encoding/decoding, special token handling, and message template conversion for chat inputs.
Qwen3.5 Example Application
examples/qwen3_5/main.cpp, examples/qwen3_5/CMakeLists.txt, examples/CMakeLists.txt
Added interactive CLI example (mllm-qwen3-5-runner) for loading Qwen3.5 models, supporting streaming chat generation, Perfetto profiling, and memory reporting.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • UbiquitousLearning/mllm#596: Extends LLM2QnnLoweringPass by registering additional QNN AOT lowering visitor patterns similarly to how this PR adds SiLU and RoPE patterns.
  • UbiquitousLearning/mllm#577: Modifies the QNN AOT lowering pipeline and pattern registration infrastructure that this PR builds upon.
  • UbiquitousLearning/mllm#616: Adds QNN AOT lowering support and example workflows for Qwen models in parallel with this PR's pattern implementations.

Suggested reviewers

  • liang1232018
  • chenghuaWang
  • oreomaker

Poem

🐰 A Qwen hops forth with hybrid grace, Full attention and GDN intertwine, RoPE spins while SiLU graces the place, QNN patterns align so fine, Chat flows stream, memories trace! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains the contribution template and a link to guidelines without any implementation details, objectives, or actual description content. Provide a detailed description explaining the Qwen3.5 addition, including key features (hybrid attention, GDN layers, partial RoPE), QNN AOT support, and any breaking changes or migration notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 10.20% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Added Qwen3.5 0.8B' directly matches the main change—adding comprehensive support for the Qwen3.5 model including configuration, tokenizer, modeling, and example code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

[!TIP]

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

coderabbitai[bot] avatar Mar 22 '26 00:03 coderabbitai[bot]