Skip to content

Conversation

@michaelfeil
Copy link
Owner

Related Issue

Checklist

  • I have read the CONTRIBUTING guidelines.
  • I have added tests to cover my changes.
  • I have updated the documentation (docs folder) accordingly.

Additional Notes

Add any other context about the PR here.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added comprehensive AMD GPU support to Infinity, enabling model deployment and optimization on AMD MI200/MI300 series GPUs with architecture-specific configurations.

  • Added AMD-specific Docker configurations in /libs/infinity_emb/Docker.template.yaml with separate build paths for gfx90a/gfx942 (source build) and gfx1100 (pre-built wheel)
  • Integrated MIGraphX and ROCm execution providers in /libs/infinity_emb/infinity_emb/transformer/utils_optimum.py for AMD GPU optimization
  • Added AMD deployment documentation in /docs/docs/deploy.md with specific run commands and flags for AMD GPUs
  • Disabled BetterTransformer for AMD platforms due to compatibility issues
  • Added CHECK_OPTIMUM_AMD optional import for AMD-specific optimizations

6 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

# GPU architecture specific installations
RUN cd /opt/rocm/share/amd_smi && python -m pip wheel . --wheel-dir=/install
RUN apt update -y && apt install migraphx -y
RUN if [ "$GPU_ARCH" = "gfx90a" ] || [ "$GPU_ARCH" = "gfx942" ]; then \
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Consider adding error handling and logging for failed installations. The script continues silently if any of the installation steps fail.

Comment on lines +73 to 75
elif "MIGraphXExecutionProvider" in available:
return "MIGraphXExecutionProvider" # swapped order of ROCM and MIGraphX
elif "ROCMExecutionProvider" in available:
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: MIGraphX is prioritized over ROCM here but reversed in the CUDA section above. Consider using consistent ordering.

Comment on lines 147 to +148
if files_optimized:
file_optimized = files_optimized[0]
file_optimized = files_optimized[-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Using files_optimized[-1] could be unstable if multiple optimized versions exist. Consider using version sorting or timestamps.

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 78.92%. Comparing base (d9050a7) to head (e6d3fa4).

Files with missing lines Patch % Lines
...nity_emb/infinity_emb/transformer/utils_optimum.py 57.14% 6 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #464      +/-   ##
==========================================
- Coverage   79.04%   78.92%   -0.13%     
==========================================
  Files          42       42              
  Lines        3408     3417       +9     
==========================================
+ Hits         2694     2697       +3     
- Misses        714      720       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelfeil michaelfeil merged commit f59df4f into main Nov 16, 2024
35 of 36 checks passed
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.

4 participants