Skip to content

Support gpu devices without half float - #5891

Merged
timvisee merged 4 commits into
devfrom
support-gpu-devices-without-half-float
Jan 28, 2025
Merged

timvisee merged 4 commits into
devfrom
support-gpu-devices-without-half-float

Conversation

@IvanPleshkov

@IvanPleshkov IvanPleshkov commented Jan 27, 2025 •

Copy link
Copy Markdown
Contributor

Fix #5872

If GPU does not support f16, use f32 instead.

This PR includes:

  1. Fix the bug. Convert all f16 into f32 when GPU does not support f16.
  2. Provide skip_half_precision to force disabled halfs in tests.
  3. Unit test for this case.
  4. Fix printing of missed GPU features.
  5. Builder for gpu::Instance cause there are too many optional parameters.

GPU CI: https://github.com/qdrant/qdrant/actions/runs/12999767731

Comment thread lib/gpu/src/device.rs Resolved
Comment thread lib/gpu/src/device.rs
Comment on lines +143 to +144
let has_half_precision = !instance.skip_half_precision()
&& enabled_physical_device_features_1_2.shader_float16 == 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where we actually set the f16 flag depending on what the device supports. I missed this on my first pass, thanks!

@timvisee
timvisee merged commit 67d4f3b into dev Jan 28, 2025
@timvisee
timvisee deleted the support-gpu-devices-without-half-float branch January 28, 2025 09:39
timvisee added a commit that referenced this pull request Jan 28, 2025
* support gpu devices without half float

* disable f16 feature

* are you happy clippy

* Extend log warning if f16 is not supported

---------

Co-authored-by: Tim Visée <[email protected]>
@timvisee timvisee mentioned this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants