@@ -897,15 +897,15 @@ def _validate_args(llm_config):
897897 "Shared embedding is only supported with torchao quantization."
898898 )
899899
900- if llm_config .multimethod_lora .enabled :
900+ if llm_config .multimethod .enabled :
901901 if llm_config .base .lora_config is not None :
902902 raise ValueError (
903- "Cannot use both base.lora_config and multimethod_lora .methods. "
904- "Use multimethod_lora .methods for all LoRA variants."
903+ "Cannot use both base.lora_config and multimethod .methods. "
904+ "Use multimethod .methods for all LoRA variants."
905905 )
906906 if llm_config .quantization .pt2e_quantize is not None :
907907 raise ValueError (
908- "PT2E quantization is not supported with multimethod_lora export."
908+ "PT2E quantization is not supported with multimethod export."
909909 )
910910 if (
911911 llm_config .backend .coreml .enabled
@@ -915,7 +915,7 @@ def _validate_args(llm_config):
915915 or llm_config .backend .openvino .enabled
916916 ):
917917 raise ValueError (
918- "multimethod_lora export only supports XNNPACK backend or portable ops"
918+ "multimethod export only supports XNNPACK backend or portable ops. "
919919 "Please disable other backends (coreml, vulkan, qnn, mps, openvino)."
920920 )
921921
@@ -1230,7 +1230,7 @@ def _to_edge_and_lower_llama( # noqa: C901
12301230
12311231
12321232def _get_xnnpack_partitioners (llm_config : LlmConfig ) -> Optional [List [Partitioner ]]:
1233- """Get XNNPACK partitioners for multimethod_lora export."""
1233+ """Get XNNPACK partitioners for multimethod export."""
12341234 partitioners = []
12351235
12361236 # Order matters here, dynamic quantization should be applied first when
@@ -1268,20 +1268,20 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
12681268 """
12691269 Export multiple methods (base + LoRA variants) to a single .pte file.
12701270
1271- For each method in llm_config.multimethod_lora .methods:
1271+ For each method in llm_config.multimethod .methods:
12721272 - If LoraConfig is None: use base model
12731273 - If LoraConfig is provided: create model with LoRA weights
12741274
12751275 Limitations:
1276- - Only XNNPACK backend is supported for multimethod_lora export.
1276+ - Only XNNPACK backend is supported for multimethod export.
12771277 - PT2E quantization is not supported.
12781278 - Each method is exported separately; export time scales linearly
12791279 with the number of methods.
12801280 - The final .pte file deduplicates shared weights automatically.
12811281 """
1282- num_methods = len (llm_config .multimethod_lora .methods )
1282+ num_methods = len (llm_config .multimethod .methods )
12831283 logging .info (
1284- f"multimethod_lora export: exporting { num_methods } method(s). "
1284+ f"multimethod export: exporting { num_methods } method(s). "
12851285 "Each method requires separate model instantiation and export."
12861286 )
12871287
@@ -1293,14 +1293,14 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
12931293 method_to_program : Dict [str , ExportedProgram ] = {}
12941294 first_builder = None
12951295
1296- for method_name , lora_config in llm_config .multimethod_lora .methods . items () :
1297- logging .info (f"Exporting method: { method_name } " )
1296+ for method in llm_config .multimethod .methods :
1297+ logging .info (f"Exporting method: { method . method_name } " )
12981298
12991299 # Create a copy of config with this method's LoRA setting
13001300 method_config = copy .deepcopy (llm_config )
1301- method_config .base .lora_config = lora_config
1302- # Disable multimethod_lora to avoid infinite recursion
1303- method_config .multimethod_lora .methods = {}
1301+ method_config .base .lora_config = method . lora_config
1302+ # Disable multimethod to avoid infinite recursion
1303+ method_config .multimethod .methods = []
13041304
13051305 # Load and prepare model for this method
13061306 builder = _prepare_for_llama_export (method_config )
@@ -1309,7 +1309,7 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
13091309
13101310 # Get the exported program
13111311 exported_program = builder ._export (builder .pre_autograd_graph_module )
1312- method_to_program [method_name ] = exported_program
1312+ method_to_program [method . method_name ] = exported_program
13131313
13141314 if first_builder is None :
13151315 first_builder = builder
@@ -1319,7 +1319,7 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
13191319 # Get partitioners based on backend config
13201320 partitioners = _get_xnnpack_partitioners (llm_config )
13211321
1322- # Lower all methods together using multimethod_lora API
1322+ # Lower all methods together using multimethod API
13231323 edge_config = first_builder ._get_edge_config ()
13241324 edge_manager = to_edge_transform_and_lower (
13251325 method_to_program ,
@@ -1333,7 +1333,7 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
13331333 first_builder .edge_manager = edge_manager
13341334 first_builder = first_builder .to_executorch (
13351335 passes = additional_passes ,
1336- share_mutable_buffers = llm_config .multimethod_lora .share_mutable_buffers ,
1336+ share_mutable_buffers = llm_config .multimethod .share_mutable_buffers ,
13371337 )
13381338
13391339 output_file = _get_output_filename (
@@ -1350,8 +1350,8 @@ def _export_llama_multimethod(llm_config: LlmConfig) -> LLMEdgeManager:
13501350def _export_llama (llm_config : LlmConfig ) -> LLMEdgeManager : # noqa: C901
13511351 _validate_args (llm_config )
13521352
1353- # Check for multimethod_lora export
1354- if llm_config .multimethod_lora .enabled :
1353+ # Check for multimethod export
1354+ if llm_config .multimethod .enabled :
13551355 return _export_llama_multimethod (llm_config )
13561356
13571357 pt2e_quant_params , quantizers , quant_dtype = get_quantizer_and_quant_params (
0 commit comments