madebyollin / maple-diffusion

Stable Diffusion inference on iOS / macOS using MPSGraph
https://madebyoll.in/posts/maple_diffusion/
MIT License
793 stars 51 forks source link

Recent Float16 removal commit causes problems on both macOS and iPadOS #16

Closed jackpal closed 1 year ago

jackpal commented 1 year ago

This commit causes crashes 8679427208eaf680bf88c70711af4b19528450ce

2022-10-17 21:00:17.526608-0700 maple-diffusion[89510:3383655] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001aaff0418 __exceptionPreprocess + 176
    1   libobjc.A.dylib                     0x00000001aab3aea8 objc_exception_throw + 60
    2   Foundation                          0x00000001abe425b8 __destroy_helper_block_e8_32o40r + 0
    3   MetalPerformanceShadersGraph        0x000000020fafdfa8 MetalPerformanceShadersGraph + 155560
    4   MetalPerformanceShadersGraph        0x000000020fafda60 MetalPerformanceShadersGraph + 154208
    5   MetalPerformanceShadersGraph        0x000000020fca8578 MetalPerformanceShadersGraph + 1901944
    6   MetalPerformanceShadersGraph        0x000000020fcade0c MetalPerformanceShadersGraph + 1924620
    7   maple-diffusion                     0x0000000104dbc818 $s15maple_diffusion14MapleDiffusionC21saveMemoryButBeSlowerACSb_tcfc + 2724
    8   maple-diffusion                     0x0000000104dbbd64 $s15maple_diffusion14MapleDiffusionC21saveMemoryButBeSlowerACSb_tcfC + 60
    9   maple-diffusion                     0x0000000104d9f178 $s15maple_diffusion11ContentViewVACycfC + 360
    10  maple-diffusion                     0x0000000104dc6e1c $s15maple_diffusion0a1_B3AppV4bodyQrvg7SwiftUI4ViewPAEE15navigationTitleyQrAE18LocalizedStringKeyVFQOyAgEE5frame8minWidth05idealO003maxO00N6Height0pR00qR09alignmentQr12CoreGraphics7CGFloatVSg_A5vE9AlignmentVtFQOyAA07ContentG0V_Qo__Qo_yXEfU_ + 288
    11  SwiftUI                             0x00000001d2b2ffb8 OUTLINED_FUNCTION_119 + 92
    12  maple-diffusion                     0x0000000104dc6c58 $s15maple_diffusion0a1_B3AppV4bodyQrvg + 356
    13  maple-diffusion                     0x0000000104dc7354 $s15maple_diffusion0a1_B3AppV7SwiftUI0C0AadEP4body4BodyQzvgTW + 12
    14  SwiftUI                             0x00000001d206ee24 OUTLINED_FUNCTION_3 + 13612
    15  SwiftUI                             0x00000001d24165ac OUTLINED_FUNCTION_266 + 9284
    16  SwiftUI                             0x00000001d206e19c OUTLINED_FUNCTION_3 + 10404
    17  SwiftUI                             0x00000001d2416904 OUTLINED_FUNCTION_266 + 10140
    18  SwiftUI                             0x00000001d2277f50 OUTLINED_FUNCTION_52 + 9520
    19  AttributeGraph                      0x00000001d30cd4b8 _ZN2AG5Graph11UpdateStack6updateEv + 520
    20  AttributeGraph                      0x00000001d30cdc38 _ZN2AG5Graph16update_attributeENS_4data3ptrINS_4NodeEEEj + 424
    21  AttributeGraph                      0x00000001d30d6498 _ZN2AG5Graph20input_value_ref_slowENS_4data3ptrINS_4NodeEEENS_11AttributeIDEjPK15AGSwiftMetadataRhl + 420
    22  AttributeGraph                      0x00000001d30ed71c AGGraphGetValue + 212
    23  SwiftUI                             0x00000001d2416708 OUTLINED_FUNCTION_266 + 9632
    24  SwiftUI                             0x00000001d24168dc OUTLINED_FUNCTION_266 + 10100
    25  SwiftUI                             0x00000001d2277f50 OUTLINED_FUNCTION_52 + 9520
    26  AttributeGraph                      0x00000001d30cd4b8 _ZN2AG5Graph11UpdateStack6updateEv + 520
    27  AttributeGraph                      0x00000001d30cdc38 _ZN2AG5Graph16update_attributeENS_4data3ptrINS_4NodeEEEj + 424
    28  AttributeGraph                      0x00000001d30d6498 _ZN2AG5Graph20input_value_ref_slowENS_4data3ptrINS_4NodeEEENS_11AttributeIDEjPK15AGSwiftMetadataRhl + 420
    29  AttributeGraph                      0x00000001d30ed71c AGGraphGetValue + 212
    30  SwiftUI                             0x00000001d2b30d78 OUTLINED_FUNCTION_119 + 3612
    31  SwiftUI                             0x00000001d2b30e58 OUTLINED_FUNCTION_119 + 3836
    32  SwiftUI                             0x00000001d1dc2258 dynamic_cast_existential_1_unconditional + 19732
    33  AttributeGraph                      0x00000001d30cd4b8 _ZN2AG5Graph11UpdateStack6updateEv + 520
    34  AttributeGraph                      0x00000001d30cdc38 _ZN2AG5Graph16update_attributeENS_4data3ptrINS_4NodeEEEj + 424
    35  AttributeGraph                      0x00000001d30d5b9c _ZN2AG5Graph9value_refENS_11AttributeIDEPK15AGSwiftMetadataRh + 192
    36  AttributeGraph                      0x00000001d30ed764 AGGraphGetValue + 284
    37  SwiftUI                             0x00000001d206bf54 OUTLINED_FUNCTION_3 + 1628
    38  SwiftUI                             0x00000001d2ac0ed8 OUTLINED_FUNCTION_1 + 22084
    39  SwiftUI                             0x00000001d206d3c4 OUTLINED_FUNCTION_3 + 6860
    40  SwiftUI                             0x00000001d2cd5bc8 OUTLINED_FUNCTION_11 + 10944
    41  SwiftUI                             0x00000001d2aed868 OUTLINED_FUNCTION_11 + 416
    42  SwiftUI                             0x00000001d2aed758 OUTLINED_FUNCTION_11 + 144
    43  SwiftUI                             0x00000001d232c9c8 OUTLINED_FUNCTION_1 + 136
    44  maple-diffusion                     0x0000000104dc72d4 $s15maple_diffusion0a1_B3AppV5$mainyyFZ + 40
    45  maple-diffusion                     0x0000000104dc737c main + 12
    46  dyld                                0x00000001aab6be50 start + 2544
)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'
terminating with uncaught exception of type NSException

MacOS 13.0 beta, iPadOS beta 16.1b57

madebyollin commented 1 year ago

Oops, try now? And, thanks for the warning!

jackpal commented 1 year ago

Yes, 63aae3b00261d23b0be7a8f1f1f0ee1b175d9d29 fixed the issue.