Skip to content

clip.load segmentation fault #490

Open
@SylviaZiyuZhang

Description

@SylviaZiyuZhang

Code block

print(f"Prepare to load clip, {model}, {device}")
self.embedding_model, self.preprocessor = clip.load("ViT-L/14", "cpu")
print("Load clip")

Output

Prepare to load clip, ViT-L/14, cpu
zsh: segmentation fault  python evaluate.py

This only happens when clip is loaded in this OOP setting. This is the only ML model used in the software. Everything works normal in interactive shell.

Architecture and OS: macOS Sonoma (arm64)
Dependencies:
Python 3.11.8
Torch 2.6.0
Clip 1.0

lldb disassembly output:

Process 2008 stopped
* thread #4, stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
  thread #5, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
  thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
Target 0: (python) stopped.

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