Skip to content

Enable AMP Compatibility for GCP Model to Reduce VRAM Usage #102

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

Merged
merged 3 commits into from
Apr 27, 2025

Conversation

mahdip72
Copy link
Contributor

This update allows the GCP model to be used with Automatic Mixed Precision (AMP) training without encountering dtype mismatch errors. Previously, the following error occurred during AMP training:

"proteinworkshop/models/graph_encoders/layers/gcp.py", line 271, in scalarize local_scalar_rep_i[edge_mask] = torch.matmul( RuntimeError: Index put requires the source and destination dtypes match, got Float for the destination and Half for the source.</module>

Based on my experiments using Huggingface Accelerate AMP (fp16), it reduces VRAM usage by approximately 40% during training.

@amorehead
Copy link
Collaborator

LGTM

@amorehead
Copy link
Collaborator

@mahdip72, may I ask you to also update the CHANGELOG.md?

@mahdip72
Copy link
Contributor Author

I’ve updated CHANGELOG.md under 0.2.6 (UNRELEASED).

@amorehead amorehead merged commit da7cfe6 into a-r-j:main Apr 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants