Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
- │ /srv/home/rwkv_quant/rwkv_quantizer.py:70 in <module> │
- │ │
- │ 67 │
- │ 68 print("run forward pass") │
- │ 69 ctx = tokenizer.tokenizer.encode("\nIn a shocking finding, scientist discovered a herd o │
- │ ❱ 70 out = model.forward(th.tensor(ctx).unsqueeze(0).cuda())[0].detach().cpu().numpy() │
- │ 71 print(out) │
- │ 72 │
- │ │
- │ /srv/home/rwkv_quant/rwkv_quantizer.py:31 in forward │
- │ │
- │ 28 │ │ assert T <= self.ctx_len, "Cannot forward, because len(input) > model ctx_len." │
- │ 29 │ │ │
- │ 30 │ │ x = self.emb(idx) │
- │ ❱ 31 │ │ x = self.blocks(x) │
- │ 32 │ │ x = self.ln_out(x) │
- │ 33 │ │ │
- │ 34 │ │ if RWKV_HEAD_QK_DIM > 0: │
- │ │
- │ /usr/lib/python3.10/site-packages/torch/nn/modules/module.py:1194 in _call_impl │
- │ │
- │ 1191 │ │ # this function, and just call forward. │
- │ 1192 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
- │ 1193 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
- │ ❱ 1194 │ │ │ return forward_call(*input, **kwargs) │
- │ 1195 │ │ # Do not call functions when jit is used │
- │ 1196 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
- │ 1197 │ │ if self._backward_hooks or _global_backward_hooks: │
- │ │
- │ /usr/lib/python3.10/site-packages/torch/nn/modules/container.py:204 in forward │
- │ │
- │ 201 │ # with Any as TorchScript expects a more precise type │
- │ 202 │ def forward(self, input): │
- │ 203 │ │ for module in self: │
- │ ❱ 204 │ │ │ input = module(input) │
- │ 205 │ │ return input │
- │ 206 │ │
- │ 207 │ def append(self, module: Module) -> 'Sequential': │
- │ │
- │ /usr/lib/python3.10/site-packages/torch/nn/modules/module.py:1194 in _call_impl │
- │ │
- │ 1191 │ │ # this function, and just call forward. │
- │ 1192 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
- │ 1193 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
- │ ❱ 1194 │ │ │ return forward_call(*input, **kwargs) │
- │ 1195 │ │ # Do not call functions when jit is used │
- │ 1196 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
- │ 1197 │ │ if self._backward_hooks or _global_backward_hooks: │
- │ │
- │ /srv/home/rwkv_quant/RWKV-LM/RWKV-v4/./src/model.py:312 in forward │
- │ │
- │ 309 │ │ if self.layer_id == 0 and self.config.model_type == 'RWKV-ffnPre': │
- │ 310 │ │ │ x = x + self.ffnPre(self.ln1(x)) # better in some cases │
- │ 311 │ │ else: │
- │ ❱ 312 │ │ │ x = x + self.att(self.ln1(x)) │
- │ 313 │ │ x = x + self.ffn(self.ln2(x)) │
- │ 314 │ │ return x │
- │ 315 │
- │ │
- │ /usr/lib/python3.10/site-packages/torch/nn/modules/module.py:1194 in _call_impl │
- │ │
- │ 1191 │ │ # this function, and just call forward. │
- │ 1192 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
- │ 1193 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
- │ ❱ 1194 │ │ │ return forward_call(*input, **kwargs) │
- │ 1195 │ │ # Do not call functions when jit is used │
- │ 1196 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
- │ 1197 │ │ if self._backward_hooks or _global_backward_hooks: │
- │ │
- │ /srv/home/rwkv_quant/RWKV-LM/RWKV-v4/./src/model.py:231 in forward │
- │ │
- │ 228 │ │ │
- │ 229 │ │ sr, k, v = self.jit_func(x) │
- │ 230 │ │ │
- │ ❱ 231 │ │ rwkv = sr * RUN_CUDA(B, T, C, self.time_decay, self.time_first, k, v) │
- │ 232 │ │ rwkv = self.output(rwkv) │
- │ 233 │ │ return rwkv │
- │ 234 │
- │ │
- │ /srv/home/rwkv_quant/RWKV-LM/RWKV-v4/./src/model.py:102 in RUN_CUDA │
- │ │
- │ 99 │ │ │ return (None, None, None, gw.bfloat16(), gu.bfloat16(), gk.bfloat16(), gv.bf │
- │ 100 │
- │ 101 def RUN_CUDA(B, T, C, w, u, k, v): │
- │ ❱ 102 │ return WKV.apply(B, T, C, w.cuda(), u.cuda(), k.cuda(), v.cuda()) │
- │ 103 │
- │ 104 ######################################################################################## │
- │ 105 # RWKV: RWKV Time-mix + RWKV Channel-mix │
- │ │
- │ /srv/home/rwkv_quant/RWKV-LM/RWKV-v4/./src/model.py:55 in forward │
- │ │
- │ 52 │ │ ctx.C = C │
- │ 53 │ │ assert T <= T_MAX │
- │ 54 │ │ print(B, C) │
- │ ❱ 55 │ │ assert B * C % min(C, 1024) == 0 │
- │ 56 │ │ if '32' in os.environ['RWKV_FLOAT_MODE']: │
- │ 57 │ │ │ w = -torch.exp(w.contiguous()) │
- │ 58 │ │ │ u = u.contiguous() │
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
- AssertionError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement