radixark/miles
Miles is an enterprise-facing reinforcement learning framework for LLM and VLM post-training, forked from and co-evolving with slime.
Python★ 2,587+64 that day#8 on trending
5.3%duplicated code · 5,467 of 103,071 lines
274clones in code
532code files of 1,924 scanned
9.78%duplicated over all files · 1,769 clones
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 1 generated file: tests/fast/utils/test_run_uuid.py.
Largest clones in the code
- 119 lines in 2 placespython817 tokensmiles_plugins/models/deepseek_v4/ops/kernel/tilelang_indexer_fwd.py:7–125miles_plugins/models/glm5/ops/tilelang_indexer_fwd.py:3–121
7import tilelang 8import torch 9from tilelang import language as T 10 11 12@tilelang.jit( 13 pass_configs={ 14 tilelang.PassConfigKey.TL_ENABLE_FAST_MATH: True, 15 }, 16)First 10 of 119 lines.
- 74 lines in 2 placespython553 tokensmiles_plugins/models/deepseek_v4/ops/kernel/tilelang_indexer_bwd.py:3–76miles_plugins/models/glm5/ops/tilelang_indexer_bwd.py:3–76
3import tilelang as tl 4import tilelang.language as T 5import torch 6 7BF16 = T.bfloat16 8FP32 = T.float32 9INT32 = T.int32 10 11pass_configs = { 12 tl.PassConfigKey.TL_DISABLE_TMA_LOWER: True,First 10 of 74 lines.
- 48 lines in 3 placespython268 tokensmiles/backends/megatron_utils/megatron_to_hf/deepseekv3.py:6–53miles/backends/megatron_utils/megatron_to_hf/qwen3_next.py:6–53miles/backends/megatron_utils/megatron_to_hf/qwen3moe.py:6–53
6def convert_deepseekv3_to_hf(args, name, param): 7 if name == "module.module.embedding.word_embeddings.weight": 8 return [("model.embed_tokens.weight", param)] 9 if name == "module.module.output_layer.weight": 10 return [("lm_head.weight", param)] 11 if name == "module.module.decoder.final_layernorm.weight": 12 return [("model.norm.weight", param)] 13 14 try: 15 head_dim = args.kv_channels if args.kv_channels is not None else args.hidden_size // args.num_attention_headsFirst 10 of 48 lines.
7 more
- 67 lines in 2 placespython467 tokens
- 92 lines in 2 placespython452 tokens
- 65 lines in 2 placespython441 tokens
- 48 lines in 2 placespython403 tokens
- 16 lines in 5 placespython100 tokensmiles/backends/megatron_utils/megatron_to_hf/deepseekv3.py:105–120miles/backends/megatron_utils/megatron_to_hf/glm4moe.py:85–100miles/backends/megatron_utils/megatron_to_hf/qwen2.py:45–60miles/backends/megatron_utils/megatron_to_hf/qwen3_next.py:90–105miles/backends/megatron_utils/megatron_to_hf/qwen3moe.py:85–100
- 18 lines in 4 placespython122 tokens
- 31 lines in 2 placespython352 tokens
Largest clones over all files, tests and data included
- 18 lines in 23 placestxttests141 tokenstests/snapshots/launch_scripts/py/scripts/amd/run_deepseek_v4.py/train.txt:1–18tests/snapshots/launch_scripts/py/scripts/amd/run_qwen3_30b_a3b.py/execute.txt:1–18tests/snapshots/launch_scripts/py/scripts/run_deepseek_v32.py/train.txt:1–18tests/snapshots/launch_scripts/py/scripts/run_deepseek_v4.py/train.txt:1–18tests/snapshots/launch_scripts/py/scripts/run_gemma_4_26b_a4b.py/train.txt:1–18and 18 more
1### 0 2pkill -9 sglang; sleep 3; ray stop 3 --force; pkill -9 ray; pkill -9 miles; sleep 3; pkill -9 ray; pkill -9 miles; pkill -9 redis; true; 4 5### 1 6export PYTHONUNBUFFERED=1 && ray start 7 --head 8 --node-ip-address 127.0.0.1 9 --num-gpus 8 10 --disable-usage-statsFirst 10 of 18 lines.
- 42 lines in 15 placestxttests193 tokenstests/snapshots/launch_scripts/self_executing/examples/infra_features/p2p_weight_transfer/run.py/run/GLM-4.5-Air/broadcast.txt:1–42tests/snapshots/launch_scripts/self_executing/examples/infra_features/p2p_weight_transfer/run.py/run/GLM-4.7-Flash/broadcast.txt:1–42tests/snapshots/launch_scripts/self_executing/examples/infra_features/p2p_weight_transfer/run.py/run/GLM-4.7-Flash/p2p.txt:1–42tests/snapshots/launch_scripts/self_executing/examples/infra_features/p2p_weight_transfer/run.py/run/GLM-5/broadcast.txt:1–42tests/snapshots/launch_scripts/self_executing/examples/infra_features/p2p_weight_transfer/run.py/run/GLM-5/p2p.txt:1–42and 10 more
1### 0 2pkill -9 sglang || true 3 4### 1 5sleep 3 6 7### 2 8ray stop 9 --force || true 10First 10 of 42 lines.
- 208 lines in 2 placesmarkdowndocs and examples2,503 tokensdocs/examples/on-policy-distillation/qwen3-5-35b-selfdistill.md:6–213examples/on_policy_distillation/qwen3_5_35b_selfdistill/README.md:3–210
6A reproducible two-phase on-policy-distillation (OPD) example for the 7**Qwen3.5-35B-A3B** MoE on a **single 8×H200 node**, using the **in-process 8Megatron teacher** (`--opd-type megatron`, no separate teacher server). 9 10It differs from the sibling examples in three ways: 11 121. **Real MoE at scale on one node.** The 2-node/16-GPU recipe is re-tiled to 8 GPUs. 132. **A genuinely diverged teacher.** `run-qwen3-8B-opd-megatron.sh` uses `teacher == base` 14 (a mechanism demo where the reverse-KL is ~0). Here Phase 1 *trains* the teacher 15 with RLVR so it is measurably better and more concise than the base — theFirst 10 of 208 lines.
- 130 lines in 2 placesmarkdowndocs and examples1,861 tokens
- 113 lines in 2 placesmarkdowndocs and examples1,587 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 508 | 98,864 | 267 | 5,417 | 5.48% |
| javascript | 11 | 3,054 | 7 | 50 | 1.64% |
| bash | 12 | 979 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 1,305 | 262,836 | 798 | 12,521 | 4.76% |
| txt | 180 | 21,569 | 544 | 12,916 | 59.88% |
| bash | 166 | 11,381 | 338 | 4,984 | 43.79% |
| markdown | 178 | 23,887 | 44 | 1,564 | 6.55% |
| yaml | 34 | 3,254 | 30 | 327 | 10.05% |
| javascript | 12 | 3,086 | 7 | 50 | 1.62% |
| diff | 11 | 2,237 | 4 | 33 | 1.48% |
| css | 4 | 1,968 | 3 | 18 | 0.91% |
| text | 18 | 342 | 1 | 9 | 2.63% |
| json | 3 | 553 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 5, 2026 | #8 | 2,587 (+64) | 1,924 | 331,555 | 1,769 | 9.78% | 5.3% | — | d2fc97c |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.