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

Lazy initialization of massive models #25

Open
xrsrke opened this issue Oct 27, 2023 · 1 comment
Open

Lazy initialization of massive models #25

xrsrke opened this issue Oct 27, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@xrsrke
Copy link
Owner

xrsrke commented Oct 27, 2023

  • Initialize a model that takes no host or CPU memory (for cases where the model is larger than the host memory)
  • Replay the operations that were played while initializing a model or a partition of the model

APIs

from pipegoose.utils import lazy_init

# load the model from `transformers`

with lazy_init(parallel_context):
		model = TensorParallel(model, parallel_context).parallelize()
		model = PipelineParallel(model, parallel_context).parallelize()
		model = DataParallel(model, parallel_context).parallelize()

logits = model(inputs)

Reading

@xrsrke xrsrke added the help wanted Extra attention is needed label Oct 27, 2023
@createsmit7
Copy link

Hello, please assign this to me.

@createsmit7 createsmit7 removed their assignment Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

2 participants