[LoRA] 1/n Per-rank tensor serialization for load_lora_adapter_from_tensors under dp_size > 1 (#32580)
This commit is contained in:
@@ -342,9 +342,11 @@ class TestLoRALoadFromTensor(CustomTestCase):
|
||||
}
|
||||
serialized = MultiprocessingSerializer.serialize(bucket_dict, output_str=True)
|
||||
|
||||
# flattened_bucket callers pass one serialized copy per TP rank, same
|
||||
# as Engine.update_weights_from_tensor.
|
||||
result = self.engine.load_lora_adapter_from_tensors(
|
||||
lora_name="self_cognition_Alice_flattened",
|
||||
tensors=serialized,
|
||||
tensors=[serialized],
|
||||
config_dict=self.lora_config_dict,
|
||||
load_format="flattened_bucket",
|
||||
)
|
||||
|
||||
@@ -126,7 +126,7 @@ REGISTRY_TYPE_INSTANCES = {
|
||||
"LoadLoRAAdapterFromTensorsReqInput": LoadLoRAAdapterFromTensorsReqInput(
|
||||
lora_name="adapter",
|
||||
config_dict={"r": 8, "lora_alpha": 16, "target_modules": ["q_proj", "v_proj"]},
|
||||
serialized_tensors="",
|
||||
serialized_named_tensors=[b"tp0-bytes", b"tp1-bytes"],
|
||||
added_tokens_config={"<extra>": 32000},
|
||||
),
|
||||
"DumperControlReqInput": DumperControlReqInput(method="start", body={"k": "v"}),
|
||||
|
||||
Reference in New Issue
Block a user