mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-02-28 16:12:46 +01:00
metal : switch back to default.metallib (ggml/681)
ggml-ci
This commit is contained in:
parent
66d8f0b7f1
commit
0e26a6c92e
@ -1 +1 @@
|
|||||||
3fd01e00e40583ccd4b393a7c6502d6a4455a1d5
|
f96711108d55bdbbd277e6be07204dce6a94fb93
|
||||||
|
@ -258,14 +258,14 @@ struct ggml_metal_context * ggml_metal_init(int n_cb) {
|
|||||||
bundle = [NSBundle bundleForClass:[GGMLMetalClass class]];
|
bundle = [NSBundle bundleForClass:[GGMLMetalClass class]];
|
||||||
#endif
|
#endif
|
||||||
NSError * error = nil;
|
NSError * error = nil;
|
||||||
NSString * libPath = [bundle pathForResource:@"ggml" ofType:@"metallib"];
|
NSString * libPath = [bundle pathForResource:@"default" ofType:@"metallib"];
|
||||||
if (libPath != nil) {
|
if (libPath != nil) {
|
||||||
// pre-compiled library found
|
// pre-compiled library found
|
||||||
NSURL * libURL = [NSURL fileURLWithPath:libPath];
|
NSURL * libURL = [NSURL fileURLWithPath:libPath];
|
||||||
GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]);
|
GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]);
|
||||||
ctx->library = [ctx->device newLibraryWithURL:libURL error:&error];
|
ctx->library = [ctx->device newLibraryWithURL:libURL error:&error];
|
||||||
} else {
|
} else {
|
||||||
GGML_METAL_LOG_INFO("%s: ggml.metallib not found, loading from source\n", __func__);
|
GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);
|
||||||
|
|
||||||
NSString * sourcePath;
|
NSString * sourcePath;
|
||||||
NSString * ggmlMetalPathResources = [[NSProcessInfo processInfo].environment objectForKey:@"GGML_METAL_PATH_RESOURCES"];
|
NSString * ggmlMetalPathResources = [[NSProcessInfo processInfo].environment objectForKey:@"GGML_METAL_PATH_RESOURCES"];
|
||||||
@ -295,7 +295,7 @@ struct ggml_metal_context * ggml_metal_init(int n_cb) {
|
|||||||
#endif
|
#endif
|
||||||
// try to disable fast-math
|
// try to disable fast-math
|
||||||
// NOTE: this seems to have no effect whatsoever
|
// NOTE: this seems to have no effect whatsoever
|
||||||
// instead, in order to disable fast-math, we have to build ggml.metallib from the command line
|
// instead, in order to disable fast-math, we have to build default.metallib from the command line
|
||||||
// using xcrun -sdk macosx metal -fno-fast-math -c ggml-metal.metal -o ggml-metal.air
|
// using xcrun -sdk macosx metal -fno-fast-math -c ggml-metal.metal -o ggml-metal.air
|
||||||
// and go through the "pre-compiled library found" path above
|
// and go through the "pre-compiled library found" path above
|
||||||
//[options setFastMathEnabled:false];
|
//[options setFastMathEnabled:false];
|
||||||
|
Loading…
Reference in New Issue
Block a user