Custom Llama modeling and integration with llm-foundry #51
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.
Llama Training with Adapter Integration
Overview
This PR introduces a custom Llama implementation with an adapter pattern for integration with LLM Foundry and MosaicML Composer. The changes provide an end-to-end workflow for training Llama models (tested locally, need to be ported over to Modal).
Key Changes
Custom Llama Implementation (llmfoundry/models/llama/*)
Adapter Pattern Integration (llmfoundry/models/llama/model.py)
Local Training Workflow (local_llama_training_instruct.py)
Evaluation Improvements (llmfoundry/command_utils/eval.py)
Configuration Templates (scripts/train/yamls/llama/*)
Modal Integration
For Modal deployment, the integration follows the same pattern with these key considerations:
The implementation is designed to work in both local and Modal environments.
Additional Documentation
Please refer to the updated README.md for implementation details, including:
Testing
The implementation has been tested on hardware with 2x RTX 3090 for both LoRA fine-tuning and full model training scenarios. A single 24 GB GPU should suffice for training: in case of OOM errors, just adjust the yamls.