Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: how to fine tune DeepSeek-R1-Distill-Qwen-7B with lora #6232

Open
2 tasks done
AI-HR opened this issue Feb 28, 2025 · 1 comment
Open
2 tasks done

[BUG]: how to fine tune DeepSeek-R1-Distill-Qwen-7B with lora #6232

AI-HR opened this issue Feb 28, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@AI-HR
Copy link

AI-HR commented Feb 28, 2025

Is there an existing issue for this bug?

  • I have searched the existing issues

The bug has not been fixed in the latest main branch

  • I have checked the latest main branch

Do you feel comfortable sharing a concise (minimal) script that reproduces the error? :)

Yes, I will share a minimal reproducible script.

🐛 Describe the bug

[extension] Time taken to load fused_optim_cuda op: 0.057875633239746094 seconds
[rank2]: Traceback (most recent call last):
[rank2]: File "/data/lzj/ColossalAI/applications/ColossalChat/lora_finetune.py", line 455, in
[rank2]: train(args)
[rank2]: File "/data/lzj/ColossalAI/applications/ColossalChat/lora_finetune.py", line 252, in train
[rank2]: model, optimizer, _, dataloader, lr_scheduler = booster.boost(
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/booster/booster.py", line 154, in boost
[rank2]: model, optimizer, criterion, dataloader, lr_scheduler = self.plugin.configure(
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/booster/plugin/moe_hybrid_parallel_plugin.py", line 457, in configure
[rank2]: model = HybridParallelModule(
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/booster/plugin/hybrid_parallel_plugin.py", line 86, in init
[rank2]: module, self.shared_params = shardformer.optimize(module, policy=custom_policy)
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/shardformer/shard/shardformer.py", line 55, in optimize
[rank2]: shared_params = sharder.shard()
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/shardformer/shard/sharder.py", line 41, in shard
[rank2]: shared_params = self.policy.get_shared_params()
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/colossalai/shardformer/policies/qwen2.py", line 482, in get_shared_params
[rank2]: id(qwen2_model.embed_tokens.weight) == id(self.model.lm_head.weight)
[rank2]: File "/data/miniconda3/envs/colossal/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
[rank2]: raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
[rank2]: AttributeError: 'Qwen2ForCausalLM' object has no attribute 'embed_tokens'

Environment

No response

@AI-HR AI-HR added the bug Something isn't working label Feb 28, 2025
@TongLi3701
Copy link
Member

For distill model, you can use the sft script directly.

lora_finetune.py is used for fine-tuning R1 model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants