-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/hyperparameter tuning final #267
base: main
Are you sure you want to change the base?
Feature/hyperparameter tuning final #267
Conversation
|
||
if args.base_model == "tinyllama": | ||
logging.info("Using TinyLlama_v1.1 model for testing") | ||
args.base_model = "/model/TinyLlama_v1.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use hard code
import os | ||
from typing import Dict | ||
|
||
import optuna |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add optuna to requirements.txt
from mlora.config.task import TrainTaskConfig | ||
|
||
# Set up logging | ||
logging.basicConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redunant code
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.