Skip to content

Commit e7ebb26

Browse files
authored
Merge pull request #684 from KMSorSMS/main
fix dockerfile in devcontainer and fix expert torch
2 parents 99f6e42 + ffb86c6 commit e7ebb26

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ apt update -y && apt install -y --no-install-recommends \
1010
g++ \
1111
cmake &&
1212
rm -rf /var/lib/apt/lists/* &&
13-
cd ktransformers &&
1413
pip install ninja pyproject numpy cpufeature &&
1514
pip install flash-attn &&
1615
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/

ktransformers/operators/experts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,9 @@ def load(self, w: dict | nn.Parameter | tuple | None = None, device: str | None
459459
self.up[i] = w["up"][i, ...].to(device=device, dtype=self.dtype)
460460
self.down[i] = w["down"][i, ...].to(device=device, dtype=self.dtype)
461461

462-
self.up = torch.cat(self.up, dim=0)
463-
self.gate = torch.cat(self.gate, dim=0)
464-
self.down = torch.cat(self.down, dim=0)
462+
self.up = torch.stack(self.up, dim=0)
463+
self.gate = torch.stack(self.gate, dim=0)
464+
self.down = torch.stack(self.down, dim=0)
465465
return
466466

467467
def unload(self):

0 commit comments

Comments
 (0)