File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -474,12 +474,21 @@ ggml_metal_device_t ggml_metal_device_init(void) {
474474
475475 dev->props .has_bfloat = [dev->mtl_device supportsFamily: MTLGPUFamilyMetal3_GGML];
476476 dev->props .has_bfloat |= [dev->mtl_device supportsFamily: MTLGPUFamilyApple6];
477+ if (getenv (" GGML_METAL_BF16_DISABLE" ) != NULL ) {
478+ dev->props .has_bfloat = false ;
479+ }
477480
478481 dev->props .has_tensor = [dev->mtl_device supportsFamily: MTLGPUFamilyMetal4_GGML];
479482 if (getenv (" GGML_METAL_TENSOR_DISABLE" ) != NULL ) {
480483 dev->props .has_tensor = false ;
481484 }
482485
486+ // TODO: tmp until figure out how to handle https://github.com/ggml-org/llama.cpp/pull/16634#issuecomment-3441726885
487+ if (dev->props .has_tensor && dev->props .has_bfloat ) {
488+ GGML_LOG_WARN (" %s : disabling bfloat support as a workaround for tensor API incompatibility\n " , __func__);
489+ dev->props .has_bfloat = false ;
490+ }
491+
483492 dev->props .use_residency_sets = true ;
484493#if defined(GGML_METAL_HAS_RESIDENCY_SETS)
485494 dev->props .use_residency_sets = getenv (" GGML_METAL_NO_RESIDENCY" ) == nil ;
You can’t perform that action at this time.
0 commit comments