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

Optimizer #7

Open
lucellent opened this issue Sep 25, 2024 · 3 comments
Open

Optimizer #7

lucellent opened this issue Sep 25, 2024 · 3 comments

Comments

@lucellent
Copy link

Is it possible to add adamw8bit?
I tried changing in the config, but it looks unsupported

@JusperLee
Copy link
Owner

Here's a suggested reply for your issue:


Thank you for bringing this up. It seems the current configuration doesn't support AdamW8bit by default. To resolve this, you'll need to modify the look2hear/system/optimizers.py file.

  1. First, ensure that the bitsandbytes library is installed, as it provides support for 8-bit optimizers like AdamW8bit:

    pip install bitsandbytes
    
  2. Then, in the optimizers.py file, import the necessary module:

    from bitsandbytes.optim import AdamW8bit
  3. Update the optimizer function to include AdamW8bit. For example, you can modify the section where optimizers are initialized:

    if optimizer_name == 'adamw8bit':
        optimizer = AdamW8bit(model.parameters(), lr=learning_rate, weight_decay=weight_decay)
  4. Finally, make sure your configuration supports the adamw8bit entry.

Once these changes are made, you should be able to run the model using AdamW8bit. Let me know if you encounter any issues during this process.


This should guide them in resolving the unsupported optimizer issue!

@Manoa1911
Copy link

does this do any good for CPU inference ?

@JusperLee
Copy link
Owner

I'm not entirely sure either, but from what I know, AdamW8bit is primarily optimized for GPU usage, and it may not provide the same benefits for CPU inference.

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

No branches or pull requests

3 participants