fix llm app with rangeify (#12334)

* fix llm app with rangeify

* add gpt2 contiguous also
This commit is contained in:
George Hotz
2025-09-29 20:42:44 +10:00
committed by GitHub
parent 7ae6898e31
commit b899392f30
2 changed files with 4 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ class TransformerBlock:
def __call__(self, x:Tensor, start_pos:Variable, mask:Optional[Tensor]):
h = x + self.attn(self.ln_1(x), start_pos, mask).float()
return (h + self.mlp(self.ln_2(h)))
return (h + self.mlp(self.ln_2(h))).contiguous()
class Transformer:
def __init__(self, dim, n_heads, n_layers, norm_eps, vocab_size, max_seq_len=1024):