Feature/hyperparameter tuning final #267
Open
+298
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Design
Implement hyperparameter tuning for the mLoRA project to optimize model parameters and improve task performance.
Files Modified
mlora_train_optuna.py
Purpose: This script introduces Optuna for automated hyperparameter tuning, focusing on parameters such as rank, alpha, learning_rate, and dropout.
Key Changes:
Objective Function: Defines an Optuna objective function that tests combinations of hyperparameters to minimize loss.
Task Configuration: Dynamically generates a task configuration using the tuned hyperparameters.
Execution: Sets up an Optuna study to run multiple trials, logging the best hyperparameters for improved model performance.
edited executor.py
Purpose: Manages task execution, model loading, and adapter application during training.
Key Changes:
Loss Tracking: Enhanced to log loss values for each task during training, integrating seamlessly with the hyperparameter tuning process.
Hooks: Added and refined hooks (init, running, ready, done, terminate) for better control over model adapter loading and task status.
Summary
These changes streamline and automate the process of finding optimal hyperparameters, improving model performance with minimal manual intervention. The integration with Optuna in mlora_train_optuna.py complements executor.py’s enhanced task management and loss tracking to support efficient tuning workflows.