deepspeedai / deepspeedai/DeepSpeedExamples

Unable to run inference example

Open
#165 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.8k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
1

Description

Traceback (most recent call last):
  File "run_generation.py", line 350, in <module>
    main()
  File "run_generation.py", line 261, in main
    model = deepspeed.init_inference(model,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/__init__.py", line 274, in init_inference
    engine = InferenceEngine(model,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/inference/engine.py", line 81, in __init__
    self._apply_injection_policy(client_module,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/inference/engine.py", line 161, in _apply_injection_policy
    replace_transformer_layer(client_module,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 464, in replace_transformer_layer
    return replace_module(model=model,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 561, in replace_module
    replaced_module, _ = _replace_module(model, policy)
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 583, in _replace_module
    _, layer_id = _replace_module(child, policies, layer_id=layer_id)
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 583, in _replace_module
    _, layer_id = _replace_module(child, policies, layer_id=layer_id)
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 578, in _replace_module
    policies[child.__class__][0](child,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 453, in replace_fn
    new_module = replace_with_policy(child,
  File "/opt/conda/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 287, in replace_with_policy
    attn_block.attn_qkvb = mp_replace.qkv_copy(attn_block.attn_qkvb.data, qkvb)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1227, in __setattr__
    raise TypeError("cannot assign '{}' as parameter '{}' "
TypeError: cannot assign 'torch.cuda.HalfTensor' as parameter 'attn_qkvb' (torch.nn.Parameter or None expected)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at run_generation.py line 261 and follow the DeepSpeed inference path through deepspeed/inference/engine.py and deepspeed/module_inject/replace_module.py, especially the attn_qkvb assignment. Reproduce the example and identify the cause of the TypeError; done means the inference example runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.