foundation-model-stack / fms-fsdp

🚀 Efficiently (pre)training foundation models with native PyTorch features, including FSDP for training and SDPA implementation of Flash attention v2.
https://pytorch.org/docs/stable/fsdp.html
Apache License 2.0
116 stars 18 forks source link

Fix recursive type definitions #16

Closed afrittoli closed 4 months ago

afrittoli commented 4 months ago

Recursive type definitions require quotes to be used on the inner type name.

afrittoli commented 4 months ago

FYI @lchu-ibm @nairbv

nairbv commented 4 months ago

why did mypy tests pass without this change? is there something else wrong with the mypy configuration?

afrittoli commented 4 months ago

why did mypy tests pass without this change? is there something else wrong with the mypy configuration?

That's a good question, I was expecting mypy to catch that too. Unit tests would have caught that for sure as the code is not accepted by the python interpreter.