├── .github ├── copilot-instructions.md ├── prompts │ └── convert_unsloth_to_ddp.md └── workflows │ ├── deploy.yml │ └── python-publish.yml ├── .gitignore ├── .python-version ├── CHANGELOG.md ├── LICENSE ├── MANIFEST.in ├── README.md ├── TRAINING_README.md ├── docs ├── benchmarks.md └── experiments-sanity-check-eval.md ├── examples ├── qwen_sft.py ├── qwen_sft_cache_dataset.py └── zephyr_dpo_ddp.py ├── images ├── attention_tensor.png ├── llama-factory-tb.png ├── opensloth-tb.png ├── opensloth.png └── saniticheck-eval-loss.png ├── install.sh ├── legacy ├── benchmark.py ├── download_model.sh ├── get_pci.py ├── patching │ ├── __init__.py │ ├── ddp_patch.py │ ├── gemma.py │ ├── get_batch_samples.py │ ├── inner_training_loop.py │ ├── patch_log.py │ └── patch_sampler.py ├── scripts │ └── opensloth_sft_trainer.py ├── train_benchmark.py ├── train_gemma.py ├── train_qwen.py └── unsloth_qwen3_minimal.py ├── notebooks ├── patch.ipynb ├── train.ipynb └── train_ddp.ipynb ├── outputs └── sanity-check-tensorboard │ ├── opensloth_sanity_20250919_151753_ws2 │ ├── README.md │ └── runs │ │ └── Sep19_15-18-38_l4s │ │ └── events.out.tfevents.1758295123.l4s │ ├── opensloth_sanity_20250919_152353_ws2 │ ├── README.md │ └── runs │ │ └── Sep19_15-24-39_l4s │ │ └── events.out.tfevents.1758295487.l4s │ └── opensloth_sanity_20250919_152713_ws4 │ ├── README.md │ └── runs │ └── Sep19_15-28-02_l4s │ └── events.out.tfevents.1758295689.l4s ├── poetry.lock ├── pyproject.toml ├── ruff.toml ├── scripts └── sanity_check_training.sh ├── src └── opensloth │ ├── __init__.py │ ├── _debug_dataloader.py │ ├── patching │ ├── __init__.py │ ├── ddp_patch.py │ └── utils.py │ ├── scripts │ └── lora_save_fp8.py │ └── utils │ ├── __init__.py │ ├── dataset_cache.py │ └── packing.py ├── train_scripts ├── train_configurable.py └── train_ddp.py └── uv.lock /.github/copilot-instructions.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/.github/copilot-instructions.md -------------------------------------------------------------------------------- /.github/prompts/convert_unsloth_to_ddp.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/.github/prompts/convert_unsloth_to_ddp.md -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/.github/workflows/deploy.yml -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/.github/workflows/python-publish.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/.gitignore -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.12 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/LICENSE -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/MANIFEST.in -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/README.md -------------------------------------------------------------------------------- /TRAINING_README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/TRAINING_README.md -------------------------------------------------------------------------------- /docs/benchmarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/docs/benchmarks.md -------------------------------------------------------------------------------- /docs/experiments-sanity-check-eval.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/docs/experiments-sanity-check-eval.md -------------------------------------------------------------------------------- /examples/qwen_sft.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/examples/qwen_sft.py -------------------------------------------------------------------------------- /examples/qwen_sft_cache_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/examples/qwen_sft_cache_dataset.py -------------------------------------------------------------------------------- /examples/zephyr_dpo_ddp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/examples/zephyr_dpo_ddp.py -------------------------------------------------------------------------------- /images/attention_tensor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/images/attention_tensor.png -------------------------------------------------------------------------------- /images/llama-factory-tb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/images/llama-factory-tb.png -------------------------------------------------------------------------------- /images/opensloth-tb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/images/opensloth-tb.png -------------------------------------------------------------------------------- /images/opensloth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/images/opensloth.png -------------------------------------------------------------------------------- /images/saniticheck-eval-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/images/saniticheck-eval-loss.png -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/install.sh -------------------------------------------------------------------------------- /legacy/benchmark.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/benchmark.py -------------------------------------------------------------------------------- /legacy/download_model.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/download_model.sh -------------------------------------------------------------------------------- /legacy/get_pci.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/get_pci.py -------------------------------------------------------------------------------- /legacy/patching/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/__init__.py -------------------------------------------------------------------------------- /legacy/patching/ddp_patch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/ddp_patch.py -------------------------------------------------------------------------------- /legacy/patching/gemma.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/gemma.py -------------------------------------------------------------------------------- /legacy/patching/get_batch_samples.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/get_batch_samples.py -------------------------------------------------------------------------------- /legacy/patching/inner_training_loop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/inner_training_loop.py -------------------------------------------------------------------------------- /legacy/patching/patch_log.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/patch_log.py -------------------------------------------------------------------------------- /legacy/patching/patch_sampler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/patching/patch_sampler.py -------------------------------------------------------------------------------- /legacy/scripts/opensloth_sft_trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/scripts/opensloth_sft_trainer.py -------------------------------------------------------------------------------- /legacy/train_benchmark.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/train_benchmark.py -------------------------------------------------------------------------------- /legacy/train_gemma.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/train_gemma.py -------------------------------------------------------------------------------- /legacy/train_qwen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/train_qwen.py -------------------------------------------------------------------------------- /legacy/unsloth_qwen3_minimal.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/legacy/unsloth_qwen3_minimal.py -------------------------------------------------------------------------------- /notebooks/patch.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/notebooks/patch.ipynb -------------------------------------------------------------------------------- /notebooks/train.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/notebooks/train.ipynb -------------------------------------------------------------------------------- /notebooks/train_ddp.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/notebooks/train_ddp.ipynb -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_151753_ws2/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_151753_ws2/README.md -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_151753_ws2/runs/Sep19_15-18-38_l4s/events.out.tfevents.1758295123.l4s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_151753_ws2/runs/Sep19_15-18-38_l4s/events.out.tfevents.1758295123.l4s -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152353_ws2/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152353_ws2/README.md -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152353_ws2/runs/Sep19_15-24-39_l4s/events.out.tfevents.1758295487.l4s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152353_ws2/runs/Sep19_15-24-39_l4s/events.out.tfevents.1758295487.l4s -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152713_ws4/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152713_ws4/README.md -------------------------------------------------------------------------------- /outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152713_ws4/runs/Sep19_15-28-02_l4s/events.out.tfevents.1758295689.l4s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/outputs/sanity-check-tensorboard/opensloth_sanity_20250919_152713_ws4/runs/Sep19_15-28-02_l4s/events.out.tfevents.1758295689.l4s -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/poetry.lock -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/pyproject.toml -------------------------------------------------------------------------------- /ruff.toml: -------------------------------------------------------------------------------- 1 | ignore = ["E402"] 2 | -------------------------------------------------------------------------------- /scripts/sanity_check_training.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/scripts/sanity_check_training.sh -------------------------------------------------------------------------------- /src/opensloth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/__init__.py -------------------------------------------------------------------------------- /src/opensloth/_debug_dataloader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/_debug_dataloader.py -------------------------------------------------------------------------------- /src/opensloth/patching/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/opensloth/patching/ddp_patch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/patching/ddp_patch.py -------------------------------------------------------------------------------- /src/opensloth/patching/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/patching/utils.py -------------------------------------------------------------------------------- /src/opensloth/scripts/lora_save_fp8.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/scripts/lora_save_fp8.py -------------------------------------------------------------------------------- /src/opensloth/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/utils/__init__.py -------------------------------------------------------------------------------- /src/opensloth/utils/dataset_cache.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/utils/dataset_cache.py -------------------------------------------------------------------------------- /src/opensloth/utils/packing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/src/opensloth/utils/packing.py -------------------------------------------------------------------------------- /train_scripts/train_configurable.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/train_scripts/train_configurable.py -------------------------------------------------------------------------------- /train_scripts/train_ddp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/train_scripts/train_ddp.py -------------------------------------------------------------------------------- /uv.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anhvth/opensloth/HEAD/uv.lock --------------------------------------------------------------------------------