Skip to content

Request for AdamW8bit support on CPU (would help TorchTune) #1226

Closed

Description

@sanchitintel

Feature request

Port AdamW8bit support for CPU from multi-backend-refactor branch to the main branch

Motivation

Public cloud providers' machines with GPUs are usually expensive while datacenter-grade CPUs are more readily available at lower prices. Towards the goal of making Deep Learning more accessible to developers & learners, the ability to finetune with AdamW8bit on CPU seems like a good milestone. TorchTune is currently unable to support full fine-tuning on CPU with AdamW8bit because it uses bitsandbytes' AdamW8bit optimizer.

#898 enabled AdamW8bit for CPU in multi-backend-refactor branch, but the main branch doesn't have it.

It'd be great if we could enable AdamW8bit for CPU in bitsandbytes main branch before TorchTune's next release (provided there would be a bitsandbytes release before that), so that users who'd install TorchTune would automatically end up installing a version of bitsandbytes that'd support AdamW8bit on CPU.

Thanks!

Your contribution

@jianan-gu could port over his code from multi-backend-refactor branch to the main branch.

cc @mingfeima @ashokei @TimDettmers

Activity

  1. changed the title [-]Request for PagedAdamW8bit support for CPU[/-] [+]Request for PagedAdamW8bit support on CPU[/+] on May 28, 2024
  2. sanchitintel commented on May 28, 2024

    @sanchitintel
    Author

    #1220 will fix this issue.

  3. changed the title [-]Request for PagedAdamW8bit support on CPU[/-] [+]Request for PagedAdamW8bit support on CPU (would help TorchTune)[/+] on May 28, 2024
  4. matthewdouglas commented on May 29, 2024

    @matthewdouglas
    Member

    #1220 will fix this issue.

    I don't recall seeing any optimizers implemented yet for CPU, but may be mistaken.

    Paged optimizer doesn't make sense to me for CPU, but I can understand the request for AdamW8bit.

  5. changed the title [-]Request for PagedAdamW8bit support on CPU (would help TorchTune)[/-] [+]Request for AdamW8bit support on CPU (would help TorchTune)[/+] on May 29, 2024
  6. sanchitintel commented on May 29, 2024

    @sanchitintel
    Author

    Thanks for pointing that out, @matthewdouglas! I've revised the description.

    @jianan-gu @Xia-Weiwen, please clarify if you had added AdamW8bit implementation for CPU to bitsandbytes. If not, do you have plans to add it? Thanks!

  7. Xia-Weiwen commented on May 29, 2024

    @Xia-Weiwen

    @sanchitintel Yes, we are going to do it. cc. @jianan-gu @jiqing-feng

  8. Titus-von-Koeller commented on Jun 3, 2024

    @Titus-von-Koeller
    Member

    @sanchitintel thanks for raising this. When is the next torchtune release foreseen?

    Hmm, the problem is that the device abstraction / dispatcher situation is still not stable. Things will change fundamentally in the next 3 weeks. Not sure if this can be done as a PR to main in isolation? @Xia-Weiwen could you sketch out a bit more how you think this would make sense?

  9. matthewdouglas commented on May 8, 2026

    @matthewdouglas
    Member

    Resolved by #1901.

  10. added this to the v0.50.0 milestone on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions