Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
#
# ==============================================================================

.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
.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

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

voxtral_tts-cpu:
@echo "==> Building and installing ExecuTorch..."
cmake --workflow --preset llm-release
@echo "==> Building Voxtral TTS runner (CPU)..."
cd examples/models/voxtral_tts && cmake --workflow --preset voxtral-tts-cpu
@echo ""
@echo "✓ Build complete!"
@echo " Binary: cmake-out/examples/models/voxtral_tts/voxtral_tts_runner"

voxtral_tts-cuda:
@echo "==> Building and installing ExecuTorch with CUDA..."
cmake --workflow --preset llm-release-cuda
@echo "==> Building Voxtral TTS runner with CUDA..."
cd examples/models/voxtral_tts && cmake --workflow --preset voxtral-tts-cuda
@echo ""
@echo "✓ Build complete!"
@echo " Binary: cmake-out/examples/models/voxtral_tts/voxtral_tts_runner"

qwen3_5_moe-cuda:
@echo "==> Building and installing ExecuTorch with CUDA..."
cmake --workflow --preset llm-release-cuda
Expand Down
106 changes: 106 additions & 0 deletions examples/models/voxtral_tts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.24)
project(voxtral_tts)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

set(_common_include_directories ${EXECUTORCH_ROOT}/..)

# gflags
set(gflags_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/gflags)
find_package(gflags REQUIRED)

# ExecuTorch
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
executorch_target_link_options_shared_lib(executorch)

set(link_libraries executorch gflags)

# Common ops
list(APPEND link_libraries optimized_native_cpu_ops_lib cpublas eigen_blas)
executorch_target_link_options_shared_lib(optimized_native_cpu_ops_lib)

# CPU-only builds need quantized and custom ops
if(NOT EXECUTORCH_BUILD_CUDA)
list(APPEND link_libraries quantized_ops_lib custom_ops)
executorch_target_link_options_shared_lib(quantized_ops_lib)
executorch_target_link_options_shared_lib(custom_ops)
endif()

# XNNPACK
if(TARGET xnnpack_backend)
set(xnnpack_backend_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod)
if(TARGET kleidiai)
list(APPEND xnnpack_backend_libs kleidiai)
endif()
list(APPEND link_libraries ${xnnpack_backend_libs})
executorch_target_link_options_shared_lib(xnnpack_backend)
endif()

# LLM runner extension
if(NOT TARGET extension_llm_runner)
message(
FATAL_ERROR
"ExecuTorch must be installed with EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER enabled."
)
endif()

if(ANDROID)
list(APPEND link_libraries log)
endif()

list(
APPEND
link_libraries
extension_llm_runner
extension_module
extension_data_loader
extension_tensor
extension_flat_tensor
)

# CUDA backend
if(EXECUTORCH_BUILD_CUDA)
find_package(CUDAToolkit REQUIRED)
list(APPEND link_libraries aoti_cuda_backend)
if(NOT MSVC)
executorch_target_link_options_shared_lib(aoti_cuda_backend)
endif()
endif()

# Metal backend
if(EXECUTORCH_BUILD_METAL)
list(APPEND link_libraries metal_backend)
executorch_target_link_options_shared_lib(metal_backend)
endif()

# Tokenizer
list(APPEND link_libraries tokenizers::tokenizers)

add_executable(
voxtral_tts_runner main.cpp voxtral_tts_runner.cpp wav_writer.cpp
)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options_gc_sections(voxtral_tts_runner)
if(NOT APPLE AND NOT MSVC)
target_link_options(voxtral_tts_runner PRIVATE "LINKER:-s")
endif()
endif()

target_include_directories(
voxtral_tts_runner PUBLIC ${_common_include_directories}
${EXECUTORCH_ROOT}/third-party/json/include
)
target_link_libraries(voxtral_tts_runner PUBLIC ${link_libraries})
target_compile_options(voxtral_tts_runner PUBLIC ${_common_compile_options})
90 changes: 90 additions & 0 deletions examples/models/voxtral_tts/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"version": 6,
"configurePresets": [
{
"name": "voxtral-tts-base",
"hidden": true,
"binaryDir": "${sourceDir}/../../../cmake-out/examples/models/voxtral_tts",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_FIND_ROOT_PATH": "${sourceDir}/../../../cmake-out",
"CMAKE_PREFIX_PATH": "${sourceDir}/../../../cmake-out"
}
},
{
"name": "voxtral-tts-cpu",
"displayName": "Voxtral TTS runner (CPU)",
"inherits": [
"voxtral-tts-base"
]
},
{
"name": "voxtral-tts-cuda",
"displayName": "Voxtral TTS runner (CUDA)",
"inherits": [
"voxtral-tts-base"
],
"cacheVariables": {
"EXECUTORCH_BUILD_CUDA": "ON"
},
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Linux",
"Windows"
]
}
}
],
"buildPresets": [
{
"name": "voxtral-tts-cpu",
"displayName": "Build Voxtral TTS runner (CPU)",
"configurePreset": "voxtral-tts-cpu",
"configuration": "Release",
"targets": [
"voxtral_tts_runner"
]
},
{
"name": "voxtral-tts-cuda",
"displayName": "Build Voxtral TTS runner (CUDA)",
"configurePreset": "voxtral-tts-cuda",
"configuration": "Release",
"targets": [
"voxtral_tts_runner"
]
}
],
"workflowPresets": [
{
"name": "voxtral-tts-cpu",
"displayName": "Voxtral TTS (CPU)",
"steps": [
{
"type": "configure",
"name": "voxtral-tts-cpu"
},
{
"type": "build",
"name": "voxtral-tts-cpu"
}
]
},
{
"name": "voxtral-tts-cuda",
"displayName": "Voxtral TTS (CUDA)",
"steps": [
{
"type": "configure",
"name": "voxtral-tts-cuda"
},
{
"type": "build",
"name": "voxtral-tts-cuda"
}
]
}
]
}
Loading
Loading