Skip to content

Commit

Permalink
deepspeed strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ardagoreci committed Aug 19, 2024
1 parent 5ef8659 commit f1db14c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions configs/trainer/deepspeed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
defaults:
- default

accelerator: gpu
devices: 1

precision: 'bf16-mixed' # 'bf16-true' # 'transformer-engine', 'transformer-engine-float16', '16-true', '16-mixed', 'bf16-true',
# 'bf16-mixed', '32-true',

# DeepSpeedStrategy
strategy:
_target_: lightning.pytorch.strategies.DeepSpeedStrategy
# ZeRO optimization
zero_optimization: True
stage: 2
offload_optimizer: False
offload_optimizer_device: "cpu" # only relevant if offload_optimizer=True
contiguous_gradients: True

# Activation Checkpointing
partition_activations: False
cpu_checkpointing: False

# Gradient accumulation
accumulate_grad_batches: 1

0 comments on commit f1db14c

Please sign in to comment.