intel / torch-xpu-ops

Apache License 2.0
22 stars 14 forks source link

[E2E_baseline] Torchbench hf_clip crashed with AttributeError: 'str' object has no attribute 'shape' #122

Closed chuanqi129 closed 3 months ago

chuanqi129 commented 5 months ago

🐛 Describe the bug

All hf_clip accuracy tests crashed with AttributeError: 'str' object has no attribute 'shape'

Traceback (most recent call last):
  File "/home/sdp/actions-runner/_work/torch-xpu-ops/pytorch/benchmarks/dynamo/common.py", line 2197, in validate_model
    self.model_iter_fn(model, example_inputs)
  File "benchmarks/dynamo/torchbench.py", line 376, in forward_and_backward_pass
    pred = mod(*cloned_inputs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py", line 1101, in forward
    vision_outputs = self.vision_model(
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py", line 841, in forward
    hidden_states = self.embeddings(pixel_values)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/sdp/conda/envs/e2e_ci/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py", line 180, in forward
    batch_size = pixel_values.shape[0]
AttributeError: 'str' object has no attribute 'shape'

Versions

Pytorch: git clone -b e2e-baseline https://github.com/etaf/pytorch-inductor-xpu pytorch Test script: inductor_xpu_test.sh

retonym commented 4 months ago

These issues also happen on A100 platform, not related to xpu implementation

riverliuintel commented 3 months ago

Closed. Align with CUDA.