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

add support for CPU and MPS #188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Sep 4, 2024

  1. add support for CPU and MPS

    do not use distributed when not available, instead use CPU or MPS.
    
    This entails a few changes:
    
    --device is now a valid flag to the library since `ilab` can pass CPU, MPS, or default to cuda
    when using CPU or MPS, do not initialize DS, instead put the model on the device and initialize `Adafactor` optimizer which is more efficient and than Adam based one
    inside of `train` add logic for handling if torch.cuda.is_available and torch.distributed.is_initialized() we dont use distributed torch on consumer systems
    the train loop needs some custom step and loss logic for a LlamaForCausalLM model, add that in
    when using CPU or MPS we are always world_size == 1 and local_rank == 0
    
    Signed-off-by: Charlie Doern <[email protected]>
    cdoern committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    c884f13 View commit details
    Browse the repository at this point in the history