benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Mutating module attribute cache_k during export.

Open NarasimhanKovalai opened this issue 2 years ago • 0 comments

[rank0]: File "/content/llama.py", line 353, in forward [rank0]: h = x + self.attention(self.attention_norm(x), start_pos, freqs_cis, mask) [rank0]: File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl [rank0]: return forward_call(*args, **kwargs) [rank0]: File "/content/llama.py", line 269, in forward [rank0]: self.cache_k = self.cache_k.to(xq)

[rank0]: AssertionError: Mutating module attribute cache_k during export.

Facing this issue, inside the forward method of Attention class. Linking a similar solved issue for reference : https://github.com/pytorch/benchmark/issues/1767.

NarasimhanKovalai avatar Nov 07 '24 14:11 NarasimhanKovalai