agentscope-ai / agentscope-ai/TuFT

Support Qwen3.5 embedding LoRA adapters with vLLM

Đang mở
#153 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
69
Fork
14
Merge trung bình
6 giờ 31 phút
Pull request đã merge (30 ngày)
13

Mô tả

## Summary

Add end-to-end `train_unembed` support for Qwen3.5-based models (including Qwen3.6 and Qwen3.8, which use the same Transformers architecture) by training and serving a LoRA adapter on `embed_tokens`, matching Tinker's public API behavior.

This is intentionally separate from #149 / #150, which add the Gated DeltaNet attention targets. Until embedding-adapter serving is available, TuFT accepts the SDK-default `train_unembed=True` for Qwen models but does not add an embedding target.

## Upstream dependency

TuFT currently pins vLLM 0.24.0. vLLM has generic embedding-LoRA support, but the Qwen3.5 model did not register its embedding modules in v0.24.0 or v0.26.0.

The required Qwen3.5 registration was merged upstream in vLLM PR [#48850](https://github.com/vllm-project/vllm/pull/48850). Prefer waiting for and upgrading to a vLLM release that contains that change, rather than depending on an unreleased commit. If a backport is chosen instead, document that decision explicitly.

## Implementation notes

- Map `train_unembed=True` to `embed_tokens` for the Qwen3.5 architecture without affecting the vision encoder.
- Keep HF and FSDP target resolution and saved adapter metadata aligned.
- Extend TuFT's vLLM checkpoint-key compatibility for the flat Transformers `model.embed_tokens` path versus vLLM's nested `language_model.embed_tokens` path.
- Verify tied-embedding/base-weight behavior in PEFT checkpoints.
- Add an end-to-end GPU test that trains, exports, loads, and serves the embedding adapter through vLLM.
- Update the LoRA target-module documentation once support is enabled.

## Acceptance criteria

- A Qwen3.5-based run with `train_unembed=True` actually trains `embed_tokens`.
- The resulting adapter loads and serves successfully in the supported released vLLM version.
- HF and FSDP resolve the same embedding target and neither path targets the vision encoder.
- Existing Qwen attention/MLP and Gated DeltaNet LoRA behavior remains unchanged.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.