aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed_cli.c34
-rw-r--r--embed_server.c43
2 files changed, 11 insertions, 66 deletions
diff --git a/embed_cli.c b/embed_cli.c
index 03121a2..1d62fc2 100644
--- a/embed_cli.c
+++ b/embed_cli.c
@@ -449,32 +449,6 @@ int main(int argc, char *argv[])
else if (!strcmp(f, "-b") || !strcmp(f, "--batch-size")) {
batch_size = atoi(argv[++arg_start]);
}
- else if (!strcmp(f, "--backend")) {
- const char *backend = argv[++arg_start];
- if (!strcmp(backend, "mlx")) {
-#ifdef USE_MLX
- use_mlx = 1;
- use_cuda = 0;
-#else
- fprintf(stderr, "mlx backend not available (build with: make metal)\n");
- return 1;
-#endif
- } else if (!strcmp(backend, "cuda")) {
-#ifdef USE_CUDA
- use_cuda = 1;
- use_mlx = 0;
-#else
- fprintf(stderr, "cuda backend not available (build with: make cuda)\n");
- return 1;
-#endif
- } else if (!strcmp(backend, "cpu")) {
- use_mlx = 0;
- use_cuda = 0;
- } else {
- fprintf(stderr, "invalid --backend: %s\n", backend);
- return 1;
- }
- }
else if (!strcmp(f, "--mlx-quant-bits")) {
mlx_quantize_bits = atoi(argv[++arg_start]);
if (mlx_quantize_bits != 0 && mlx_quantize_bits != 8) {
@@ -506,7 +480,7 @@ int main(int argc, char *argv[])
use_mlx = 1;
use_cuda = 0;
#else
- fprintf(stderr, "--mlx not available (build with: make metal)\n");
+ fprintf(stderr, "--mlx not available (build with: make mlx)\n");
return 1;
#endif
}
@@ -533,7 +507,7 @@ int main(int argc, char *argv[])
if (cuda_fast_gemm) {
#ifdef USE_CUDA
if (!use_cuda) {
- fprintf(stderr, "--cuda-gemm-mode requires --cuda or --backend cuda\n");
+ fprintf(stderr, "--cuda-gemm-mode requires --cuda\n");
return 1;
}
if (embed_cuda_set_fast_gemm(cuda_fast_gemm) != 0) {
@@ -549,7 +523,7 @@ int main(int argc, char *argv[])
if (cuda_weights) {
#ifdef USE_CUDA
if (!use_cuda) {
- fprintf(stderr, "--cuda-weight-dtype requires --cuda or --backend cuda\n");
+ fprintf(stderr, "--cuda-weight-dtype requires --cuda\n");
return 1;
}
if (!strcmp(cuda_weights, "bf16")) {
@@ -583,7 +557,7 @@ int main(int argc, char *argv[])
}
if (mlx_quantize_bits && !use_mlx) {
- fprintf(stderr, "--mlx-quant-bits requires --mlx or --backend mlx\n");
+ fprintf(stderr, "--mlx-quant-bits requires --mlx\n");
return 1;
}
diff --git a/embed_server.c b/embed_server.c
index b9e492c..a3317c0 100644
--- a/embed_server.c
+++ b/embed_server.c
@@ -3052,8 +3052,8 @@ static void print_usage(const char *prog)
"\n"
"Options:\n"
" --model ID=DIR Model to serve (repeatable)\n"
- " --backend cpu|mlx|cuda Execution backend (default: cpu); --mlx and\n"
- " --cuda are shorthands\n"
+ " --mlx Use Apple MLX GPU backend\n"
+ " --cuda Use NVIDIA CUDA GPU backend\n"
" --host HOST Bind host (default: 127.0.0.1)\n"
" --port N Bind port (default: 8000)\n"
" --api-key K Require Authorization: Bearer K\n"
@@ -3078,7 +3078,7 @@ static void print_usage(const char *prog)
"\n"
"Examples:\n"
" %s --model pplx-embed-v1-0.6b=./model --port 8000\n"
- " %s --backend mlx --mlx-quant-bits 8 \\\n"
+ " %s --mlx --mlx-quant-bits 8 \\\n"
" --model pplx-embed-v1-4b=./model-4b-bf16\n",
prog, prog, prog);
}
@@ -3157,41 +3157,12 @@ int main(int argc, char *argv[])
return 1;
}
}
- else if (!strcmp(f, "--backend")) {
- const char *backend = argv[++arg];
- if (!strcmp(backend, "mlx")) {
-#ifdef USE_MLX
- use_mlx = 1;
- use_cuda = 0;
-#else
- fprintf(stderr, "mlx backend not available (build with: make metal)\n");
- free_model_specs(&model_specs);
- return 1;
-#endif
- } else if (!strcmp(backend, "cuda")) {
-#ifdef USE_CUDA
- use_cuda = 1;
- use_mlx = 0;
-#else
- fprintf(stderr, "cuda backend not available (build with: make cuda)\n");
- free_model_specs(&model_specs);
- return 1;
-#endif
- } else if (!strcmp(backend, "cpu")) {
- use_mlx = 0;
- use_cuda = 0;
- } else {
- fprintf(stderr, "invalid --backend: %s\n", backend);
- free_model_specs(&model_specs);
- return 1;
- }
- }
else if (!strcmp(f, "--mlx")) {
#ifdef USE_MLX
use_mlx = 1;
use_cuda = 0;
#else
- fprintf(stderr, "--mlx not available (build with: make metal)\n");
+ fprintf(stderr, "--mlx not available (build with: make mlx)\n");
free_model_specs(&model_specs);
return 1;
#endif
@@ -3294,7 +3265,7 @@ int main(int argc, char *argv[])
return 1;
}
if (mlx_quantize_bits && !use_mlx) {
- fprintf(stderr, "--mlx-quant-bits requires --backend mlx\n");
+ fprintf(stderr, "--mlx-quant-bits requires --mlx\n");
free_model_specs(&model_specs);
return 1;
}
@@ -3302,7 +3273,7 @@ int main(int argc, char *argv[])
if (cuda_fast_gemm) {
#ifdef USE_CUDA
if (!use_cuda) {
- fprintf(stderr, "--cuda-gemm-mode requires --backend cuda\n");
+ fprintf(stderr, "--cuda-gemm-mode requires --cuda\n");
free_model_specs(&model_specs);
return 1;
}
@@ -3321,7 +3292,7 @@ int main(int argc, char *argv[])
if (cuda_weights) {
#ifdef USE_CUDA
if (!use_cuda) {
- fprintf(stderr, "--cuda-weight-dtype requires --backend cuda\n");
+ fprintf(stderr, "--cuda-weight-dtype requires --cuda\n");
free_model_specs(&model_specs);
return 1;
}