Skip to content

Conversation

@HarliWu
Copy link

@HarliWu HarliWu commented Aug 8, 2023

There are two main updates:

  1. fschat.py: The users can call next_model() to switch to the next model when multiple checkpoints are available.
  2. utils.py: We can add new functions to support new offsite-tuning strategies (Note: you are required to add the new function to generate_adap_model() accordingly)

@HarliWu HarliWu changed the title Dev/llm Offsite-tuning model generation Aug 8, 2023
Copy link
Collaborator

@rayrayraykk rayrayraykk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the inline comments. Thx!

else:
try:
ckpt = torch.load(config.federate.save_to, map_location='cpu')
self.prefix = ['']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should prefix be passed by the config?

# No need for this attr
if hasattr(adap_model, 'teacher'):
import gc
import torch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about move line 48-49 to top:

try:
    import gc
    import torch
except ImportError:
    gc=None
    torch=None

new_model = set_layers(new_model, emulator_and_adapter)

if emulator_alignment:
new_model.student = layers
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge the latest commits in which bugs are fixed. (layers should be detached from new_model)

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

Successfully merging this pull request may close these issues.

2 participants