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

Add pip install git+https://gitlab.com/ase/ase user advice on FrechetCellFilter ImportError and allow ase_filter to be str #104

Merged
merged 6 commits into from
Dec 11, 2023

Conversation

janosh
Copy link
Collaborator

@janosh janosh commented Dec 9, 2023

self.model = (model or CHGNet.load()).to(self.device)

TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

@janosh janosh added linting Cleaning up and refactoring code fix Bug fix PRs labels Dec 9, 2023
@@ -89,7 +89,7 @@ def __init__(
self.device = f"cuda:{cuda_devices_sorted_by_free_mem()[-1]}"

# Move the model to the specified device
self.model = (model or CHGNet.load()).to(self.device)
self.model = (model or CHGNet.load().float()).to(self.device)
Copy link
Collaborator Author

@janosh janosh Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BowenD-UCB Not sure it's generally a good idea to lower model precision? But I can't use the model on MPS without it.

Should we restrict the precision lowering to MPS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, not actually an issue with CHGNet. Was caused by running MACE and CHGNet in the same session. MACE calls torch.set_default_dtype(torch.float64), affecting all other torch models used concurrently.

@ilyes319 Can we make dtype fully local to MACE to make it compatible with other models?

"should no longer be used. Run pip install git+https://gitlab.com/ase/ase to "
"install from main branch."
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BowenD-UCB We now print this advice when ase.filters.FrechetCellFilter can't be imported.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this!

@janosh janosh changed the title Fix MPS model load Add pip install git+https://gitlab.com/ase/ase user advice and allow ase_filter to be str Dec 11, 2023
@janosh janosh changed the title Add pip install git+https://gitlab.com/ase/ase user advice and allow ase_filter to be str Add pip install git+https://gitlab.com/ase/ase user advice on FrechetCellFilter ImportError and allow ase_filter to be str Dec 11, 2023
@janosh janosh merged commit 3165efe into main Dec 11, 2023
10 checks passed
@janosh janosh deleted the fix-mps-model-load branch December 11, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs linting Cleaning up and refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants