-
Notifications
You must be signed in to change notification settings - Fork 47
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 Intel GPU support #1014
Comments
Hello 👋 Thank you for taking the time to open this issue with recognize. I know it's frustrating when software I look forward to working with you on this issue |
@marcelklehr , if above request is down to injecting Intel TensorFlow into the package, happy to try it with the build I've prepped (https://github.com/bugsyb/recognize_docker). Since I've fresh knowledge of these it will be easier to approach it now instead of in a 2-3 months, if possible. |
Sure it should be pretty easy, don't have time for it today I think, but I might be able to take a look at getting it up and running next week, since Intel stuff usually runs quite well in docker (AMD and Intel don't need any specific runtimes compared to NVIDIA). Also there's a tensorflow base image for Intel I think, so maybe just swapping the NVIDIA base image out already works. Is there any way to manually test it other than just setting it up with nextcloud and uploading an image? |
The end of the investigation is it works fine in docker and worked immediately:
But as someone decided to use TensorFlow.js for this project, and it doesn't yet support anything but NVIDIA:
and I lack skills with C and node-gyp to call the C API to fix it: tensorflow/tfjs#8040, so it doesn't help at all right now. Eventhough for someone who knows their way around it'd probably be reasonably easy, as it's only a single API call. Also the |
Whilst I'm not the code author, knowing there's switch for CPU/GPU and on that basis it makes choice to try GPU, as well as knowing when it fails on GPU, it seems to try with CPU - these are the two places in the code I'd focus on to make another deviation to check on XPU/Intel portion? In terms of the Dockerfile, seems like you're referring to: https://github.com/bugsyb/recognize_docker/tree/main/nvidia-tensor-based/custom-addons |
Yeah it just doesn't find non-CUDA devices obviously, because it can't load the python driver and it also has no option to load the C/libtensorflow driver. I know exactly which function has to be called, I just lack the skills with the NodeJS-to-C interface to implement it. |
Trying to help, it doesn't look like it would require that much of a knowledge as heavy lifting is done already. Have a look at output of this search: Majority of the output is where trust is change would need to be made:
For just PoC, I'd probably replace the tfjs-node-gpu with the intel one and see if it just does work (most probably it will given above discussion). Other point which most probably will arise is amount of RAM available for XPU, as current model requires shy of 4GB. One of systems I've tested it against had 2GB on GPU and it was failing to use GPU due to memory issue. Should you succeed with simple replacement as above, it might be then worth the work to add Admin level settings and adjust rest of the code. I can't help much with testing as don't have access to appropriate system, unless NUC 7th gen has it. If simple switch wouldn't work then it will require amendments around where GPU is searched for and have an option to accept XPU. |
Well that's what I'm trying to say, there is no Intel one... |
was there ever any update here? maybe someone that knows the missing piece to help button this up? (that person is not me, sorry, just poking to see if anyone's thought about this in the last 4 or 5 months) |
No one has taken up the blocking issue, so no until that's done, nothing can be done really... And for that we need someone with node-gyp knowledge. |
+1 |
It might be worth putting this on the TensorFlow GitHub, as opposed to the TFJS GitHub, given this is in regards to embedded languages? |
The C API in libtensorflow for embedded languages is already there (as an experimental API). The JS API just doesn't expose this API for use by clients. Further reading material: The function in question is |
Ideally, this could be tackled when moving the classification to a docker-based ExApp as suggested here: #73 In docker we could then use python which makes everything much easier. If you would like to see this, you can upvote via github reactions over there as well. |
Describe the feature you'd like to request
As many probably have a server with something like an old Intel processor with an iGPU (at least I have) it'd be cool to have support for those iGPUs (and also support for the ARC A series for free) to take some burden off the CPU.
Describe the solution you'd like
To work with Intel on tensor flow, you need to use the https://github.com/intel/intel-extension-for-tensorflow package and normally it should just pick up the Intel GPU as an accelerator device if everything is installed correctly. iGPUs aren't quite the first class citizen, but they should work reasonably well (see here) and support seems to go back to Skylake.
It'll probably be needs to be custom built anyway to support certain GPU families, so there's probably not much you need to do from your side, other than some guidance on how to build and where to install the result, to verify that it picks up accelerators other than NVIDIA and maybe to renaming of the NVIDIA GPU support toggle so something like GPU support.
AMD also would be nice to have for a full support, but they don't support their GPUs as an extension to tensorflow, but only as a replacement package, so that's probably a lot harder to realize.
Describe alternatives you've considered
Running it on the CPU. It's passable, but of course it isn't particularly fast, especially if you throw in a bunch of lange images at once and chews on quite some resources that the rest of the system could use.
Depends on: tensorflow/tfjs#8040
The text was updated successfully, but these errors were encountered: