-
Notifications
You must be signed in to change notification settings - Fork 87
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 compatibility layer for PackedGraph
#84
Conversation
Codecov Report
@@ Coverage Diff @@
## main #84 +/- ##
==========================================
- Coverage 95.84% 95.00% -0.84%
==========================================
Files 32 33 +1
Lines 1419 1441 +22
==========================================
+ Hits 1360 1369 +9
- Misses 59 72 +13
Continue to review full report at Codecov.
|
A GPU equipped dedicated runner could work, let us look into this. |
Closes AstraZeneca#76. This PR first requires AstraZeneca#84 to be tested and merged. ## Blocked by - [ ] AstraZeneca#84
@benedekrozemberczki I just added a unit test that should demonstrate that the transfer to GPU works (but it only runs if a GPU is available, so the tests will pass on the current runner regardless) |
Good news! I tested the following on a google colab notebook with GPU embedded:
so I am confident that this PR does what's intended. |
@cthoyt this is amazing! |
@cthoyt Feel free to merge this! |
* Begin adding compatibility layer for packed graph * Fix import * Add compatibility layer for packing * Update gcnbmp.py * Add GPU support to pipeline Closes #76. This PR first requires #84 to be tested and merged. ## Blocked by - [ ] #84 * Update pipeline.py * Reduce code with better type hints * Update pipeline.py
Summary
This PR adds a compatibility layer for the packed graph class from torch drug while we're waiting for an upstream fix (DeepGraphLearning/torchdrug#70). This layer makes sure there's a
to()
function that takes a device, as we usually expect torch stuff to do.Changes
chemicalx.compat
torchdrug.data.PackedGraph
that implements theto()
functiontorchdrug.data.Graph
that uses the monkey patched PackedGraph when called inchemicalx.data.drugfeatureset