Commit 054add2
[Refactor] Replace skip_mm_profiling with deploy_modality=text to skip mm profiling (#7088)
原 `--skip-mm-profiling` 参数与已有的 `deploy_modality` 参数功能存在语义重叠:
当以纯文本模式(`deploy_modality=text`)部署时,本就不需要为多模态 token 预留显存。
引入独立参数增加了配置复杂度,复用 `deploy_modality` 更加直观和一致。
- `fastdeploy/engine/args_utils.py`:删除 `EngineArgs.skip_mm_profiling` 字段及
`--skip-mm-profiling` 启动参数
- `fastdeploy/config.py`:删除 `ModelConfig.__init__` 中的 `self.skip_mm_profiling = False`;
`FDConfig.get_max_chunk_tokens` 中将条件改为
`self.deploy_modality != DeployModality.TEXT`,
当 deploy_modality 为 text 时直接返回 `max_num_batched_tokens`,跳过 mm token 叠加
```bash
python -m fastdeploy.entrypoints.openai.api_server \
--deploy-modality text \
--model /path/to/model \
...
```
- [x] Add at least a tag in the PR title.
- [x] Format your code, run `pre-commit` before commit.
- [ ] Add unit tests. 本次为参数重构,逻辑等价替换,已有 config 单元测试覆盖。
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 077ec83 commit 054add2
1 file changed
Lines changed: 34 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1218 | 1249 | | |
1219 | 1250 | | |
1220 | 1251 | | |
| |||
1697 | 1728 | | |
1698 | 1729 | | |
1699 | 1730 | | |
| 1731 | + | |
1700 | 1732 | | |
1701 | 1733 | | |
1702 | 1734 | | |
| |||
1713 | 1745 | | |
1714 | 1746 | | |
1715 | 1747 | | |
1716 | | - | |
1717 | | - | |
| 1748 | + | |
1718 | 1749 | | |
1719 | 1750 | | |
1720 | 1751 | | |
| |||
2209 | 2240 | | |
2210 | 2241 | | |
2211 | 2242 | | |
2212 | | - | |
| 2243 | + | |
2213 | 2244 | | |
2214 | 2245 | | |
2215 | 2246 | | |
| |||
0 commit comments