Spaces:
Running
Running
build : update CBLAS flags + fix unused var warning (#0)
Browse files- CMakeLists.txt +1 -1
- Makefile +2 -0
- whisper.cpp +3 -4
CMakeLists.txt
CHANGED
|
@@ -116,7 +116,7 @@ if (APPLE)
|
|
| 116 |
message(STATUS "Accelerate framework found")
|
| 117 |
|
| 118 |
set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${ACCELERATE_FRAMEWORK})
|
| 119 |
-
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_ACCELERATE)
|
| 120 |
else()
|
| 121 |
message(FATAL_ERROR "Accelerate framework not found")
|
| 122 |
endif()
|
|
|
|
| 116 |
message(STATUS "Accelerate framework found")
|
| 117 |
|
| 118 |
set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${ACCELERATE_FRAMEWORK})
|
| 119 |
+
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_ACCELERATE -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64)
|
| 120 |
else()
|
| 121 |
message(FATAL_ERROR "Accelerate framework not found")
|
| 122 |
endif()
|
Makefile
CHANGED
|
@@ -185,6 +185,8 @@ ifndef WHISPER_NO_ACCELERATE
|
|
| 185 |
# Mac M1 - include Accelerate framework
|
| 186 |
ifeq ($(UNAME_S),Darwin)
|
| 187 |
CFLAGS += -DGGML_USE_ACCELERATE
|
|
|
|
|
|
|
| 188 |
LDFLAGS += -framework Accelerate
|
| 189 |
endif
|
| 190 |
endif
|
|
|
|
| 185 |
# Mac M1 - include Accelerate framework
|
| 186 |
ifeq ($(UNAME_S),Darwin)
|
| 187 |
CFLAGS += -DGGML_USE_ACCELERATE
|
| 188 |
+
CFLAGS += -DACCELERATE_NEW_LAPACK
|
| 189 |
+
CFLAGS += -DACCELERATE_LAPACK_ILP64
|
| 190 |
LDFLAGS += -framework Accelerate
|
| 191 |
endif
|
| 192 |
endif
|
whisper.cpp
CHANGED
|
@@ -1616,8 +1616,7 @@ static bool whisper_encode_external(const whisper_state & wstate) {
|
|
| 1616 |
|
| 1617 |
static struct ggml_cgraph * whisper_build_graph_conv(
|
| 1618 |
whisper_context & wctx,
|
| 1619 |
-
whisper_state & wstate
|
| 1620 |
-
const int mel_offset) {
|
| 1621 |
const auto & model = wctx.model;
|
| 1622 |
const auto & hparams = model.hparams;
|
| 1623 |
|
|
@@ -2001,7 +2000,7 @@ static bool whisper_encode_internal(
|
|
| 2001 |
{
|
| 2002 |
auto & alloc = wstate.alloc_conv.alloc;
|
| 2003 |
|
| 2004 |
-
ggml_cgraph * gf = whisper_build_graph_conv(wctx, wstate
|
| 2005 |
|
| 2006 |
if (!ggml_gallocr_alloc_graph(alloc, gf)) {
|
| 2007 |
// should never happen as we pre-allocate the memory
|
|
@@ -3024,7 +3023,7 @@ struct whisper_state * whisper_init_state(whisper_context * ctx) {
|
|
| 3024 |
{
|
| 3025 |
bool ok = whisper_allocr_graph_init(state->alloc_conv, ctx->backend,
|
| 3026 |
[&]() {
|
| 3027 |
-
return whisper_build_graph_conv(*ctx, *state
|
| 3028 |
});
|
| 3029 |
|
| 3030 |
if (!ok) {
|
|
|
|
| 1616 |
|
| 1617 |
static struct ggml_cgraph * whisper_build_graph_conv(
|
| 1618 |
whisper_context & wctx,
|
| 1619 |
+
whisper_state & wstate) {
|
|
|
|
| 1620 |
const auto & model = wctx.model;
|
| 1621 |
const auto & hparams = model.hparams;
|
| 1622 |
|
|
|
|
| 2000 |
{
|
| 2001 |
auto & alloc = wstate.alloc_conv.alloc;
|
| 2002 |
|
| 2003 |
+
ggml_cgraph * gf = whisper_build_graph_conv(wctx, wstate);
|
| 2004 |
|
| 2005 |
if (!ggml_gallocr_alloc_graph(alloc, gf)) {
|
| 2006 |
// should never happen as we pre-allocate the memory
|
|
|
|
| 3023 |
{
|
| 3024 |
bool ok = whisper_allocr_graph_init(state->alloc_conv, ctx->backend,
|
| 3025 |
[&]() {
|
| 3026 |
+
return whisper_build_graph_conv(*ctx, *state);
|
| 3027 |
});
|
| 3028 |
|
| 3029 |
if (!ok) {
|