Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +11 -0
- .vscode/launch.json +25 -0
- =5.28.0 +1 -0
- LMC_of_MoE.egg-info/PKG-INFO +112 -0
- LMC_of_MoE.egg-info/SOURCES.txt +167 -0
- LMC_of_MoE.egg-info/dependency_links.txt +1 -0
- LMC_of_MoE.egg-info/top_level.txt +6 -0
- Miniconda3-latest-Linux-x86_64.sh +3 -0
- README.md +98 -3
- modal/cifar/__pycache__/finetune.cpython-313.pyc +0 -0
- modal/cifar/__pycache__/train_model.cpython-313.pyc +0 -0
- modal/cifar/finetune.py +40 -0
- modal/cifar/train_model.py +41 -0
- modal/enwik8/__pycache__/finetune.cpython-310.pyc +0 -0
- modal/enwik8/finetune.py +55 -0
- modal/enwik8/matching.py +0 -0
- modal/imagenet/__pycache__/generalization.cpython-313.pyc +0 -0
- modal/imagenet/__pycache__/shot_noise.cpython-313.pyc +0 -0
- modal/imagenet/generalization.py +57 -0
- modal/imagenet/shot_noise.py +65 -0
- modal/lm1b/__pycache__/finetune.cpython-310.pyc +0 -0
- modal/lm1b/finetune.py +47 -0
- modal/text8/__pycache__/finetune.cpython-310.pyc +0 -0
- modal/text8/__pycache__/train_model.cpython-310.pyc +0 -0
- modal/text8/finetune.py +107 -0
- modal/text8/train_model.py +41 -0
- output.txt +0 -0
- password.txt +2 -0
- plots/enwik8/[finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed20]_row0.pdf +0 -0
- plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20].pdf +0 -0
- plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf +0 -0
- plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf +0 -0
- plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed20].pdf +0 -0
- plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed40].pdf +0 -0
- plots/enwik8/learnable-indice0-heads16-shared1-routed0-topk0.pdf +0 -0
- plots/enwik8/learnable-indice0-heads4-shared1-routed0-topk0.pdf +0 -0
- plots/enwik8/learnable-indice0-heads8-shared1-routed0-topk0.pdf +0 -0
- plots/imagenet/.pdf.png +0 -0
- plots/imagenet/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed0+finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed40.pdf +0 -0
- plots/imagenet/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed20+finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed40.pdf +0 -0
- plots/lm1b/learnable-indice0-heads12-shared1-routed0-topk0.pdf +0 -0
- plots/lm1b/learnable-indice0-heads16-shared1-routed0-topk0.pdf +0 -0
- plots/lm1b/learnable-indice0-heads8-shared1-routed0-topk0.pdf +0 -0
- plots/text8/learnable-indice0-heads16-shared1-routed0-topk0.pdf +0 -0
- plots/text8/learnable-indice0-heads4-shared1-routed0-topk0.pdf +0 -0
- plots/text8/learnable-indice0-heads8-shared1-routed0-topk0.pdf +0 -0
- plots/wt103/learnable-indice0-heads2-shared1-routed0-topk0.pdf +0 -0
- plots/wt103/learnable-indice0-heads3-shared1-routed0-topk0.pdf +0 -0
- plots/wt103/learnable-indice0-heads4-shared1-routed0-topk0.pdf +0 -0
- pyproject.toml +29 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Miniconda3-latest-Linux-x86_64.sh filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
wandb/offline-run-20251225_114458-oskki2mm/run-oskki2mm.wandb filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
wandb/run-20251225_120039-17r3f9k1/run-17r3f9k1.wandb filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
wandb/run-20251225_121621-23cpikjp/run-23cpikjp.wandb filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
wandb/run-20251225_124757-209hc11t/run-209hc11t.wandb filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
wandb/run-20251225_135106-poxltdws/run-poxltdws.wandb filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
wandb/run-20251225_144139-zgvpe4a2/run-zgvpe4a2.wandb filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
wandb/run-20251225_170452-24ta21sy/run-24ta21sy.wandb filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
wandb/run-20251225_200829-ad33gu8w/run-ad33gu8w.wandb filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
wandb/run-20251225_234450-ddqothxs/run-ddqothxs.wandb filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
wandb/run-20251226_013720-ly1ggf35/run-ly1ggf35.wandb filter=lfs diff=lfs merge=lfs -text
|
.vscode/launch.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "0.2.0",
|
| 3 |
+
"configurations": [
|
| 4 |
+
{
|
| 5 |
+
"name": "att_matching (cifar10, GPU0)",
|
| 6 |
+
"type": "debugpy",
|
| 7 |
+
"request": "launch",
|
| 8 |
+
"program": "${workspaceFolder}/src/imagenet/att_matching.py",
|
| 9 |
+
"console": "integratedTerminal",
|
| 10 |
+
"python": "/home/khanhvinh9/miniconda3/envs/lmc/bin/python",
|
| 11 |
+
"env": {
|
| 12 |
+
"CUDA_VISIBLE_DEVICES": "0"
|
| 13 |
+
},
|
| 14 |
+
"args": [
|
| 15 |
+
"--input-size", "32",
|
| 16 |
+
"--data-set", "CIFAR10",
|
| 17 |
+
"--model-a", "/mnt/d/NCKH/weights/lmc/cifar10/vit-finetune/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed20/best_19110",
|
| 18 |
+
"--model-b", "/mnt/d/NCKH/weights/lmc/cifar10/vit-finetune/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed40/best_16380",
|
| 19 |
+
"--data-path", "/mnt/d/NCKH/datasets/cifar10",
|
| 20 |
+
"--save-path", "plots/cifar10"
|
| 21 |
+
],
|
| 22 |
+
"justMyCode": false
|
| 23 |
+
}
|
| 24 |
+
]
|
| 25 |
+
}
|
=5.28.0
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Requirement already satisfied: protobuf in /home/khanhvinh9/miniconda3/envs/lmc/lib/python3.10/site-packages (4.21.12)
|
LMC_of_MoE.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: LMC-of-MoE
|
| 3 |
+
Version: 0.3.1
|
| 4 |
+
Summary: Linear Mode Connectivity experiments with Mixture-of-Experts models
|
| 5 |
+
Author-email: Your Name <you@example.com>
|
| 6 |
+
License: MIT
|
| 7 |
+
Project-URL: Homepage, https://github.com/yourname/LMC-of-MoE
|
| 8 |
+
Project-URL: Source, https://github.com/yourname/LMC-of-MoE
|
| 9 |
+
Classifier: Programming Language :: Python :: 3
|
| 10 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 11 |
+
Classifier: Operating System :: OS Independent
|
| 12 |
+
Requires-Python: >=3.10
|
| 13 |
+
Description-Content-Type: text/markdown
|
| 14 |
+
|
| 15 |
+
# On Linear Mode Connectivity of Mixture-of-Experts Architectures
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
[](https://github.com/repo/docs)
|
| 19 |
+
[](https://arxiv.org/abs/XXXX.XXXXX)
|
| 20 |
+
|
| 21 |
+
This repository accompanies the paper:
|
| 22 |
+
***“On Linear Mode Connectivity of Mixture-of-Experts Architectures”*** (Neurips 2025 Submission)
|
| 23 |
+
<p align="center"><strong>ImageNet: Linear Mode Connectivity</strong></p>
|
| 24 |
+
<p align="center">
|
| 25 |
+
<img src="plots/imagenet/imagenet_lmc.png" width="500px"/>
|
| 26 |
+
</p>
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
## Installation
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
git clone https://github.com/repo/lmc-moe.git
|
| 33 |
+
cd moe-lmc
|
| 34 |
+
pip install -e .
|
| 35 |
+
pip install -r requirements.txt
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Repository Structure
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
src/
|
| 42 |
+
├── agnews/ # Appendix experiment: Reinit FFN
|
| 43 |
+
├── cifar10/ # Main experiment
|
| 44 |
+
├── cifar100/ # Main experiment
|
| 45 |
+
├── dbpedia/ # Appendix experiment: Reinit FFN
|
| 46 |
+
├── enwik8/ # Appendix experiment: Reinit FFN
|
| 47 |
+
├── imagenet/ # Main experiment
|
| 48 |
+
├── imdbreview/ # Appendix experiment: Reinit FFN
|
| 49 |
+
├── lm1b/ # Main experiment
|
| 50 |
+
├── mnist/ # Main experiment
|
| 51 |
+
├── penn/ # Appendix experiment: Reinit FFN
|
| 52 |
+
├── transfer_learning/ # Main experiment
|
| 53 |
+
├── wikitext103/ # Main experiment
|
| 54 |
+
├── datasets.py
|
| 55 |
+
├── utils.py
|
| 56 |
+
├── weight_matching.py
|
| 57 |
+
└── online_stats.py
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Each dataset directory includes a standalone `README.md` with detailed steps for data preparation, training, and evaluation.
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
## Linear Mode Connectivity Results
|
| 64 |
+
|
| 65 |
+
### ImageNet, WikiText103, One Billion Word (lm1b)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
<p align="center"><strong>WikiText103: Linear Mode Connectivity</strong></p>
|
| 70 |
+
<p align="center">
|
| 71 |
+
<img src="plots/wikitext103/wikitext_lmc.png" width="500px"/>
|
| 72 |
+
</p>
|
| 73 |
+
|
| 74 |
+
<p align="center"><strong>One Billion Word (LM1B): Linear Mode Connectivity</strong></p>
|
| 75 |
+
<p align="center">
|
| 76 |
+
<img src="plots/lm1b/lm1b_lmc.png" width="500px"/>
|
| 77 |
+
</p>
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
## Getting Started
|
| 81 |
+
|
| 82 |
+
Each dataset experiment can be run individually. See the corresponding `src/<dataset>/README.md` for configuration options.
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## Citation
|
| 86 |
+
|
| 87 |
+
If you find this work helpful, please consider citing:
|
| 88 |
+
|
| 89 |
+
```bibtex
|
| 90 |
+
@article{our2025moelmc,
|
| 91 |
+
title={On Linear Mode Connectivity of Mixture-of-Experts Architectures},
|
| 92 |
+
author={Coauthors},
|
| 93 |
+
journal={arXiv:XXXX.XXXXX},
|
| 94 |
+
year={2025}
|
| 95 |
+
}
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
## Acknowledgements
|
| 100 |
+
|
| 101 |
+
We thank contributors and maintainers of open-source libraries including PyTorch, JAX, Flax, and HuggingFace Transformers. Special thanks to the authors of recent works on LMC and MoE architectures for foundational insights.
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
## Contributing
|
| 105 |
+
|
| 106 |
+
We welcome pull requests and suggestions. Please ensure new features or bug fixes include tests where appropriate and follow existing code style.
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
## License
|
| 110 |
+
|
| 111 |
+
This project is licensed under the MIT License.
|
| 112 |
+
|
LMC_of_MoE.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.gitignore
|
| 2 |
+
README.md
|
| 3 |
+
password.txt
|
| 4 |
+
pyproject.toml
|
| 5 |
+
requirements.txt
|
| 6 |
+
.vscode/launch.json
|
| 7 |
+
LMC_of_MoE.egg-info/PKG-INFO
|
| 8 |
+
LMC_of_MoE.egg-info/SOURCES.txt
|
| 9 |
+
LMC_of_MoE.egg-info/dependency_links.txt
|
| 10 |
+
LMC_of_MoE.egg-info/top_level.txt
|
| 11 |
+
modal/enwik8/finetune.py
|
| 12 |
+
modal/enwik8/matching.py
|
| 13 |
+
modal/enwik8/__pycache__/finetune.cpython-310.pyc
|
| 14 |
+
modal/imagenet/generalization.py
|
| 15 |
+
modal/lm1b/finetune.py
|
| 16 |
+
modal/lm1b/__pycache__/finetune.cpython-310.pyc
|
| 17 |
+
modal/text8/finetune.py
|
| 18 |
+
modal/text8/train_model.py
|
| 19 |
+
modal/text8/__pycache__/finetune.cpython-310.pyc
|
| 20 |
+
modal/text8/__pycache__/train_model.cpython-310.pyc
|
| 21 |
+
plots/enwik8/[finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed20]_row0.pdf
|
| 22 |
+
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20].pdf
|
| 23 |
+
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf
|
| 24 |
+
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf
|
| 25 |
+
plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed20].pdf
|
| 26 |
+
plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed40].pdf
|
| 27 |
+
plots/enwik8/learnable-indice0-heads16-shared1-routed0-topk0.pdf
|
| 28 |
+
plots/enwik8/learnable-indice0-heads4-shared1-routed0-topk0.pdf
|
| 29 |
+
plots/enwik8/learnable-indice0-heads8-shared1-routed0-topk0.pdf
|
| 30 |
+
plots/imagenet/.pdf.png
|
| 31 |
+
plots/lm1b/learnable-indice0-heads12-shared1-routed0-topk0.pdf
|
| 32 |
+
plots/lm1b/learnable-indice0-heads16-shared1-routed0-topk0.pdf
|
| 33 |
+
plots/lm1b/learnable-indice0-heads8-shared1-routed0-topk0.pdf
|
| 34 |
+
plots/text8/learnable-indice0-heads16-shared1-routed0-topk0.pdf
|
| 35 |
+
plots/text8/learnable-indice0-heads4-shared1-routed0-topk0.pdf
|
| 36 |
+
plots/text8/learnable-indice0-heads8-shared1-routed0-topk0.pdf
|
| 37 |
+
plots/wt103/learnable-indice0-heads2-shared1-routed0-topk0.pdf
|
| 38 |
+
plots/wt103/learnable-indice0-heads3-shared1-routed0-topk0.pdf
|
| 39 |
+
plots/wt103/learnable-indice0-heads4-shared1-routed0-topk0.pdf
|
| 40 |
+
results/agnews/[idx-0-shared-0-gated-1-topk-0-seed-0.flax+idx-0-shared-0-gated-1-topk-0-seed-20.flax].json
|
| 41 |
+
results/dbpedia/[lr2e-05-epochs2-batch16-seed0+lr2e-05-epochs2-batch16-seed20].json
|
| 42 |
+
results/enwik8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20].json
|
| 43 |
+
results/enwik8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 44 |
+
results/enwik8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 45 |
+
results/enwik8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20].json
|
| 46 |
+
results/enwik8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 47 |
+
results/enwik8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 48 |
+
results/enwik8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20].json
|
| 49 |
+
results/enwik8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 50 |
+
results/enwik8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 51 |
+
results/imagenet/finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed20.json
|
| 52 |
+
results/imagenet/finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed40.json
|
| 53 |
+
results/imdbreview/[idx-0-shared-0-gated-1-topk-0-seed-0.flax+idx-0-shared-0-gated-1-topk-0-seed-20.flax].json
|
| 54 |
+
results/lm1b/[finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed20].json
|
| 55 |
+
results/lm1b/[finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed40].json
|
| 56 |
+
results/lm1b/[finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed40].json
|
| 57 |
+
results/lm1b/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20].json
|
| 58 |
+
results/lm1b/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 59 |
+
results/lm1b/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 60 |
+
results/lm1b/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20].json
|
| 61 |
+
results/lm1b/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 62 |
+
results/lm1b/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 63 |
+
results/penn/[lr0.0002-topk2-shared0-routed2-seed0+lr0.0002-topk2-shared0-routed2-seed20].json
|
| 64 |
+
results/text8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20].json
|
| 65 |
+
results/text8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 66 |
+
results/text8/[finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads16-shared1-routed0-topk0-seed40].json
|
| 67 |
+
results/text8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20].json
|
| 68 |
+
results/text8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 69 |
+
results/text8/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 70 |
+
results/text8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20].json
|
| 71 |
+
results/text8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 72 |
+
results/text8/[finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads8-shared1-routed0-topk0-seed40].json
|
| 73 |
+
results/wt103/[finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed20].json
|
| 74 |
+
results/wt103/[finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed40].json
|
| 75 |
+
results/wt103/[finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads2-shared1-routed0-topk0-seed40].json
|
| 76 |
+
results/wt103/[finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed20].json
|
| 77 |
+
results/wt103/[finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed40].json
|
| 78 |
+
results/wt103/[finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads3-shared1-routed0-topk0-seed40].json
|
| 79 |
+
results/wt103/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20].json
|
| 80 |
+
results/wt103/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 81 |
+
results/wt103/[finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice0-heads4-shared1-routed0-topk0-seed40].json
|
| 82 |
+
scripts/azure.sh
|
| 83 |
+
scripts/git.sh
|
| 84 |
+
scripts/modal.sh
|
| 85 |
+
scripts/enwik8/att_matching.sh
|
| 86 |
+
scripts/enwik8/finetune.sh
|
| 87 |
+
scripts/enwik8/finetune4.sh
|
| 88 |
+
scripts/enwik8/finetune5.sh
|
| 89 |
+
scripts/enwik8/plot.sh
|
| 90 |
+
scripts/enwik8/rope_matching.sh
|
| 91 |
+
scripts/enwik8/train_model.sh
|
| 92 |
+
scripts/imagenet/att_matching.sh
|
| 93 |
+
scripts/imagenet/finetune0.sh
|
| 94 |
+
scripts/imagenet/finetune1.sh
|
| 95 |
+
scripts/imagenet/finetune2.sh
|
| 96 |
+
scripts/imagenet/finetune3.sh
|
| 97 |
+
scripts/imagenet/finetune4.sh
|
| 98 |
+
scripts/imagenet/finetune6.sh
|
| 99 |
+
scripts/imagenet/finetune7.sh
|
| 100 |
+
scripts/imagenet/plot.sh
|
| 101 |
+
scripts/imagenet/temp.sh
|
| 102 |
+
scripts/imagenet/train_model.sh
|
| 103 |
+
scripts/lm1b/att_matching.sh
|
| 104 |
+
scripts/lm1b/finetune_att.sh
|
| 105 |
+
scripts/lm1b/finetune_att0.sh
|
| 106 |
+
scripts/lm1b/finetune_att01.sh
|
| 107 |
+
scripts/lm1b/finetune_att1.sh
|
| 108 |
+
scripts/lm1b/finetune_att2.sh
|
| 109 |
+
scripts/lm1b/finetune_att23.sh
|
| 110 |
+
scripts/lm1b/finetune_att4.sh
|
| 111 |
+
scripts/lm1b/finetune_att67.sh
|
| 112 |
+
scripts/lm1b/plot.sh
|
| 113 |
+
scripts/lm1b/train_model.sh
|
| 114 |
+
scripts/text8/att_matching.sh
|
| 115 |
+
scripts/text8/finetune.sh
|
| 116 |
+
scripts/text8/plot.sh
|
| 117 |
+
scripts/text8/train_model.sh
|
| 118 |
+
scripts/wt103/att_matching.sh
|
| 119 |
+
scripts/wt103/finetune_att6.sh
|
| 120 |
+
scripts/wt103/finetune_att7.sh
|
| 121 |
+
scripts/wt103/plot.sh
|
| 122 |
+
scripts/wt103/rope_matching.sh
|
| 123 |
+
scripts/wt103/train_model.sh
|
| 124 |
+
src/imagenet/att_matching.py
|
| 125 |
+
src/imagenet/data.sh
|
| 126 |
+
src/imagenet/datasets.py
|
| 127 |
+
src/imagenet/finetune.py
|
| 128 |
+
src/imagenet/generalization.py
|
| 129 |
+
src/imagenet/lmc_model.py
|
| 130 |
+
src/imagenet/matching_utils.py
|
| 131 |
+
src/imagenet/model.py
|
| 132 |
+
src/imagenet/plot.py
|
| 133 |
+
src/imagenet/readme.md
|
| 134 |
+
src/imagenet/test.py
|
| 135 |
+
src/imagenet/train_model.py
|
| 136 |
+
src/imagenet/transfer.py
|
| 137 |
+
src/imagenet/transform.py
|
| 138 |
+
src/imagenet/utils.py
|
| 139 |
+
src/imagenet/__pycache__/datasets.cpython-310.pyc
|
| 140 |
+
src/imagenet/__pycache__/engine.cpython-310.pyc
|
| 141 |
+
src/imagenet/__pycache__/lmc_model.cpython-310.pyc
|
| 142 |
+
src/imagenet/__pycache__/matching_utils.cpython-310.pyc
|
| 143 |
+
src/imagenet/__pycache__/model.cpython-310.pyc
|
| 144 |
+
src/imagenet/__pycache__/utils.cpython-310.pyc
|
| 145 |
+
src/lgmodeling/att_matching.py
|
| 146 |
+
src/lgmodeling/data_utils.py
|
| 147 |
+
src/lgmodeling/finetune.py
|
| 148 |
+
src/lgmodeling/getdata.py
|
| 149 |
+
src/lgmodeling/lmc_model.py
|
| 150 |
+
src/lgmodeling/matching_utils.py
|
| 151 |
+
src/lgmodeling/model.py
|
| 152 |
+
src/lgmodeling/plot.py
|
| 153 |
+
src/lgmodeling/train_model.py
|
| 154 |
+
src/lgmodeling/utils.py
|
| 155 |
+
src/lgmodeling/vocabulary.py
|
| 156 |
+
src/lgmodeling/__pycache__/data_utils.cpython-310.pyc
|
| 157 |
+
src/lgmodeling/__pycache__/lmc_model.cpython-310.pyc
|
| 158 |
+
src/lgmodeling/__pycache__/matching_utils.cpython-310.pyc
|
| 159 |
+
src/lgmodeling/__pycache__/model.cpython-310.pyc
|
| 160 |
+
src/lgmodeling/__pycache__/utils.cpython-310.pyc
|
| 161 |
+
src/lgmodeling/__pycache__/vocabulary.cpython-310.pyc
|
| 162 |
+
temp/bert.py
|
| 163 |
+
temp/gpt2.py
|
| 164 |
+
temp/gptj.py
|
| 165 |
+
temp/qwen.py
|
| 166 |
+
temp/roformer.py
|
| 167 |
+
temp/vit.py
|
LMC_of_MoE.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
LMC_of_MoE.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
modal
|
| 2 |
+
plots
|
| 3 |
+
results
|
| 4 |
+
scripts
|
| 5 |
+
src
|
| 6 |
+
temp
|
Miniconda3-latest-Linux-x86_64.sh
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0b10e050e8928e2eb9aad2c522ee3b5d31d30048b8a9997663a8a460d538cef
|
| 3 |
+
size 156772981
|
README.md
CHANGED
|
@@ -1,3 +1,98 @@
|
|
| 1 |
-
--
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Linear Mode Connectivity of Mixture-of-Experts Architectures
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
[](https://github.com/repo/docs)
|
| 5 |
+
[](https://arxiv.org/abs/XXXX.XXXXX)
|
| 6 |
+
|
| 7 |
+
This repository accompanies the paper:
|
| 8 |
+
***“On Linear Mode Connectivity of Mixture-of-Experts Architectures”*** (Neurips 2025 Submission)
|
| 9 |
+
<p align="center"><strong>ImageNet: Linear Mode Connectivity</strong></p>
|
| 10 |
+
<p align="center">
|
| 11 |
+
<img src="plots/imagenet/imagenet_lmc.png" width="500px"/>
|
| 12 |
+
</p>
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
## Installation
|
| 16 |
+
|
| 17 |
+
```bash
|
| 18 |
+
git clone https://github.com/repo/lmc-moe.git
|
| 19 |
+
cd moe-lmc
|
| 20 |
+
pip install -e .
|
| 21 |
+
pip install -r requirements.txt
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
## Repository Structure
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
src/
|
| 28 |
+
├── agnews/ # Appendix experiment: Reinit FFN
|
| 29 |
+
├── cifar10/ # Main experiment
|
| 30 |
+
├── cifar100/ # Main experiment
|
| 31 |
+
├── dbpedia/ # Appendix experiment: Reinit FFN
|
| 32 |
+
├── enwik8/ # Appendix experiment: Reinit FFN
|
| 33 |
+
├── imagenet/ # Main experiment
|
| 34 |
+
├── imdbreview/ # Appendix experiment: Reinit FFN
|
| 35 |
+
├── lm1b/ # Main experiment
|
| 36 |
+
├── mnist/ # Main experiment
|
| 37 |
+
├── penn/ # Appendix experiment: Reinit FFN
|
| 38 |
+
├── transfer_learning/ # Main experiment
|
| 39 |
+
├── wikitext103/ # Main experiment
|
| 40 |
+
├── datasets.py
|
| 41 |
+
├── utils.py
|
| 42 |
+
├── weight_matching.py
|
| 43 |
+
└── online_stats.py
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
Each dataset directory includes a standalone `README.md` with detailed steps for data preparation, training, and evaluation.
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
## Linear Mode Connectivity Results
|
| 50 |
+
|
| 51 |
+
### ImageNet, WikiText103, One Billion Word (lm1b)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
<p align="center"><strong>WikiText103: Linear Mode Connectivity</strong></p>
|
| 56 |
+
<p align="center">
|
| 57 |
+
<img src="plots/wikitext103/wikitext_lmc.png" width="500px"/>
|
| 58 |
+
</p>
|
| 59 |
+
|
| 60 |
+
<p align="center"><strong>One Billion Word (LM1B): Linear Mode Connectivity</strong></p>
|
| 61 |
+
<p align="center">
|
| 62 |
+
<img src="plots/lm1b/lm1b_lmc.png" width="500px"/>
|
| 63 |
+
</p>
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
## Getting Started
|
| 67 |
+
|
| 68 |
+
Each dataset experiment can be run individually. See the corresponding `src/<dataset>/README.md` for configuration options.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
If you find this work helpful, please consider citing:
|
| 74 |
+
|
| 75 |
+
```bibtex
|
| 76 |
+
@article{our2025moelmc,
|
| 77 |
+
title={On Linear Mode Connectivity of Mixture-of-Experts Architectures},
|
| 78 |
+
author={Coauthors},
|
| 79 |
+
journal={arXiv:XXXX.XXXXX},
|
| 80 |
+
year={2025}
|
| 81 |
+
}
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## Acknowledgements
|
| 86 |
+
|
| 87 |
+
We thank contributors and maintainers of open-source libraries including PyTorch, JAX, Flax, and HuggingFace Transformers. Special thanks to the authors of recent works on LMC and MoE architectures for foundational insights.
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
## Contributing
|
| 91 |
+
|
| 92 |
+
We welcome pull requests and suggestions. Please ensure new features or bug fixes include tests where appropriate and follow existing code style.
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
## License
|
| 96 |
+
|
| 97 |
+
This project is licensed under the MIT License.
|
| 98 |
+
|
modal/cifar/__pycache__/finetune.cpython-313.pyc
ADDED
|
Binary file (2.53 kB). View file
|
|
|
modal/cifar/__pycache__/train_model.cpython-313.pyc
ADDED
|
Binary file (2.59 kB). View file
|
|
|
modal/cifar/finetune.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Generalization Model {model_name} with ImageNet")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="A100-40GB",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={
|
| 25 |
+
"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4,
|
| 26 |
+
},
|
| 27 |
+
)
|
| 28 |
+
def run_command():
|
| 29 |
+
import os
|
| 30 |
+
os.system("""
|
| 31 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/imagenet/finetune.py --input-size 32 --data-set CIFAR10\
|
| 32 |
+
--model-path /root/weights/lmc/cifar10/lr0.005-learnable-epochs50-batch128-seed0/best_15990 \
|
| 33 |
+
--lr 5e-3 --epochs 50 --batch-size 128 --seed 0 --num-attention-heads 4 --lmc-layer-indices 0 --warmup-epochs 5\
|
| 34 |
+
--wandb-project "LMC-Attention" --wandb-group "ViT-CIFAR10-FFN" --wandb-entity "fpt-team"\
|
| 35 |
+
--data-path /root/datasets/cifar10 --save-dir /root/weights/lmc/cifar10/vit-finetune
|
| 36 |
+
""")
|
| 37 |
+
|
| 38 |
+
if __name__ == "__main__":
|
| 39 |
+
with app.run():
|
| 40 |
+
run_command.remote()
|
modal/cifar/train_model.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Generalization Model {model_name} with ImageNet")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="A100",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={
|
| 25 |
+
"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4,
|
| 26 |
+
},
|
| 27 |
+
)
|
| 28 |
+
def run_command():
|
| 29 |
+
import os
|
| 30 |
+
os.system("""
|
| 31 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/imagenet/train_model.py \
|
| 32 |
+
--input-size 32 --data-set CIFAR10 --patch-size 4 --hidden-size 128 --num-hidden-layers 6 --warmup-epochs 5\
|
| 33 |
+
--num-attention-heads 4 --intermediate-size 512 --position-embeddings "rope" --num-labels 10\
|
| 34 |
+
--lr 5e-3 --epochs 50 --batch-size 128 --seed 0 --num-shared-experts 1 --num-routed-experts 0 --topk 0\
|
| 35 |
+
--wandb-project "LMC-Attention" --wandb-group "ViT-CIFAR10-FFN" --wandb-entity "fpt-team"\
|
| 36 |
+
--save-dir /root/weights/lmc/cifar10 --data-path /root/datasets/cifar10
|
| 37 |
+
""")
|
| 38 |
+
|
| 39 |
+
if __name__ == "__main__":
|
| 40 |
+
with app.run():
|
| 41 |
+
run_command.remote()
|
modal/enwik8/__pycache__/finetune.cpython-310.pyc
ADDED
|
Binary file (2.73 kB). View file
|
|
|
modal/enwik8/finetune.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Attention Full Layers"
|
| 5 |
+
app = App(f"Finetune Enwik8 {model_name}")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("dataset", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="H100:1",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={"/root/weights/":volume1,"/root/dataset/":volume2,"/root/plots/":volume3,"/root/results/":volume4},
|
| 25 |
+
)
|
| 26 |
+
def run_command():
|
| 27 |
+
import os
|
| 28 |
+
os.system("pip install -e .")
|
| 29 |
+
os.system("""
|
| 30 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 31 |
+
--model-path /root/weights/enwik8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 32 |
+
--seed 0 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 16 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11 \
|
| 33 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset enwik8 \
|
| 34 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Enwik8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 35 |
+
--model-save-dir /root/weights/enwik8/gpt2-finetune --data-path /root/dataset/enwik8
|
| 36 |
+
""")
|
| 37 |
+
os.system("""
|
| 38 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 39 |
+
--model-path /root/weights/enwik8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 40 |
+
--seed 20 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 16 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11 \
|
| 41 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset enwik8 \
|
| 42 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Enwik8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 43 |
+
--model-save-dir /root/weights/enwik8/gpt2-finetune --data-path /root/dataset/enwik8
|
| 44 |
+
""")
|
| 45 |
+
# os.system("""
|
| 46 |
+
# WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 47 |
+
# --model-path /root/weights/enwik8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 48 |
+
# --seed 40 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 8 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11 \
|
| 49 |
+
# --learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset enwik8 \
|
| 50 |
+
# --wandb-project LMC-Attention --wandb-group "GPT2-Enwik8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 51 |
+
# --model-save-dir /root/weights/enwik8/gpt2-finetune --data-path /root/dataset/enwik8
|
| 52 |
+
# """)
|
| 53 |
+
if __name__ == "__main__":
|
| 54 |
+
with app.run():
|
| 55 |
+
run_command.remote()
|
modal/enwik8/matching.py
ADDED
|
File without changes
|
modal/imagenet/__pycache__/generalization.cpython-313.pyc
ADDED
|
Binary file (2.68 kB). View file
|
|
|
modal/imagenet/__pycache__/shot_noise.cpython-313.pyc
ADDED
|
Binary file (2.66 kB). View file
|
|
|
modal/imagenet/generalization.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Generalization Model {model_name} with ImageNet")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
volume5 = Volume.from_name("shot_noise", create_if_missing=True)
|
| 21 |
+
@app.function(
|
| 22 |
+
image=image,
|
| 23 |
+
gpu="H100",
|
| 24 |
+
timeout=3600 * 24,
|
| 25 |
+
volumes={
|
| 26 |
+
"/root/weights":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4,
|
| 27 |
+
"/root/shot_noise":volume5,
|
| 28 |
+
},
|
| 29 |
+
)
|
| 30 |
+
def run_command():
|
| 31 |
+
import os
|
| 32 |
+
# os.system("pip install -e .")
|
| 33 |
+
os.system("ls /root/shot_noise")
|
| 34 |
+
# os.system("""
|
| 35 |
+
# CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 36 |
+
# --model-a /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed0/finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0/best_65052\
|
| 37 |
+
# --model-b /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed20/best_5004\
|
| 38 |
+
# --data-original /root/datasets/imagenet\
|
| 39 |
+
# --data-generalization /root/shot_noise/shot_noise/1
|
| 40 |
+
# """)
|
| 41 |
+
os.system("""
|
| 42 |
+
CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 43 |
+
--model-a /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed0/finetune-learnable-indice0-heads12-shared1-routed0-topk0-seed0/best_65052\
|
| 44 |
+
--model-b /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed40/best_5004\
|
| 45 |
+
--data-original /root/datasets/imagenet\
|
| 46 |
+
--data-generalization /root/shot_noise/shot_noise/4
|
| 47 |
+
""")
|
| 48 |
+
# os.system("""
|
| 49 |
+
# CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 50 |
+
# --model-a /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed20/best_5004\
|
| 51 |
+
# --model-b /root/weights/lmc/imagenet/vit-finetune/finetune-learnable-indice0-heads12-shared1-routed0-topk0-mlpFalse-seed40/best_5004\
|
| 52 |
+
# --data-original /root/datasets/imagenet\
|
| 53 |
+
# --data-generalization /root/shot_noise/shot_noise/1
|
| 54 |
+
# """)
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
with app.run():
|
| 57 |
+
run_command.remote()
|
modal/imagenet/shot_noise.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Generalization Model {model_name} with ImageNet")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
volume5 = Volume.from_name("shot_noise", create_if_missing=True)
|
| 21 |
+
@app.function(
|
| 22 |
+
image=image,
|
| 23 |
+
gpu="H100",
|
| 24 |
+
timeout=3600 * 24,
|
| 25 |
+
volumes={
|
| 26 |
+
"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4,
|
| 27 |
+
"/root/shot_noise":volume5,
|
| 28 |
+
},
|
| 29 |
+
)
|
| 30 |
+
def run_command():
|
| 31 |
+
import os
|
| 32 |
+
# os.system("pip install -e .")
|
| 33 |
+
os.system("ls /root/shot_noise")
|
| 34 |
+
# os.system("""
|
| 35 |
+
# CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 36 |
+
# --model-a /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed0/best_375300\
|
| 37 |
+
# --model-b /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed20/best_335268\
|
| 38 |
+
# --data-original /root/datasets/imagenet\
|
| 39 |
+
# --data-generalization /root/shot_noise/shot_noise/3
|
| 40 |
+
# """)
|
| 41 |
+
# os.system("""
|
| 42 |
+
# CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 43 |
+
# --model-a /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed0/best_375300\
|
| 44 |
+
# --model-b /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed40/best_460368\
|
| 45 |
+
# --data-original /root/datasets/imagenet\
|
| 46 |
+
# --data-generalization /root/shot_noise/shot_noise/3\
|
| 47 |
+
# """)
|
| 48 |
+
os.system("""
|
| 49 |
+
CUDA_VISIBLE_DEVICES=0 python src/imagenet/generalization.py \
|
| 50 |
+
--model-a /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed20/best_335268\
|
| 51 |
+
--model-b /root/weights/vit-finetune/finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads12-shared1-routed0-topk0-mlpFalse-seed40/best_460368\
|
| 52 |
+
--data-original /root/datasets/imagenet\
|
| 53 |
+
--data-generalization /root/shot_noise/shot_noise/3\
|
| 54 |
+
""")
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
if __name__ == "__main__":
|
| 64 |
+
with app.run():
|
| 65 |
+
run_command.remote()
|
modal/lm1b/__pycache__/finetune.cpython-310.pyc
ADDED
|
Binary file (2.21 kB). View file
|
|
|
modal/lm1b/finetune.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Train Model {model_name} with lm1b")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="H100:2",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4},
|
| 25 |
+
)
|
| 26 |
+
def run_command():
|
| 27 |
+
import os
|
| 28 |
+
os.system("pip install -e .")
|
| 29 |
+
|
| 30 |
+
# ---------- Env “exports” to tame XLA autotuner miscompares ----------
|
| 31 |
+
# Safer kernels + determinism; disable TF32 for full fp32 matmuls
|
| 32 |
+
os.environ["NVIDIA_TF32_OVERRIDE"] = "0"
|
| 33 |
+
os.environ["JAX_DEFAULT_MATMUL_PRECISION"] = "highest" # same as jax.config.update(...)
|
| 34 |
+
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
|
| 35 |
+
# --------------------------------------------------------------------
|
| 36 |
+
os.system("""
|
| 37 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0,1 python src/lgmodeling/finetune.py \
|
| 38 |
+
--model-path /root/weights/lm1b/lr0.00025-learnable-step500000-warm2000-size96-layer12-embd768-heads12-shared1-routed0-topk0/best_476000 \
|
| 39 |
+
--seed 0 --tgt_len 256 --mem_len 256 --eval_tgt_len 256 --n_head 12 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 40 |
+
--learning-rate 0.00025 --batch-size 96 --max_step 100000 --warmup_step 1000 --dataset lm1b \
|
| 41 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-OneBillionWord-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 42 |
+
--model-save-dir /root/weights/lm1b/gpt2-finetune --data-path /root/datasets/lm1b
|
| 43 |
+
""")
|
| 44 |
+
|
| 45 |
+
if __name__ == "__main__":
|
| 46 |
+
with app.run():
|
| 47 |
+
run_command.remote()
|
modal/text8/__pycache__/finetune.cpython-310.pyc
ADDED
|
Binary file (7.46 kB). View file
|
|
|
modal/text8/__pycache__/train_model.cpython-310.pyc
ADDED
|
Binary file (2.04 kB). View file
|
|
|
modal/text8/finetune.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Train Model {model_name} with Text8")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="H100:1",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4},
|
| 25 |
+
)
|
| 26 |
+
def run_command():
|
| 27 |
+
import os
|
| 28 |
+
os.system("pip install -e .")
|
| 29 |
+
os.environ["NVIDIA_TF32_OVERRIDE"] = "0"
|
| 30 |
+
os.environ["JAX_DEFAULT_MATMUL_PRECISION"] = "highest"
|
| 31 |
+
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
|
| 32 |
+
os.system("""
|
| 33 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 34 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 35 |
+
--seed 0 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 8 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 36 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 37 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 38 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 39 |
+
""")
|
| 40 |
+
os.system("""
|
| 41 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 42 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 43 |
+
--seed 20 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 8 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 44 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 45 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 46 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 47 |
+
""")
|
| 48 |
+
os.system("""
|
| 49 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 50 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 51 |
+
--seed 40 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 8 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 52 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 53 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 54 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 55 |
+
""")
|
| 56 |
+
os.system("""
|
| 57 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 58 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 59 |
+
--seed 0 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 16 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 60 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 61 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 62 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 63 |
+
""")
|
| 64 |
+
os.system("""
|
| 65 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 66 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 67 |
+
--seed 20 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 16 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 68 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 69 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 70 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 71 |
+
""")
|
| 72 |
+
os.system("""
|
| 73 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 74 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 75 |
+
--seed 40 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 16 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 76 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 77 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 78 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 79 |
+
""")
|
| 80 |
+
os.system("""
|
| 81 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 82 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 83 |
+
--seed 0 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 4 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 84 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 85 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 86 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 87 |
+
""")
|
| 88 |
+
os.system("""
|
| 89 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 90 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 91 |
+
--seed 20 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 4 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 92 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 93 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 94 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 95 |
+
""")
|
| 96 |
+
os.system("""
|
| 97 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/finetune.py \
|
| 98 |
+
--model-path /root/weights/text8/lr0.00025-learnable-step60000-warm0-size24-layer12-embd512-heads8-shared1-routed0-topk0/best_60000 \
|
| 99 |
+
--seed 40 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --n_head 4 --lmc-layer-indices 0 1 2 3 4 5 6 7 8 9 10 11\
|
| 100 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 101 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 102 |
+
--model-save-dir /root/weights/text8/gpt2-finetune --data-path /root/datasets/text8
|
| 103 |
+
""")
|
| 104 |
+
|
| 105 |
+
if __name__ == "__main__":
|
| 106 |
+
with app.run():
|
| 107 |
+
run_command.remote()
|
modal/text8/train_model.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modal import App, Image, Volume
|
| 2 |
+
import modal
|
| 3 |
+
import json
|
| 4 |
+
model_name = "Learnable"
|
| 5 |
+
app = App(f"Train Model {model_name} with Text8")
|
| 6 |
+
# Build image with all local dependencies added directly
|
| 7 |
+
image = (
|
| 8 |
+
Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04",add_python="3.10") # <--- This is the required 'tag'
|
| 9 |
+
.pip_install(["torch", "flax", "pandas", "tqdm","optax", "dataclasses", "argparse","matplotlib",
|
| 10 |
+
"scikit-learn","wandb","timm","torchvision","datasets","transformers","timm"])
|
| 11 |
+
.run_commands("""pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html""")
|
| 12 |
+
.add_local_file("pyproject.toml", "/root/pyproject.toml")
|
| 13 |
+
.add_local_dir("src", "/root/src")
|
| 14 |
+
)
|
| 15 |
+
# Shared volume for saving outputs or checkpoints
|
| 16 |
+
volume1 = Volume.from_name("weights", create_if_missing=True)
|
| 17 |
+
volume2 = Volume.from_name("datasets", create_if_missing=True)
|
| 18 |
+
volume3 = Volume.from_name("plots", create_if_missing=True)
|
| 19 |
+
volume4 = Volume.from_name("results", create_if_missing=True)
|
| 20 |
+
@app.function(
|
| 21 |
+
image=image,
|
| 22 |
+
gpu="H100:1",
|
| 23 |
+
timeout=3600 * 24,
|
| 24 |
+
volumes={"/root/weights/":volume1,"/root/datasets/":volume2,"/root/plots/":volume3,"/root/results/":volume4},
|
| 25 |
+
)
|
| 26 |
+
def run_command():
|
| 27 |
+
import os
|
| 28 |
+
os.system("pip install -e .")
|
| 29 |
+
os.system("""
|
| 30 |
+
WANDB_MODE=online CUDA_VISIBLE_DEVICES=0 python src/lgmodeling/train_model.py \
|
| 31 |
+
--seed 0 --tgt_len 512 --mem_len 512 --eval_tgt_len 128 --position-embeddings "learnable" \
|
| 32 |
+
--num-shared-experts 1 --num-routed-experts 0 --topk 0 --rotary-dim 64 \
|
| 33 |
+
--n_layer 12 --n_embd 512 --n_head 8 --n_inner 2048 --attention-bias \
|
| 34 |
+
--learning-rate 0.00025 --batch-size 24 --max_step 60000 --warmup_step 0 --dataset text8 \
|
| 35 |
+
--wandb-project LMC-Attention --wandb-group "GPT2-Text8-FFN" --wandb-entity "vinh-bui0512-hcmut"\
|
| 36 |
+
--model-save-dir /root/weights/text8 --data-path /root/datasets/text8
|
| 37 |
+
""")
|
| 38 |
+
|
| 39 |
+
if __name__ == "__main__":
|
| 40 |
+
with app.run():
|
| 41 |
+
run_command.remote()
|
output.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
password.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
lmc-transformer: 6niAInCZxocweP6weMTKC8cobrLVHZmttuVh96OmamjSL9gjkHSdJQQJ99BFACAAAAAubb37AAASAZDO2upd
|
| 2 |
+
UKayDJX6eG
|
plots/enwik8/[finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice0,1,2,3,4,5,6,7,8,9,10,11-heads8-shared1-routed0-topk0-seed20]_row0.pdf
ADDED
|
Binary file (14.4 kB). View file
|
|
|
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20].pdf
ADDED
|
Binary file (23.4 kB). View file
|
|
|
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf
ADDED
|
Binary file (18.5 kB). View file
|
|
|
plots/enwik8/[finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed20+finetune-learnable-indice[0]-heads4-shared1-routed0-topk0-seed40].pdf
ADDED
|
Binary file (18.4 kB). View file
|
|
|
plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed20].pdf
ADDED
|
Binary file (19.3 kB). View file
|
|
|
plots/enwik8/[finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed0+finetune-learnable-indice[0]-heads8-shared1-routed0-topk0-seed40].pdf
ADDED
|
Binary file (19.3 kB). View file
|
|
|
plots/enwik8/learnable-indice0-heads16-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.3 kB). View file
|
|
|
plots/enwik8/learnable-indice0-heads4-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.5 kB). View file
|
|
|
plots/enwik8/learnable-indice0-heads8-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.8 kB). View file
|
|
|
plots/imagenet/.pdf.png
ADDED
|
plots/imagenet/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed0+finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed40.pdf
ADDED
|
Binary file (16 kB). View file
|
|
|
plots/imagenet/finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed20+finetune0.005-learnable-indice0-heads4-shared1-routed0-topk0-mlpFalse-seed40.pdf
ADDED
|
Binary file (16 kB). View file
|
|
|
plots/lm1b/learnable-indice0-heads12-shared1-routed0-topk0.pdf
ADDED
|
Binary file (18.5 kB). View file
|
|
|
plots/lm1b/learnable-indice0-heads16-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.8 kB). View file
|
|
|
plots/lm1b/learnable-indice0-heads8-shared1-routed0-topk0.pdf
ADDED
|
Binary file (18.5 kB). View file
|
|
|
plots/text8/learnable-indice0-heads16-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.9 kB). View file
|
|
|
plots/text8/learnable-indice0-heads4-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.8 kB). View file
|
|
|
plots/text8/learnable-indice0-heads8-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.9 kB). View file
|
|
|
plots/wt103/learnable-indice0-heads2-shared1-routed0-topk0.pdf
ADDED
|
Binary file (17.7 kB). View file
|
|
|
plots/wt103/learnable-indice0-heads3-shared1-routed0-topk0.pdf
ADDED
|
Binary file (18 kB). View file
|
|
|
plots/wt103/learnable-indice0-heads4-shared1-routed0-topk0.pdf
ADDED
|
Binary file (18.1 kB). View file
|
|
|
pyproject.toml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools", "setuptools-scm"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "LMC-of-MoE"
|
| 7 |
+
version = "0.3.1"
|
| 8 |
+
description = "Linear Mode Connectivity experiments with Mixture-of-Experts models"
|
| 9 |
+
readme = "README.md"
|
| 10 |
+
requires-python = ">=3.10"
|
| 11 |
+
license = { text = "MIT" }
|
| 12 |
+
authors = [
|
| 13 |
+
{ name = "Your Name", email = "you@example.com" }
|
| 14 |
+
]
|
| 15 |
+
classifiers = [
|
| 16 |
+
"Programming Language :: Python :: 3",
|
| 17 |
+
"License :: OSI Approved :: MIT License",
|
| 18 |
+
"Operating System :: OS Independent",
|
| 19 |
+
]
|
| 20 |
+
|
| 21 |
+
[project.urls]
|
| 22 |
+
"Homepage" = "https://github.com/yourname/LMC-of-MoE"
|
| 23 |
+
"Source" = "https://github.com/yourname/LMC-of-MoE"
|
| 24 |
+
|
| 25 |
+
[tool.setuptools.packages.find]
|
| 26 |
+
where = ["./"]
|
| 27 |
+
|
| 28 |
+
[tool.setuptools.dynamic]
|
| 29 |
+
dependencies = { file = ["requirements.txt"] }
|