deepspeedai / deepspeedai/DeepSpeed

[BUG] undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl

Open
#3,385 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug inference
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug

Traceback (most recent call last):
  File "deepspeed_inference_demo.py", line 16, in <module>
    ds_model = deepspeed.init_inference(
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/__init__.py", line 333, in init_inference
    engine = InferenceEngine(model, config=ds_inference_config)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/inference/engine.py", line 194, in __init__
    self._apply_injection_policy(config)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/inference/engine.py", line 396, in _apply_injection_policy
    replace_transformer_layer(client_module, self.module, checkpoint, config, self.config)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 498, in replace_transformer_layer
    replaced_module = replace_module(model=model,
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 731, in replace_module
    replaced_module, _ = _replace_module(model, policy)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 756, in _replace_module
    _, layer_id = _replace_module(child, policies, layer_id=layer_id)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 756, in _replace_module
    _, layer_id = _replace_module(child, policies, layer_id=layer_id)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 748, in _replace_module
    replaced_module = policies[child.__class__][0](child, policies[child.__class__][-1], layer_id)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 488, in replace_fn
    new_module = replace_with_policy(child,
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/replace_module.py", line 346, in replace_with_policy
    _container.create_module()
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/module_inject/containers/bloom.py", line 27, in create_module
    self.module = DeepSpeedBloomInference(_config, mp_group=self.mp_group)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/model_implementations/transformers/ds_bloom.py", line 20, in __init__
    super().__init__(config, mp_group, quantize_scales, quantize_groups, merge_count, mlp_extra_grouping)
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/model_implementations/transformers/ds_transformer.py", line 54, in __init__
    inference_cuda_module = builder.load()
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/ops/op_builder/builder.py", line 443, in load
    return importlib.import_module(self.absolute_name())
  File "/root/anaconda3/envs/py38deepspeed/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed/ops/transformer/inference/transformer_inference_op.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl

To Reproduce
Steps to reproduce the behavior:

# Load Model and Tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name,padding_side="right", use_fast=True,)
# we use device_map auto to automatically place all shards on the GPU to save CPU memory
model = AutoModelForCausalLM.from_pretrained(model_name, low_cpu_mem_usage=True, torch_dtype=torch.float16).cuda()




# init deepspeed inference engine
ds_model = deepspeed.init_inference(
    model=model,      # Transformers models
    mp_size=1,        # Number of GPU
    dtype=torch.float16, # dtype of the weights (fp16)
    replace_method="auto", # Lets DS autmatically identify the layer to replace
    replace_with_kernel_inject=True, # replace the model with the kernel injector
)
print(f"model is loaded on device {ds_model.module.device}")

ds_report output


--------------------------------------------------
DeepSpeed C++/CUDA extension op report
--------------------------------------------------
NOTE: Ops not installed will be just-in-time (JIT) compiled at
      runtime if needed. Op compatibility means that your system
      meet the required dependencies to JIT install the op.
--------------------------------------------------
JIT compiled ops requires ninja
ninja .................. [OKAY]
--------------------------------------------------
op name ................ installed .. compatible
--------------------------------------------------
async_io ............... [YES] ...... [OKAY]
cpu_adagrad ............ [YES] ...... [OKAY]
cpu_adam ............... [YES] ...... [OKAY]
fused_adam ............. [YES] ...... [OKAY]
fused_lamb ............. [YES] ...... [OKAY]
quantizer .............. [YES] ...... [OKAY]
random_ltd ............. [YES] ...... [OKAY]
sparse_attn ............ [YES] ...... [OKAY]
spatial_inference ...... [YES] ...... [OKAY]
transformer ............ [YES] ...... [OKAY]
stochastic_transformer . [YES] ...... [OKAY]
transformer_inference .. [YES] ...... [OKAY]
utils .................. [YES] ...... [OKAY]
--------------------------------------------------
DeepSpeed general environment info:
torch install path ............... ['/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/torch']
torch version .................... 1.13.1+cu117
deepspeed install path ........... ['/root/anaconda3/envs/py38deepspeed/lib/python3.8/site-packages/deepspeed']
deepspeed info ................... 0.9.2+2e99f6ed, 2e99f6ed, master
torch cuda version ............... 11.7
torch hip version ................ None
nvcc version ..................... 11.7
deepspeed wheel compiled w. ...... torch 1.13, cuda 11.7

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

System info (please complete the following information):

  • OS: [e.g. Ubuntu 22.04]

  • GPU count and types [e.g. single machine with x8 A40s]

  • Python version 3.8

Contributor guide

Open the contributing guide

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 with deepspeed/ops/op_builder/builder.py and the transformer inference extension load shown in the traceback. Reproduce with PyTorch 1.13.1+cu117 and DeepSpeed 0.9.2, then inspect the compiled transformer_inference module's symbol compatibility. Done means the reported Bloom inference example imports and initializes without the undefined-symbol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
build-system, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.