adding xpu support#129
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for Intel XPU devices to the codebase, ensuring that device selection and synchronisation logic now handle Intel XPU hardware alongside CUDA and Apple MPS. The changes affect both the device synchronisation utility and the device selection logic in two key functions.
Decreased runtime
The elapsed time taken to annotate the NC_043029 test genome in
tests/test-datadecreased from 227 seconds to 36 seconds using the XPU implementation.Autotune
Autotune has also been patched and on my Intel ARC Lunar Lake the 0ptimal batch size is 251 (residues per batch 54518)
Known issues
1. Limited foldseek support
Foldseek supports some GPUs but does not support Intel® ARC XPUs, therefore you can not use the
--foldseek-gpuoption.2. Phold hangs upon completion
There is an issue where tearing down the XPU currently hangs. I am not sure if it is WSL2, the graphics driver [I'm currently using version 32.0.101.8132] or pytorch [I'm currently using version 2.11.0], however, neither of these can be fixed by phold!
I will update this thread when I find a fixed version, but I can't update my Intel®drivers at the moment.
In the meantime, this minimal code block recapitulates the hang, demonstrating it is not a Phold issue, but something to be aware of.
If your device hangs, open powershell and enter:
to reboot the WSL2 instance (the results are all saved).
Device support enhancements:
device_synchronizeinsrc/phold/features/autotune.pyto include synchronisation for Intel XPU devices usingtorch.xpu. synchronise (device), and changed MPS synchronisation to use the device argument.autotune_batching_real_data(src/phold/features/autotune.py) andget_T5_model(src/phold/features/predict_3Di.py) to check for Intel XPU availability and set the device accordingly. [1] [2]