안녕하세요 !
LLM 공부 중인 학생입니다. 이번에 Mistral 7B을 테스트 해보려고 진행을 하다가 문제가 생겼습니다.
아래 와 같은 문제가 생겼습니다. GPU 메모리는 부족하지 않고 단일 GPU를 사용했을 때는 작동하지만 device_map을 auto로 설정할 때 이런 문제가 발생합니다. 혹시 해결하셨거나 아시는 분 있으실까요 ?
코드는 komt-mistral7b에 올라와 있는 코드 그대로 실행했습니다 !
꼭 해결하고 싶어요 !
{'model.embed_tokens': 0, 'model.layers.0': 0, 'model.layers.1': 0, 'model.layers.2': 1, 'model.layers.3': 1, 'model.layers.4': 1, 'model.layers.5': 1, 'model.layers.6': 2, 'model.layers.7': 2, 'model.layers.8': 2, 'model.layers.9': 2, 'model.layers.10': 3, 'model.layers.11': 3, 'model.layers.12': 3, 'model.layers.13': 3, 'model.layers.14': 4, 'model.layers.15': 4, 'model.layers.16': 4, 'model.layers.17': 4, 'model.layers.18': 5, 'model.layers.19': 5, 'model.layers.20': 5, 'model.layers.21': 5, 'model.layers.22': 6, 'model.layers.23': 6, 'model.layers.24': 6, 'model.layers.25': 6, 'model.layers.26': 7, 'model.layers.27': 7, 'model.layers.28': 7, 'model.layers.29': 7, 'model.layers.30': 8, 'model.layers.31': 8, 'model.norm': 8, 'lm_head': 8}
/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:418: UserWarning: num_beams
is set to 1. However, early_stopping
is set to True
-- this flag is only used in beam-based generation modes. You should set num_beams>1
or unset early_stopping
. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed.
warnings.warn(
/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:418: UserWarning: num_beams
is set to 1. However, early_stopping
is set to True
-- this flag is only used in beam-based generation modes. You should set num_beams>1
or unset early_stopping
.
warnings.warn(
[INST]제주도를 1박2일로 혼자 여행하려고 하는데 여행 코스를 만들어줘 bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [37,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [38,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [39,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [40,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [41,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [42,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [43,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [44,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [45,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [46,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [47,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [48,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [49,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [50,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [51,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [52,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [53,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [54,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [55,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [56,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [57,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [58,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [10,0,0], thread: [59,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [4,0,0], thread: [78,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [4,0,0], thread: [94,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
/opt/conda/conda-bld/pytorch_1699449201450/work/aten/src/ATen/native/cuda/IndexKernel.cu:92: operator(): block: [4,0,0], thread: [95,0,0] Assertion -sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.
Traceback (most recent call last):
File "/work/user/ghlee/MistralTest/komt.py", line 41, in
print(gen('제주도를 1박2일로 혼자 여행하려고 하는데 여행 코스를 만들어줘'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/MistralTest/komt.py", line 21, in gen
gened = model.generate(
^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/generation/utils.py", line 1719, in generate
return self.sample(
^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/generation/utils.py", line 2801, in sample
outputs = self(
^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/accelerate/hooks.py", line 164, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/models/mistral/modeling_mistral.py", line 1009, in forward
outputs = self.model(
^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/models/mistral/modeling_mistral.py", line 897, in forward
layer_outputs = decoder_layer(
^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/accelerate/hooks.py", line 164, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/models/mistral/modeling_mistral.py", line 626, in forward
hidden_states, self_attn_weights, present_key_value = self.self_attn(
^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/accelerate/hooks.py", line 164, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/models/mistral/modeling_mistral.py", line 256, in forward
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/user/ghlee/.conda/envs/ghlee/lib/python3.11/site-packages/transformers/models/mistral/modeling_mistral.py", line 156, in apply_rotary_pos_emb
cos = cos[position_ids].unsqueeze(unsqueeze_dim)
~~~^^^^^^^^^^^^^^
RuntimeError: CUDA error: device-side assert triggered
Compile with TORCH_USE_CUDA_DSA
to enable device-side assertions.