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

Make it optional to build CUDA extension for SAM 2; also fallback to all available kernels if Flash Attention fails #155

Merged

Commits on Aug 6, 2024

  1. Make it optional to build CUDA extension for SAM 2; also fallback to …

    …all available kernels if Flash Attention fails
    
    In this PR, we make it optional to build the SAM 2 CUDA extension, in observation that many users encounter difficulties with the CUDA compilation step.
    1. During installation, we catch build errors and print a warning message. We also allow explicitly turning off the CUDA extension building with `SAM2_BUILD_CUDA=0`.
    2. At runtime, we catch CUDA kernel errors from connected components and print a warning on skipping the post processing step.
    
    We also fall back to the all available kernels if the Flash Attention kernel fails.
    ronghanghu committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    1757177 View commit details
    Browse the repository at this point in the history