Skip to content

Add LLaMA2 + LoRA Fine-Tuning Documentation for Greene HPC - #94

Merged
s-sajid-ali merged 9 commits into
mainfrom
llm_finetune
Jun 30, 2025
Merged

Add LLaMA2 + LoRA Fine-Tuning Documentation for Greene HPC#94
s-sajid-ali merged 9 commits into
mainfrom
llm_finetune

Conversation

@Yolo1105

Copy link
Copy Markdown
Contributor

This PR introduces a complete documentation guide for fine-tuning LLaMA2 using LoRA (PEFT) on NYU Greene HPC. The document includes:

  • Environment setup with Singularity and custom overlay creation
  • Python and dependency installation via Miniconda
  • Hugging Face cache redirection for disk quota management
  • sbatch job script for GPU-enabled training
  • PEFT configuration (LoRA)
  • Common errors encountered and their solutions (fully tabulated)
  • Training output artifacts and summary

@github-actions

github-actions Bot commented May 23, 2025

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-06-30 17:49 UTC

To avoid exceeding home directory quotas during large model downloads:

```bash
export HF_HOME=/scratch/ml7612/.cache/huggingface

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove your netid and change it to NetID to be more generic for readers.


---

## Model and Dataset Selection Rationale

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this section to the top and add a few lines on what the dataset is and how the fine-tuning helps the LLM perform better at a particular task. It would be great to have a response from an LLM before and after fine-tuning to demonstrate the effect of fine-tuning.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to switch to a different fine-tuning task it makes the task of demonstrating the benefits of fine-tuning easier.

/scratch/work/public/singularity/cuda11.2.2-cudnn8-devel-ubuntu20.04.sif \
/bin/bash -c "
source /ext3/miniconda3/bin/activate
cd /scratch/ml7612/fine-tune

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above on removing personal NetID.

/bin/bash -c "
source /ext3/miniconda3/bin/activate
cd /scratch/ml7612/fine-tune
python train_phi4.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If train_phi4.py is a small file, include it here. If not link to the repo.

@s-sajid-ali

s-sajid-ali commented May 27, 2025

Copy link
Copy Markdown
Member

Also, add a couple of lines on what LORA is. Someone new to this topic would not know the acronym so spell it out on first use and link to some references like https://huggingface.co/learn/llm-course/en/chapter11/4

@s-sajid-ali

Copy link
Copy Markdown
Member

Since the dataset we're fine tuning on is instruction, can we use a model with a known instruction tuned variant to compare against? How about using:
https://huggingface.co/google/gemma-3-4b-pt and https://huggingface.co/google/gemma-3-4b-it
(ref: https://huggingface.co/blog/gemma3#what-is-gemma-3)

Comment thread docs/hpc/08_ml_ai_hpc/04_llm_fine_tuning.md Outdated

**Current Applications**: Drug discovery, financial modeling, cryptography, and artificial intelligence research.

This comparison demonstrates how our custom fine-tuning can achieve similar or better instruction-following capabilities compared to the official instruction-tuned variant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be outside the output block.

@s-sajid-ali
s-sajid-ali merged commit 794ec3e into main Jun 30, 2025
5 checks passed
@s-sajid-ali
s-sajid-ali deleted the llm_finetune branch June 30, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants