| library_name | kenotron |
|---|
Modeling code for LlaMoE to use with Kénotron
# Generate a config file
python examples/moe/config_llamoe.py
# Install megablocks
pip install megablocks
# Run training
export CUDA_DEVICE_MAX_CONNECTIONS=1 # important for some distributed operations
torchrun --nproc_per_node=4 examples/moe/train_moe.py --config-file examples/moe/config_llamoe.yaml- Update the
LlaMoEConfigclass inconfig_llamoe.pyto match your model's configuration - Update the
LlaMoEForTrainingclass inmodeling_llamoe.pyto match your model's architecture - Pass the previous to the
DistributedTrainerclass intrain_moe.py:
trainer = DistributedTrainer(config_file, model_class=LlaMoEForTraining, model_config_class=LlaMoEConfig)- Run training as usual
Credits to the following repositories from which the code was adapted: