Skip to content

Conversation

@fmassa
Copy link
Contributor

@fmassa fmassa commented Aug 1, 2025

We were incorrectly always using the DTypeCastModule for all submodules in the model, which would lead to always performing the input and output casting. This should only be done at the root model

We were incorrectly always using the DTypeCastModule for all submodules in the model, which would lead to always performing the input and output casting. This should only be done at the root model
@fmassa fmassa requested review from ezyang and wconstab August 1, 2025 14:52
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 1, 2025
@wconstab
Copy link
Contributor

wconstab commented Aug 1, 2025

Lgtm. But out of curiosity what was the symptom you observed with this, did one of the extra casts have an observable effect?

@fmassa
Copy link
Contributor Author

fmassa commented Aug 1, 2025

Yeah, I was seeing some fp32 casts because that's what the output_dtype is by default (I believe)

@fmassa fmassa merged commit aaf6f5f into main Aug 1, 2025
6 checks passed
@fmassa fmassa deleted the fmassa/fix_cast_cls branch August 1, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants