Skip to content

MultiScaleDeformableAttention CUDA Compilation Fails on PyTorch 2.6+ #29

@LadyAfrik

Description

@LadyAfrik

I encountered a compilation issue while setting up LLaVA-Grounding. When running:
CUDA_VISIBLE_DEVICES=0 python gradio_demo/LLaVA_G_Demo.py
--path_vision_cfg configs/openseed/openseed_swint_lang_joint_2st_visual_prompt.yaml
--path_inter_cfg configs/semsam/visual_prompt_encoder.yaml
--model_path checkpoints/llava_grounding

The program suggests running:
cd mask2former/modeling/pixel_decoder/ops
sh make.sh

However, when executing sh make.sh, compilation fails with the following error:
error: no suitable conversion function from "const at::DeprecatedTypeProperties" to "c10::ScalarType" exists

This appears to be an API change in PyTorch starting from version 2.6, causing issues with Deformable DETR’s custom CUDA kernel.

Reproduction Steps:
Install dependencies (Python 3.9+, PyTorch 2.6+, BitsandBytes 0.46.0).
Run the LLaVA-Grounding setup.
Attempt CUDA compilation (sh make.sh).
Observe error related to DeprecatedTypeProperties.

Workarounds Tried:
Installed a patched version of Transformers:
pip install -U git+https://github.com/qubvel/transformers@fix-custom-kernels
Still fails.

Checked for .type() occurrences in source files:
grep -rnw ~/LLaVA-Grounding/Mask2Former/ -e 'tensor.type()'
No relevant matches found.

Ensured all dependencies are correctly installed.

Additional Context: This issue may also impact other projects relying on Mask2Former + PyTorch 2.6+. Would appreciate guidance on an official fix or required code modifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions