Skip to content

Commit 79c360f

Browse files
authored
Merge branch 'main' into export-D102359186
2 parents bd51c1c + 0a4756a commit 79c360f

14 files changed

Lines changed: 4898 additions & 1 deletion

Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
#
9292
# ==============================================================================
9393

94-
.PHONY: voxtral-cuda voxtral-cpu voxtral-metal voxtral-mlx voxtral_realtime-cuda voxtral_realtime-cpu voxtral_realtime-metal voxtral_realtime-mlx whisper-cuda whisper-cuda-debug whisper-cpu whisper-metal parakeet-cuda parakeet-cuda-debug parakeet-cpu parakeet-metal parakeet-mlx parakeet-vulkan dinov2-cuda dinov2-cuda-debug sortformer-cuda sortformer-cpu silero-vad-cpu llama-cuda llama-cuda-debug llama-cpu llava-cpu gemma3-cuda gemma3-cpu qwen3_5_moe-cuda qwen3_5_moe-metal clean help
94+
.PHONY: voxtral-cuda voxtral-cpu voxtral-metal voxtral-mlx voxtral_realtime-cuda voxtral_realtime-cpu voxtral_realtime-metal voxtral_realtime-mlx voxtral_tts-cpu voxtral_tts-cuda whisper-cuda whisper-cuda-debug whisper-cpu whisper-metal parakeet-cuda parakeet-cuda-debug parakeet-cpu parakeet-metal parakeet-mlx parakeet-vulkan dinov2-cuda dinov2-cuda-debug sortformer-cuda sortformer-cpu silero-vad-cpu llama-cuda llama-cuda-debug llama-cpu llava-cpu gemma3-cuda gemma3-cpu qwen3_5_moe-cuda qwen3_5_moe-metal clean help
9595

9696
help:
9797
@echo "This Makefile adds targets to build runners for various models on various backends. Run using \`make <target>\`. Available targets:"
@@ -103,6 +103,8 @@ help:
103103
@echo " voxtral_realtime-cpu - Build Voxtral Realtime runner with CPU backend"
104104
@echo " voxtral_realtime-metal - Build Voxtral Realtime runner with Metal backend (macOS only)"
105105
@echo " voxtral_realtime-mlx - Build Voxtral Realtime runner with MLX backend"
106+
@echo " voxtral_tts-cpu - Build Voxtral TTS runner (CPU)"
107+
@echo " voxtral_tts-cuda - Build Voxtral TTS runner with CUDA backend"
106108
@echo " whisper-cuda - Build Whisper runner with CUDA backend"
107109
@echo " whisper-cuda-debug - Build Whisper runner with CUDA backend (debug mode)"
108110
@echo " whisper-cpu - Build Whisper runner with CPU backend"
@@ -396,6 +398,24 @@ gemma3-cpu:
396398
@echo "✓ Build complete!"
397399
@echo " Binary: cmake-out/examples/models/gemma3/gemma3_e2e_runner"
398400

401+
voxtral_tts-cpu:
402+
@echo "==> Building and installing ExecuTorch..."
403+
cmake --workflow --preset llm-release
404+
@echo "==> Building Voxtral TTS runner (CPU)..."
405+
cd examples/models/voxtral_tts && cmake --workflow --preset voxtral-tts-cpu
406+
@echo ""
407+
@echo "✓ Build complete!"
408+
@echo " Binary: cmake-out/examples/models/voxtral_tts/voxtral_tts_runner"
409+
410+
voxtral_tts-cuda:
411+
@echo "==> Building and installing ExecuTorch with CUDA..."
412+
cmake --workflow --preset llm-release-cuda
413+
@echo "==> Building Voxtral TTS runner with CUDA..."
414+
cd examples/models/voxtral_tts && cmake --workflow --preset voxtral-tts-cuda
415+
@echo ""
416+
@echo "✓ Build complete!"
417+
@echo " Binary: cmake-out/examples/models/voxtral_tts/voxtral_tts_runner"
418+
399419
qwen3_5_moe-cuda:
400420
@echo "==> Building and installing ExecuTorch with CUDA..."
401421
cmake --workflow --preset llm-release-cuda
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
cmake_minimum_required(VERSION 3.24)
8+
project(voxtral_tts)
9+
10+
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
12+
13+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
14+
15+
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
16+
17+
set(_common_include_directories ${EXECUTORCH_ROOT}/..)
18+
19+
# gflags
20+
set(gflags_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/gflags)
21+
find_package(gflags REQUIRED)
22+
23+
# ExecuTorch
24+
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
25+
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
26+
executorch_target_link_options_shared_lib(executorch)
27+
28+
set(link_libraries executorch gflags)
29+
30+
# Common ops
31+
list(APPEND link_libraries optimized_native_cpu_ops_lib cpublas eigen_blas)
32+
executorch_target_link_options_shared_lib(optimized_native_cpu_ops_lib)
33+
34+
# CPU-only builds need quantized and custom ops
35+
if(NOT EXECUTORCH_BUILD_CUDA)
36+
list(APPEND link_libraries quantized_ops_lib custom_ops)
37+
executorch_target_link_options_shared_lib(quantized_ops_lib)
38+
executorch_target_link_options_shared_lib(custom_ops)
39+
endif()
40+
41+
# XNNPACK
42+
if(TARGET xnnpack_backend)
43+
set(xnnpack_backend_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod)
44+
if(TARGET kleidiai)
45+
list(APPEND xnnpack_backend_libs kleidiai)
46+
endif()
47+
list(APPEND link_libraries ${xnnpack_backend_libs})
48+
executorch_target_link_options_shared_lib(xnnpack_backend)
49+
endif()
50+
51+
# LLM runner extension
52+
if(NOT TARGET extension_llm_runner)
53+
message(
54+
FATAL_ERROR
55+
"ExecuTorch must be installed with EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER enabled."
56+
)
57+
endif()
58+
59+
if(ANDROID)
60+
list(APPEND link_libraries log)
61+
endif()
62+
63+
list(
64+
APPEND
65+
link_libraries
66+
extension_llm_runner
67+
extension_module
68+
extension_data_loader
69+
extension_tensor
70+
extension_flat_tensor
71+
)
72+
73+
# CUDA backend
74+
if(EXECUTORCH_BUILD_CUDA)
75+
find_package(CUDAToolkit REQUIRED)
76+
list(APPEND link_libraries aoti_cuda_backend)
77+
if(NOT MSVC)
78+
executorch_target_link_options_shared_lib(aoti_cuda_backend)
79+
endif()
80+
endif()
81+
82+
# Metal backend
83+
if(EXECUTORCH_BUILD_METAL)
84+
list(APPEND link_libraries metal_backend)
85+
executorch_target_link_options_shared_lib(metal_backend)
86+
endif()
87+
88+
# Tokenizer
89+
list(APPEND link_libraries tokenizers::tokenizers)
90+
91+
add_executable(
92+
voxtral_tts_runner main.cpp voxtral_tts_runner.cpp wav_writer.cpp
93+
)
94+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
95+
target_link_options_gc_sections(voxtral_tts_runner)
96+
if(NOT APPLE AND NOT MSVC)
97+
target_link_options(voxtral_tts_runner PRIVATE "LINKER:-s")
98+
endif()
99+
endif()
100+
101+
target_include_directories(
102+
voxtral_tts_runner PUBLIC ${_common_include_directories}
103+
${EXECUTORCH_ROOT}/third-party/json/include
104+
)
105+
target_link_libraries(voxtral_tts_runner PUBLIC ${link_libraries})
106+
target_compile_options(voxtral_tts_runner PUBLIC ${_common_compile_options})
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"version": 6,
3+
"configurePresets": [
4+
{
5+
"name": "voxtral-tts-base",
6+
"hidden": true,
7+
"binaryDir": "${sourceDir}/../../../cmake-out/examples/models/voxtral_tts",
8+
"cacheVariables": {
9+
"CMAKE_BUILD_TYPE": "Release",
10+
"CMAKE_FIND_ROOT_PATH": "${sourceDir}/../../../cmake-out",
11+
"CMAKE_PREFIX_PATH": "${sourceDir}/../../../cmake-out"
12+
}
13+
},
14+
{
15+
"name": "voxtral-tts-cpu",
16+
"displayName": "Voxtral TTS runner (CPU)",
17+
"inherits": [
18+
"voxtral-tts-base"
19+
]
20+
},
21+
{
22+
"name": "voxtral-tts-cuda",
23+
"displayName": "Voxtral TTS runner (CUDA)",
24+
"inherits": [
25+
"voxtral-tts-base"
26+
],
27+
"cacheVariables": {
28+
"EXECUTORCH_BUILD_CUDA": "ON"
29+
},
30+
"condition": {
31+
"type": "inList",
32+
"string": "${hostSystemName}",
33+
"list": [
34+
"Linux",
35+
"Windows"
36+
]
37+
}
38+
}
39+
],
40+
"buildPresets": [
41+
{
42+
"name": "voxtral-tts-cpu",
43+
"displayName": "Build Voxtral TTS runner (CPU)",
44+
"configurePreset": "voxtral-tts-cpu",
45+
"configuration": "Release",
46+
"targets": [
47+
"voxtral_tts_runner"
48+
]
49+
},
50+
{
51+
"name": "voxtral-tts-cuda",
52+
"displayName": "Build Voxtral TTS runner (CUDA)",
53+
"configurePreset": "voxtral-tts-cuda",
54+
"configuration": "Release",
55+
"targets": [
56+
"voxtral_tts_runner"
57+
]
58+
}
59+
],
60+
"workflowPresets": [
61+
{
62+
"name": "voxtral-tts-cpu",
63+
"displayName": "Voxtral TTS (CPU)",
64+
"steps": [
65+
{
66+
"type": "configure",
67+
"name": "voxtral-tts-cpu"
68+
},
69+
{
70+
"type": "build",
71+
"name": "voxtral-tts-cpu"
72+
}
73+
]
74+
},
75+
{
76+
"name": "voxtral-tts-cuda",
77+
"displayName": "Voxtral TTS (CUDA)",
78+
"steps": [
79+
{
80+
"type": "configure",
81+
"name": "voxtral-tts-cuda"
82+
},
83+
{
84+
"type": "build",
85+
"name": "voxtral-tts-cuda"
86+
}
87+
]
88+
}
89+
]
90+
}

0 commit comments

Comments
 (0)