SIGN IN SIGN UP

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

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.
R
Ronghang Hu committed
6f7e700c37d2aa9d8473365d191e0fd169cf8484
Parent: 0230c5f
Committed by GitHub <noreply@github.com> on 8/6/2024, 5:52:01 PM