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

Modify codes so that different accelerators can be called according to specific device conditions #844

Merged
merged 16 commits into from
Jan 11, 2024

Conversation

foin6
Copy link
Contributor

@foin6 foin6 commented Jan 8, 2024

Modifications in: DeepSpeedExamples/inference/huggingface/text-generation :

1、use "deepspeed.accelerator.get_accelerator()" to replace "cuda" specific codes;
2、Add "bfloat16" to dtype so that the code can run on CPUs;
3、fix an error in README setup commands with conda.

p.s. Before running it, you need to get support of idex(intel-extension-for-deepspeed) and ipex(intel-extension-for-pytorch).

@foin6
Copy link
Contributor Author

foin6 commented Jan 11, 2024

@tjruwase Hi, thanks for your approval. If there's no more problems, please take time to merge. Thanks.

@tjruwase tjruwase merged commit 6c31d8d into deepspeedai:master Jan 11, 2024
2 checks passed
stceum pushed a commit to stceum/DeepSpeedExamples that referenced this pull request Jan 27, 2024
…o specific device conditions (deepspeedai#844)

* modify inference-test.py to meet with the requirement of using Intel's device

* modify ds-hf-compare.py to meet with the requirement of using Intel's device

* use deepspeed.accelerator.get_accelerator() to replace the original hard code about cuda to access and enable the accelerators available(not just Nvidia's GPU) in the current device

* column 117: self.model.xpu().to(self.device)--->self.model.to(self.device) for generalization.

* For upstream, use get_accelerator() to hide backend. Add bf16 dtype for cpu.

* Update README.md

* Delete redundant comment code

* Delete +123 in README title

* delete checkpoints.json

* modify inference-test.py

* modify inference-test.py v2

* modify inference.py v3

* add bfloat16 for cpu

* fix an error in setup commands with conda

---------

Co-authored-by: Olatunji Ruwase <[email protected]>
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