explosion / curated-transformers

🤖 A PyTorch library of curated Transformer models and their composable components
MIT License
864 stars 34 forks source link

Ensure that parameters are leaf nodes when loading a model #362

Closed danieldk closed 9 months ago

danieldk commented 9 months ago

Description

There was a subtle bug where we populate models with parameters that are not leaf nodes because we called to on them for device placement.

This change fixes this issue and validates that all model parameters are leaf nodes in the model tests.

Checklist