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

[BUG] Bad code sample in Inference tutorial #7082

Closed
riedgar-ms opened this issue Feb 26, 2025 · 0 comments · Fixed by #7083
Closed

[BUG] Bad code sample in Inference tutorial #7082

riedgar-ms opened this issue Feb 26, 2025 · 0 comments · Fixed by #7083
Assignees
Labels
bug Something isn't working inference

Comments

@riedgar-ms
Copy link

Describe the bug

The code in the section:
https://www.deepspeed.ai/tutorials/inference-tutorial/#initializing-for-inference
appears to be incorrect.

Specifically, in the first code block of that section

model = ds_engine.module
output = model('Input String')

should probably be:

model = ds_engine.module
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
print(f"{pipe('Hello')}")

(or something similar). The code in
https://www.deepspeed.ai/tutorials/inference-tutorial/#end-to-end-gpt-neo-27b-inference
is closer to what's required.

To Reproduce

I attempted to use the code sample as the basis for my own script.

Expected behavior

Code sample to work

ds_report output
Please run ds_report to give us details about your setup.

torch install path ............... ['/azureml-envs/azureml_28a03b9f9b7c5f401fdd179f0d3ee4d8/lib/python3.10/site-packages/torch']
torch version .................... 2.6.0+cu124
deepspeed install path ........... ['/azureml-envs/azureml_28a03b9f9b7c5f401fdd179f0d3ee4d8/lib/python3.10/site-packages/deepspeed']
deepspeed info ................... 0.16.4, unknown, unknown
torch cuda version ............... 12.4
torch hip version ................ None
nvcc version ..................... 12.1
deepspeed wheel compiled w. ...... torch 0.0, cuda 0.0
shared memory (/dev/shm) size .... 2.00 GB

Screenshots
If applicable, add screenshots to help explain your problem.

System info (please complete the following information):

  • OS: Ubuntu
  • GPU count and types [e.g. two machines with x8 A100s each]: Single machine with 4xA100
  • (if applicable) what DeepSpeed-MII version are you using
  • (if applicable) Hugging Face Transformers/Accelerate/etc. versions
  • Python version: 3.10
  • Any other relevant info about your setup

Docker context
Are you using a specific docker image that you can share?

Additional context

Running in AzureML.

@riedgar-ms riedgar-ms added bug Something isn't working inference labels Feb 26, 2025
@loadams loadams self-assigned this Feb 26, 2025
deepcharm pushed a commit to deepcharm/DeepSpeed that referenced this issue Feb 27, 2025
Fixes: deepspeedai#7082

---------

Signed-off-by: Logan Adams <[email protected]>
Signed-off-by: Max Kovalenko <[email protected]>
gyou2021 pushed a commit to gyou2021/DeepSpeed that referenced this issue Feb 28, 2025
Fixes: deepspeedai#7082

---------

Signed-off-by: Logan Adams <[email protected]>
Signed-off-by: gyou2021 <[email protected]>
tohtana pushed a commit that referenced this issue Feb 28, 2025
Fixes: #7082

---------

Signed-off-by: Logan Adams <[email protected]>
Signed-off-by: Masahiro Tanaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants