-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[OpenCL] Add OpenCL device for automatic target detection #16854
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
Conversation
|
Please, add CI tests. |
0207627 to
547140c
Compare
| def _detect_opencl(dev: Device) -> Target: | ||
| return Target( | ||
| { | ||
| "kind": "opencl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases, we can initialize OpenCL target with specifying specific device, e.g.:
target = Target("opencl -device=mali", host="llvm -mtriple=aarch64-linux-gnu")
or
target = Target("opencl -device=adreno", host="llvm -mtriple=arm64-linux-android")
Can we handle these cases somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, probably my question wasn't clear. Yes, I know that we can get such information from target. But I'm curious if we can get this information from the device somehow?
Probably, we can specify by an addition parameter to Target.from_device(input_device). For example: Target.from_device(input_device, '-device=adreno') will specify target as "kind": "opencl -device=adreno". Does it make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems there is no argument for '-device=adreno' in API Target.from_device.
This PR intends to fix weight conversion for MLC LLM on OrangePi (#1557), assuming there are no other issues. I would like to merge it first. If you have any suggestions, perhaps we can create another issue to discuss. Thanks.
This PR adds OpenCL device for automatic target detection.
Hi @echuraev |
echuraev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM. Thanks!

This PR adds OpenCL device for automatic target detection