Technical Overview
When training is interrupted and subsequently resumed, the pipeline attempts to load intermediate weights from a local checkout directory. If the model checkpoint was originally processed using customized PEFT forks or experimental versions, adapter_config.json contains parameter definitions (e.g., alora_invocation_tokens, corda_config, or arrow_config) that the installed version of LoraConfig cannot parse.
Affected Modules
- File:
src/train.py (Line 60-83)
- Target Classes:
LoraConfig and PeftModel
Detailed Traceback / Context
TypeError: __init__() got an unexpected keyword argument 'alora_invocation_tokens'
Acceptance Criteria
- Flexible Loading: Resuming training from existing checkpoints works even when configurations contain non-standard attributes.
- Precision Cleaning: Only unsupported parameters are deleted from the JSON config, leaving the critical
r, lora_alpha, target_modules, and class configurations intact.
- Safety Verification: Safe configurations are serialized back to disk to prevent identical errors on subsequent save intervals.
Proposed Implementation Approach
Implement a dynamic configuration inspection layer utilizing Python's inspect library before reloading the adapter:
import json
import inspect
from peft import LoraConfig
config_path = os.path.join(last_checkpoint, "adapter_config.json")
if os.path.exists(config_path):
with open(config_path, "r") as f:
config_data = json.load(f)
# Extract only parameters that map to the current PEFT signature
valid_keys = set(inspect.signature(LoraConfig.__init__).parameters.keys())
new_config = {k: v for k, v in config_data.items() if k in valid_keys}
if len(new_config) < len(config_data):
with open(config_path, "w") as f:
json.dump(new_config, f, indent=4)
Severity & Priority
- Severity: High (Prevents checkpoint recovery and resumes)
- Priority: P1
Technical Overview
When training is interrupted and subsequently resumed, the pipeline attempts to load intermediate weights from a local checkout directory. If the model checkpoint was originally processed using customized PEFT forks or experimental versions,
adapter_config.jsoncontains parameter definitions (e.g.,alora_invocation_tokens,corda_config, orarrow_config) that the installed version ofLoraConfigcannot parse.Affected Modules
src/train.py(Line 60-83)LoraConfigandPeftModelDetailed Traceback / Context
Acceptance Criteria
r,lora_alpha,target_modules, and class configurations intact.Proposed Implementation Approach
Implement a dynamic configuration inspection layer utilizing Python's
inspectlibrary before reloading the adapter:Severity & Priority