2121function get_debug_options (; kwargs... )
2222 debug_options = get_default_debug_options ()
2323
24- # default overrides. can we changed by the user by passing in kwargs
24+ # default overrides. can be changed by the user by passing in kwargs
2525 debug_options. xla_gpu_cuda_data_dir = CUDA_DATA_DIR[]
2626 debug_options. xla_enable_enzyme_comms_opt = true
2727 debug_options. xla_gpu_experimental_use_raft_select_k = true
@@ -48,6 +48,13 @@ function get_debug_options(; kwargs...)
4848 return debug_options
4949end
5050
51+ struct CompileOptionsWithoutProto
52+ device_id:: Int64
53+ global_device_ids:: Vector{Int64}
54+ use_shardy_partitioner:: Bool
55+ use_spmd_partitioning:: Bool
56+ end
57+
5158function make_compile_options (;
5259 device_id:: Int64 ,
5360 num_replicas:: Int64 = 1 ,
@@ -57,14 +64,33 @@ function make_compile_options(;
5764 xla_executable_build_options= (;),
5865 xla_compile_options= (;),
5966)
67+ if (
68+ isempty (xla_debug_options) &&
69+ (
70+ isempty (xla_executable_build_options) || (
71+ length (xla_executable_build_options) == 2 &&
72+ haskey (xla_executable_build_options, :use_shardy_partitioner ) &&
73+ haskey (xla_executable_build_options, :use_spmd_partitioning )
74+ )
75+ ) &&
76+ isempty (xla_compile_options)
77+ )
78+ return CompileOptionsWithoutProto (
79+ device_id,
80+ mesh_ids === nothing ? Int64[] : mesh_ids,
81+ get (xla_executable_build_options, :use_shardy_partitioner , false ),
82+ get (xla_executable_build_options, :use_spmd_partitioning , false ),
83+ )
84+ end
85+
6086 compile_options = get_default_compile_options ()
6187 executable_build_options = compile_options. executable_build_options
6288
6389 executable_build_options. debug_options = get_debug_options (; xla_debug_options... )
6490 executable_build_options. num_replicas = num_replicas
6591 executable_build_options. num_partitions = num_partitions
6692
67- # default overrides. can we changed by the user by passing in kwargs
93+ # default overrides. can be changed by the user by passing in kwargs
6894 executable_build_options. allow_spmd_sharding_propagation_to_parameters = [false ]
6995 executable_build_options. allow_spmd_sharding_propagation_to_output = [false ]
7096
0 commit comments