"...text-generation-inference.git" did not exist on "343437c7b5987c64cd3353b0913ffad5fd3df4b5"
Commit c5cfd5fb authored by Rick Ho's avatar Rick Ho
Browse files

pass test

parent ed69591a
...@@ -6,4 +6,7 @@ exp/ ...@@ -6,4 +6,7 @@ exp/
.vscode/ .vscode/
a.out a.out
*.egg-info *.egg-info
*.egg *.egg
\ No newline at end of file build
*swp
logs
...@@ -8,7 +8,7 @@ from .moe_function import moe ...@@ -8,7 +8,7 @@ from .moe_function import moe
class FMoE(nn.Module): class FMoE(nn.Module):
def __init__(self, num_expert=32, in_feat=1024, out_feat=1024, def __init__(self, num_expert=32, in_feat=1024, out_feat=1024,
world_size=None): world_size=None):
super(MOELayer, self).__init__() super(FMoE, self).__init__()
self.num_expert = num_expert self.num_expert = num_expert
self.in_feat = in_feat self.in_feat = in_feat
self.out_feat = out_feat self.out_feat = out_feat
...@@ -29,7 +29,7 @@ class FMoE(nn.Module): ...@@ -29,7 +29,7 @@ class FMoE(nn.Module):
class BruteForceMoE(nn.Module): class BruteForceMoE(nn.Module):
def __init__(self, num_expert=32, in_feat=1024, out_feat=1024, def __init__(self, num_expert=32, in_feat=1024, out_feat=1024,
world_size=0): world_size=0):
super(MOELayer_raw, self).__init__() super(BruteForceMoE, self).__init__()
self.num_expert = num_expert self.num_expert = num_expert
self.in_feat = in_feat self.in_feat = in_feat
self.out_feat = out_feat self.out_feat = out_feat
......
...@@ -4,11 +4,21 @@ then ...@@ -4,11 +4,21 @@ then
export CUDA_VISIBLE_DEVICES=$OMPI_COMM_WORLD_LOCAL_RANK export CUDA_VISIBLE_DEVICES=$OMPI_COMM_WORLD_LOCAL_RANK
fi fi
export PYTHONPATH=$PWD/build/lib.linux-x86_64-3.7 if [ -z $OMPI_COMM_WORLD_RANK ]
then
RANK=single
else
RANK=$OMPI_COMM_WORLD_RANK
fi
mkdir -p logs
SCRIPT_PATH=$(dirname $(dirname $(realpath $0)))
export PYTHONPATH=$SCRIPT_PATH:$SCRIPT_PATH/build/lib.linux-x86_64-3.7:$PYTHONPATH
export LD_LIBRARY_PATH=/home/laekov/.local/lib/python3.7/site-packages/torch/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/home/laekov/.local/lib/python3.7/site-packages/torch/lib:$LD_LIBRARY_PATH
if [ -z $1 ] if [ -z $1 ]
then then
python3 moe_test.py 2>logs/$OMPI_COMM_WORLD_RANK.log python3 tests/moe_test.py 2>logs/$RANK.log
else else
python3 $@ 2>logs/$OMPI_COMM_WORLD_RANK.log python3 $@ 2>logs/$RANK.log
fi fi
from moe import MOELayer, MOELayer_raw from fmoe import FMoE as MOELayer
from fmoe import BruteForceMoE as MOELayer_raw
import torch import torch
from torch import nn from torch import nn
import time import time
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment