Skip to content

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

Merged
janosh merged 6 commits intomainfrom
fix-mps-model-load
Dec 11, 2023
Merged

Add pip install git+https://gitlab.com/ase/ase user advice on FrechetCellFilter ImportError and allow ase_filter to be str#104
janosh merged 6 commits intomainfrom
fix-mps-model-load

Conversation

@janosh
Copy link
Copy Markdown
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

# 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
Copy Markdown
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
Copy Markdown
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?

@janosh janosh force-pushed the fix-mps-model-load branch from 05a824a to 2fb533d Compare December 11, 2023 18:05
"should no longer be used. Run pip install git+https://gitlab.com/ase/ase to "
"install from main branch."
)

Copy link
Copy Markdown
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
Copy Markdown
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
@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