[bug] Unable to freeze specific layers of a pretrained model
@jlamypoirier đang làm issue này rồi.
Từ ngày 25/11/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
🐞 Describe the Bug
I'm trying to freeze specific layers of a pretrained model (for example only layer 0).
The problem is that loading a pretrained model like Apriel-Thinker will load its decoder config as a FixedBlockSequenceConfig. However I need to pass a block-pattern config to freeze only certain layers. e.g.
decoder:
type: pattern
pattern:
- train_block
- freeze_block
- freeze_block
blocks:
train_block:
mlp:
lr_scale: 1.e-12
freeze_block:
lr_scale: 1.e-12
We currently cannot reconcile these two configs.
So the solution would be to prevent loading the pretrained config with load_config: none, and re-pass the entire block config.
However this does not work currently because some type parameters are creeping into the decoder config:
'!!! block':
type: decoder
mixer:
type: attention
rotary:
type: none
mlp:
type: mlp
normalization:
type: layer_norm
🔄 Steps to Reproduce
Steps to reproduce the behavior:
- Fast-LLM version: https://github.com/ServiceNow/Fast-LLM/tree/b7c0de61662c61e83c617bd8157d0bf9426e3d52
- Train with the following config
pretrained:
format: mistral
path: /mnt/checkpoints/upstream/Apriel-Nemotron-15b-Thinker-reinit-attn-layer-0
load_config: none
model:
base_model:
decoder:
type: pattern
pattern:
- train_block
- freeze_block
- freeze_block
- freeze_block
blocks:
train_block:
mlp:
lr_scale: 1.e-12
freeze_block:
lr_scale: 1.e-12
type: gpt
- Fails during config validation with
fast_llm.config.NestedValidationError: Validation failed for field `model` of type `fast_llm.models.gpt.config.GPTModelConfig` in class fast_llm.models.gpt.config.GPTTrainerConfig:
Validation failed for field `base_model` of type `fast_llm.models.gpt.config.GPTBaseModelConfig` in class fast_llm.models.gpt.config.GPTModelConfig:
Validation failed for field `decoder` of type `fast_llm.layers.block.config.BlockSequenceConfig` in class fast_llm.models.gpt.config.GPTBaseModelConfig:
Unknown field `block` in class fast_llm.layers.block.config.PatternBlockSequenceConfig
The decoder config would look like:
decoder:
type: pattern
blocks:
train_block:
[...]
freeze_block:
[...]
pattern:
- train_block
- freeze_block
- freeze_block
- freeze_block
num_blocks: 50
'!!! block': <--- undesired entry coming from the pretrained checkpoint
type: decoder
mixer:
type: attention
rotary:
type: none
mlp:
type: mlp
normalization:
type: layer_norm
🎯 Expected Behavior
Should only load current config
- Ngôn ngữ chính
- Python
- Star
- 337
- Fork
- 52
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ServiceNow/Fast-LLM
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
ServiceNow/Fast-LLM#556 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
ServiceNow/Fast-LLM#538 ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
ServiceNow/Fast-LLM#533 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
ServiceNow/Fast-LLM#510 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
ServiceNow/Fast-LLM#507 ·
Tất cả issue của ServiceNow/Fast-LLM
Issue tương tự
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Git-Hospital/githealthcheck#61 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ramnes/notion-sdk-py#433 ·
-
Partial method descriptors raise on class accessCó thể đã có người làm @Gambit-Checkmate đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 19 ngày
-
docs pkg:core
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
pydantic/pydantic-ai#11929 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
intake/intake-esm#789 ·