From 74eccbf3fae68e6bcb3cb554b9b241f304334ef9 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Tue, 22 Jul 2025 07:00:53 -0700 Subject: [PATCH] use size option in binary (#2399) --- mlx/backend/cuda/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mlx/backend/cuda/CMakeLists.txt b/mlx/backend/cuda/CMakeLists.txt index 9f236b4ea2..a98308044b 100644 --- a/mlx/backend/cuda/CMakeLists.txt +++ b/mlx/backend/cuda/CMakeLists.txt @@ -87,6 +87,11 @@ endif() target_compile_options( mlx PRIVATE "$<$:--Wno-deprecated-gpu-targets>") +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.4.0) + target_compile_options( + mlx PRIVATE "$<$:--compress-mode=size>") +endif() + # Compute capability 7 is required for synchronization between CPU/GPU with # managed memory. TODO: Add more architectures for potential performance gain. set(MLX_CUDA_ARCHITECTURES