modelscope / modelscope/ms-swift

Enhance support for gemma-4

Open
#9,534 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new feature request. / 我已经搜索过现有的 issues,确认这是一个新的 Feature Request。
Feature Request Description / Feature Request 描述

I tried to SFT gemma-4 with internal datasets today. There are several problems:

  1. gemma-4 do not support FA2, so I fallback to sdpa which is too slow;
  2. Do not support padding_free, as a result I cannot use sequence_parallel to decrease GPU memory consumption;
  3. No agent template support currently.

I use pip installed ms-swift 4.3.0 with cu128 & torch2.8

Pull Request / Pull Request 信息

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the Gemma-4 integration and the SFT paths handling FA2/SDPA, padding_free, sequence_parallel, and agent templates; done means the three listed capabilities work for Gemma-4 and their behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.