Skip to content
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® Gaudi® HPU Support #484

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

BartoszBLL
Copy link

This PR introduces support for Intel® Gaudi® HPUs, including necessary changes for seamless execution on HPU devices.

Key Changes

  • HPU Integration
    • get_device_initial() utility to select the best available device (HPU, CUDA, or CPU).
    • HPU-specific handling in clip.py (wrapping models with Habana optimizations).
  • Docker Support
    • New Dockerfile.hpu for building an environment supporting Intel® Gaudi® HPUs.
    • requirements_hpu.txt for HPU-specific dependencies.
  • Documentation Updates
    • README.md now includes HPU setup instructions (Docker build, run, and usage).
    • Steps to run benchmarks on HPUs.
  • Extended Testing
    • New tests in tests/test_consistency.py for HPU vs. CPU consistency checks.
    • Additional test cases for HPU support.

Benchmark Results

Average across 10 runs

Device Average Execution Time (s)
HPU 0.4225
CPU 199.0485

How to Test

# Build Docker image for HPU
docker build -t clip_hpu:latest -f Dockerfile.hpu .

# Run the container
docker run -it --runtime=habana clip_hpu:latest

# Inside the container, run tests
pytest

Notes

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.

None yet

2 participants