add FastVLM - #4864
Open
yicycyc wants to merge 4 commits into
Open
Conversation
risemeup1111
suggested changes
Aug 11, 2026
Contributor
There was a problem hiding this comment.
| 序号 | 位置 | 优先级 | 状态 |
|---|---|---|---|
| 1 | modeling.py:248 | ✅ | |
| 2 | processing.py:64 | ✅ | |
| 3 | modeling.py:211 | ✅ | |
| 4 | modeling.py:475 | ✅ |
Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.
risemeup1111
approved these changes
Aug 11, 2026
risemeup1111
approved these changes
Aug 11, 2026
PaddleFormers Log Analysis
Job logs (requires authentication)gh api repos/PaddlePaddle/PaddleFormers/actions/jobs/93731862468/logs > /tmp/job_93731862468.log |
risemeup1111
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PR 新增模型支持:FastVLM
本 PR 新增
apple/FastVLM-0.5B支持。复现对齐对象为模型仓库中的 HuggingFace remote-code 实现及原始 safetensors 权重,验证使用完整的 0.5B checkpoint。主要改动
paddleformers/transformers/fastvlm/FastVLMConfigFastVLMModelFastVLMForConditionalGenerationFastVLMVisionModelFastVLMProcessorFastVLMImageProcessorpaddleformers.transformersAutoConfigAutoModelForConditionalGenerationAutoProcessorAutoImageProcessortests/transformers/fastvlm/test_modeling.py前向对齐验证
模型:
apple/FastVLM-0.5B验证设置:
[1, 283, 151936]结果:
4.96e-28.96e-46.31e-30.99999990100%1.94e-34.67e-54.38e-40.9999999995100%满足前向对齐标准。
生成对齐
使用相同权重和输入进行 greedy generation,关闭采样,两侧前 10 个新 token 完全一致。
结论:前 10 个 token 匹配率为
10/10,生成对齐通过。训练验证
PaddleFormers 与 ms-swift 使用相同的预处理结果和样本顺序,在完整
apple/FastVLM-0.5B上完成单卡 BF16 full-parameter SFT。共同设置:
max_steps = 300per_device_train_batch_size = 1gradient_accumulation_steps = 1learning_rate = 1e-5lr_scheduler_type = constantwarmup_steps = 0weight_decay = 01.0seed = 421、纯文本
使用 GSM8K 300 条固定样本做 300-step full-SFT。
0.578080.59387+0.015780.488630.54707+0.058450.506980.59787+0.090880.956312、多模态
使用 PaddleFormers 多模态 SFT 数据格式准备 300 条固定图文样本,两侧使用完全相同的 token、label、图像张量和样本顺序。
3.018653.04167+0.023031.946691.93208-0.014611.779801.77458-0.005230.98178纯文本和多模态训练均跑满 300 step,两侧 loss 收敛趋势一致。