fix _no_split_modules subscript error for transformers v5#683
fix _no_split_modules subscript error for transformers v5#683Maxusmusti merged 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughThe pull request refactors container access patterns by replacing direct index-based retrieval with iterator-based retrieval for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes
TypeError: 'set' object is not subscriptablewhen running FSDP training with transformers v5.x.In transformers v5,
_no_split_modulesis now converted to asetduring model initialization (post_init()), whereas it was previously alist. The code inget_fsdp_config()was using[0]to access the first element, which fails on sets.Fix: Use
next(iter(...))to retrieve an element, which works with both sets and lists.Test plan
Summary by CodeRabbit