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

refactor: unify cpu gpu into device #577

Merged
merged 12 commits into from
Oct 18, 2022
Merged

refactor: unify cpu gpu into device #577

merged 12 commits into from
Oct 18, 2022

Conversation

bwanglzu
Copy link
Member

@bwanglzu bwanglzu commented Oct 16, 2022

Resolve inconsistency between fit end get_model, in fit we use cpu, in get_model we use gpu. Better to align with Docarray device='cpu' or device='cuda'.

This will not be a breaking change for internal users.

This will be a breaking change for ppl install finetuner-full when calling get_model.

A follow up ticket has been created to remove cpu in 0.7.0 #578

# training time
run = finetuner.fit(
    ...,
-   cpu=False,  # cpu is still supported, no breaking change, we sunset `cpu` after 0.7
+   device='cuda', # note, now `cuda` is the default device.
)

# inference time
inference_engine = finetuner.get_model(
     ...,
-    gpu=True, 
+    device='cuda',  # note, `cpu` is the default device unless user specify `cuda`.
)

  • This PR references an open issue
  • I have added a line about this change to CHANGELOG

@bwanglzu bwanglzu self-assigned this Oct 17, 2022
@bwanglzu bwanglzu marked this pull request as ready for review October 18, 2022 08:14
@github-actions github-actions bot added the area/testing This issue/PR affects testing label Oct 18, 2022
finetuner/experiment.py Outdated Show resolved Hide resolved
finetuner/experiment.py Outdated Show resolved Hide resolved
finetuner/__init__.py Outdated Show resolved Hide resolved
finetuner/__init__.py Show resolved Hide resolved
@github-actions
Copy link

📝 Docs are deployed on https://ft-refactor-device--jina-docs.netlify.app 🎉

@bwanglzu bwanglzu merged commit 9c981af into main Oct 18, 2022
@bwanglzu bwanglzu deleted the refactor-device branch October 18, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants