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

ModelSummary does not account for every type of precision strings #20598

Open
gugarosa opened this issue Feb 20, 2025 · 0 comments
Open

ModelSummary does not account for every type of precision strings #20598

gugarosa opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working needs triage Waiting to be triaged by maintainers ver: 2.5.x

Comments

@gugarosa
Copy link

gugarosa commented Feb 20, 2025

Bug description

The precision_to_bits dictionary in https://github.com/Lightning-AI/pytorch-lightning/blob/master/src/lightning/pytorch/utilities/model_summary/model_summary.py#L219 does not account for every type of precision, e.g., bf16-true.

This will fail in getting the proper key from the dictionary and will default to 32.

What version are you seeing the problem on?

v2.5, master

How to reproduce the bug

In lightning/pytorch/utilities/model_summary/model_summary.py:L219, just add the following when self._model.trainer.precision="bf16-true":

...
precision_to_bits = {"64": 64, "32": 32, "16": 16, "bf16": 16}
print(precision_to_bits.get(self._model.trainer.precision, 32))
raise
...

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- PyTorch Lightning Version (e.g., 2.5.0): master
#- PyTorch Version (e.g., 2.5): 2.5.1
#- Python version (e.g., 3.12): 3.10
#- OS (e.g., Linux): Ubuntu 22.04
#- CUDA/cuDNN version: 12.4
#- GPU models and configuration: 4xNVIDIA H100 NVL
#- How you installed Lightning(`conda`, `pip`, source): pip

More info

No response

@gugarosa gugarosa added bug Something isn't working needs triage Waiting to be triaged by maintainers labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Waiting to be triaged by maintainers ver: 2.5.x
Projects
None yet
Development

No branches or pull requests

1 participant