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

Revising optional package imports #312

Merged
merged 8 commits into from
Oct 29, 2024

Conversation

laserkelvin
Copy link
Collaborator

This PR uses the package registry a little bit more uniformly in determining which optional dependencies have been installed and are available.

  • To support Intel XPUs being available in upstream PyTorch now, IPEX is no longer a required dependency and the accelerator and DDP strategies are imported if torch.xpu.is_available() or if IPEX was successfully imported. A warning will be posted if this module is loaded directly and if neither condition is fulfilled.
  • On a similar vein, torch_scatter and torch_sparse being unavailable or unimportable would mean every PyG model would not work even if they are not required. This PR adds checks to gracefully try and include those models with explicit torch_scatter and/or torch_sparse dependencies, and warns the user that they will not be available.

@laserkelvin laserkelvin added bug Something isn't working dependencies Pull requests that update a dependency file labels Oct 29, 2024
@laserkelvin
Copy link
Collaborator Author

The pre-commit workflow fails, because it's not picking up the fact that I'm adding the stuff to __all__ dynamically. I'm fine with this :P

@laserkelvin laserkelvin merged commit 86c6261 into IntelLabs:main Oct 29, 2024
1 of 4 checks passed
@laserkelvin laserkelvin deleted the pyg-optional-packages branch October 29, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants