AdityaNG / AdityaNG/kan-gpt

CUDA out of memory

未关闭
#18 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug help wanted
主要语言
Python
星标
726
派生
54
PR 合并指标
30 天内没有已合并 PR

描述

```
class KanMLP(nn.Module):
"""Some Information about KanLinear"""
def __init__(self,
in_features=1152,
hidden_features = None,
out_features = None,
drop=0.
):
super().__init__()

approx_gelu = lambda: nn.GELU(approximate="tanh")

out_features = out_features or in_features
hidden_features = hidden_features or in_features
self.mlp = nn.ModuleDict(
dict(
c_fc=KAN(width=[in_features, hidden_features]),
c_proj=KAN(width=[hidden_features, out_features]),
act=NewGELU(),
dropout=nn.Dropout(0.0),
)
)
m = self.mlp
self.mlpf = lambda x: m.dropout(
m.c_proj(m.act(m.c_fc(x)))
) # MLP forward


def forward(self, x):
x = self.mlpf(x)
return x

net = KanMLP(1152,1152*4).to("cuda")
x = torch.rand(size=(4,4096*4,1152)).to("cuda")
nex(x)

When the number of tokens reaches a certain size, the following situation will occur

CUDA out of memory.

贡献指南

打开贡献指南

调研方向

The issue provides a standalone KanMLP/PyTorch reproduction rather than a repository file or test. Start by running the shown model and input allocation on CUDA, then inspect memory use as the token count increases. Done means the reported token-size case completes without a CUDA out-of-memory error.

由索引模型根据 Issue 内容生成。

评估

技术栈
python, pytorch
领域
machine-learning, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。