Skip to content
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

Update QAT: add grad clipping, torch.compile, collate fn #1854

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes/configs/llama2/7B_qat_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ device: cuda

# Memory management
enable_activation_checkpointing: True
memory_efficient_fsdp_wrap: False
enable_activation_offloading: False # True reduces memory

# Reduced precision
dtype: bf16
Expand Down
7 changes: 4 additions & 3 deletions recipes/configs/llama3/8B_qat_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ resume_from_checkpoint: False
# Fine-tuning arguments
batch_size: 2
epochs: 3
compile: False

# QAT arguments
quantizer:
Expand All @@ -59,13 +58,15 @@ loss:
_component_: torchtune.modules.loss.CEWithChunkedOutputLoss
max_steps_per_epoch: null
gradient_accumulation_steps: 1
compile: False

# Training env
device: cuda

# Memory management
enable_activation_checkpointing: True
memory_efficient_fsdp_wrap: True
enable_activation_offloading: False # True reduces memory
custom_sharded_layers: ['tok_embeddings', 'output']

# Reduced precision
dtype: bf16
Expand All @@ -74,6 +75,6 @@ dtype: bf16
metric_logger:
_component_: torchtune.training.metric_logging.DiskLogger
log_dir: ${output_dir}
output_dir: /tmp/alpaca-llama3-finetune
output_dir: /tmp/full-llama3-finetune
log_every_n_steps: 1
log_peak_memory_stats: True
Loading
Loading