Add Habana Gaudi (HPU) Support & Performance Benchmarks for Khoj #1125
+153
−6
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 PR introduces support for Habana Gaudi accelerators (HPUs) to the project, enabling the application to run on HPU devices in addition to the existing support for CUDA, MPS, and CPU. The changes include:
🚀 Key Updates
💎 Why This Matters:
HPU Support
This PR enables the application to leverage Habana Gaudi accelerators, which can provide significant performance improvements for deep learning workloads.
Flexibility
Users can now choose their preferred device (CUDA, HPU, MPS, or CPU) for running the application, making it more versatile across different hardware setups.
Optimization
The addition of optimum-habana ensures that models are optimized for HPU and other hardware, improving efficiency and performance.
⚡ Performance Benchmarks
HPU: ~0.2703s average runtime (10 runs)
CPU: ~76.3144s average runtime (10 runs)
Result: ~282× speedup using HPU compared to CPU.
🛠 How to Test
Use the new Dockerfile.hpu to build and run the application on a system with Habana Gaudi accelerators.
Check logs to confirm that HPU is recognized and in use.
✅ Checklist
📝 Notes
This PR is part of the effort to expand hardware support for the application, ensuring it can run efficiently on a wide range of devices.