├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yaml │ ├── config.yml │ └── feature-request.yaml ├── pull_request_template.md └── workflows │ ├── doctests.yaml │ ├── gpu_tests.yaml │ ├── pretest.yaml │ ├── release_docker.yaml │ ├── release_gcp.yaml │ └── release_pypi.yaml ├── .gitignore ├── .markdownlint.json ├── .pre-commit-config.yaml ├── .vscode ├── launch.json └── settings.json ├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── STYLE_GUIDE.md ├── configs ├── README.md ├── apis │ ├── anthropic │ │ ├── eval_claude_3_5_sonnet.yaml │ │ ├── eval_claude_3_7_sonnet.yaml │ │ ├── infer_claude_3_5_sonnet.yaml │ │ └── infer_claude_3_7_sonnet.yaml │ ├── gemini │ │ ├── eval_gemini_1_5_pro.yaml │ │ └── infer_gemini_1_5_pro.yaml │ ├── openai │ │ ├── eval_gpt_4o.yaml │ │ ├── eval_gpt_o1_preview.yaml │ │ ├── infer_gpt_4o.yaml │ │ └── infer_gpt_o1_preview.yaml │ └── vertex │ │ ├── eval_llama_3_1_405b.yaml │ │ ├── eval_llama_3_3_70b.yaml │ │ ├── infer_llama_3_1_405b.yaml │ │ └── infer_llama_3_3_70b.yaml ├── examples │ ├── README.md │ ├── berry_bench │ │ └── evaluation │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ ├── bulk_inference │ │ ├── README.md │ │ └── gcp_job.yaml │ ├── fineweb_ablation_pretraining │ │ ├── README.md │ │ ├── ddp │ │ │ ├── gcp_job.yaml │ │ │ ├── polaris_job.yaml │ │ │ └── train.yaml │ │ └── fsdp │ │ │ ├── gcp_job.yaml │ │ │ ├── polaris_job.yaml │ │ │ └── train.yaml │ ├── grpo_tldr │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── grpo_verl_countdown │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── grpo_verl_geometry3k │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── letter_counting │ │ ├── evaluation │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ │ └── grpo │ │ │ ├── gcp_job.yaml │ │ │ └── train.yaml │ └── misc │ │ ├── README.md │ │ ├── dev_gcp_job.yaml │ │ ├── hello_world_gcp_job.yaml │ │ ├── hello_world_polaris_job.yaml │ │ ├── sky_init.sh │ │ ├── tulu3_sft_mini.yaml │ │ └── vllm_polaris_job.yaml ├── projects │ ├── README.md │ ├── aya │ │ ├── README.md │ │ ├── evaluation │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ │ └── sft │ │ │ ├── gcp_job.yaml │ │ │ └── train.yaml │ ├── chatqa │ │ ├── README.md │ │ ├── chatqa_stage1_train.yaml │ │ ├── chatqa_stage2_train.yaml │ │ └── gcp_job.yaml │ ├── coalm │ │ ├── 405b_train.yaml │ │ ├── 70b_infer.yaml │ │ ├── 70b_train.yaml │ │ ├── 8b_infer.yaml │ │ ├── 8b_train.yaml │ │ ├── README.md │ │ └── images │ │ │ ├── dataset.png │ │ │ └── results.png │ ├── dcvlr │ │ ├── README.md │ │ └── starter_kit │ │ │ ├── molmo-d-train-openr1.yaml │ │ │ ├── molmo-o-train-openr1.yaml │ │ │ └── qwenvl-openr1.yaml │ ├── halloumi │ │ ├── 8b_train.yaml │ │ ├── README.md │ │ ├── gcp_job.yaml │ │ ├── halloumi_classifier_inference_notebook.ipynb │ │ ├── halloumi_eval_notebook.ipynb │ │ └── halloumi_inference_notebook.ipynb │ └── wc50m │ │ ├── README.md │ │ ├── configs │ │ ├── base_ultrachat.yaml │ │ └── gcp_base_ultrachat.yaml │ │ └── results │ │ ├── baseline.csv │ │ └── oumi.csv └── recipes │ ├── README.md │ ├── deepseek_r1 │ ├── README.md │ ├── evaluation │ │ ├── distill_llama_70b │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ │ ├── distill_llama_8b │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ │ ├── distill_qwen_1_5b │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ │ └── distill_qwen_32b │ │ │ ├── eval.yaml │ │ │ └── gcp_job.yaml │ ├── inference │ │ ├── 671b_together_infer.yaml │ │ ├── distill_llama_70b_infer.yaml │ │ ├── distill_llama_8b_infer.yaml │ │ ├── distill_qwen_1_5b_infer.yaml │ │ └── distill_qwen_32b_infer.yaml │ └── sft │ │ ├── distill_llama_70b │ │ ├── full_gcp_job.yaml │ │ ├── full_train.yaml │ │ ├── lora_gcp_job.yaml │ │ ├── lora_train.yaml │ │ ├── qlora_gcp_job.yaml │ │ └── qlora_train.yaml │ │ ├── distill_llama_8b │ │ ├── full_gcp_job.yaml │ │ ├── full_train.yaml │ │ ├── lora_gcp_job.yaml │ │ ├── lora_train.yaml │ │ ├── qlora_gcp_job.yaml │ │ └── qlora_train.yaml │ │ ├── distill_qwen_1_5b │ │ ├── full_frontier_job.yaml │ │ ├── full_gcp_job.yaml │ │ ├── full_train.yaml │ │ ├── lora_gcp_job.yaml │ │ └── lora_train.yaml │ │ └── distill_qwen_32b │ │ ├── lora_gcp_job.yaml │ │ └── lora_train.yaml │ ├── falcon_e │ ├── README.md │ ├── dpo │ │ └── falcon_e_1b_instruct │ │ │ └── dpo.yaml │ ├── evaluation │ │ ├── falcon_e_1b │ │ │ └── eval.yaml │ │ ├── falcon_e_1b_instruct │ │ │ └── eval.yaml │ │ ├── falcon_e_3b │ │ │ └── eval.yaml │ │ └── falcon_e_3b_instruct │ │ │ └── eval.yaml │ └── sft │ │ ├── falcon_e_1b │ │ └── full_train.yaml │ │ ├── falcon_e_1b_instruct │ │ └── full_train.yaml │ │ ├── falcon_e_3b │ │ └── full_train.yaml │ │ └── falcon_e_3b_instruct │ │ └── full_train.yaml │ ├── falcon_h1 │ ├── README.md │ ├── dpo │ │ └── falcon_h1_0_5b │ │ │ └── qlora_dpo.yaml │ ├── evaluation │ │ ├── falcon_h1_0_5b │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ │ ├── falcon_h1_1_5b │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ │ ├── falcon_h1_1_5b_deep │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ │ ├── falcon_h1_34b │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ │ ├── falcon_h1_3b │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ │ └── falcon_h1_7b │ │ │ ├── eval.yaml │ │ │ └── lambda_job.yaml │ ├── inference │ │ ├── 0_5b_infer.yaml │ │ ├── 1_5b_deep_infer.yaml │ │ ├── 1_5b_infer.yaml │ │ ├── 34b_infer.yaml │ │ ├── 3b_infer.yaml │ │ └── 7b_infer.yaml │ └── sft │ │ ├── falcon_h1_0_5b │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ │ ├── falcon_h1_1_5b │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ │ ├── falcon_h1_1_5b_deep │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ │ ├── falcon_h1_34b │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ │ ├── falcon_h1_3b │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ │ └── falcon_h1_7b │ │ ├── full_lambda_job.yaml │ │ └── full_train.yaml │ ├── gpt2 │ ├── README.md │ ├── evaluation │ │ ├── async_eval.yaml │ │ └── async_gcp_job.yaml │ ├── inference │ │ └── infer.yaml │ └── pretraining │ │ ├── gcp_job.yaml │ │ ├── mac_train.yaml │ │ └── train.yaml │ ├── llama3_1 │ ├── README.md │ ├── evaluation │ │ ├── 70b_eval.yaml │ │ ├── 70b_gcp_job.yaml │ │ ├── 70b_polaris_job.yaml │ │ ├── 8b_eval.yaml │ │ ├── 8b_gcp_job.yaml │ │ └── 8b_polaris_job.yaml │ ├── inference │ │ ├── 70b_infer.yaml │ │ ├── 8b_infer.yaml │ │ ├── 8b_rvllm_infer.yaml │ │ └── 8b_sglang_infer.yaml │ ├── pretraining │ │ └── 8b │ │ │ ├── gcp_job.yaml │ │ │ ├── polaris_job.yaml │ │ │ └── train.yaml │ └── sft │ │ ├── 405b_full │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 405b_lora │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 405b_qlora │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 70b_full │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 70b_lora │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 70b_qlora │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 8b_full │ │ ├── accelerate.yaml │ │ ├── gcp_job.yaml │ │ ├── longctx_train.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 8b_lora │ │ ├── fsdp_gcp_job.yaml │ │ ├── fsdp_train.yaml │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ └── 8b_qlora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── llama3_2 │ ├── README.md │ ├── dpo │ │ └── 1b_qlora_dpo.yaml │ ├── evaluation │ │ ├── 1b_eval.yaml │ │ └── 3b_eval.yaml │ ├── inference │ │ ├── 1b_infer.yaml │ │ ├── 1b_sglang_infer.yaml │ │ ├── 1b_vllm_infer.yaml │ │ ├── 3b_infer.yaml │ │ ├── 3b_sglang_infer.yaml │ │ └── 3b_vllm_infer.yaml │ └── sft │ │ ├── 1b_full │ │ └── train.yaml │ │ ├── 3b_full │ │ ├── fsdp_gcp_job.yaml │ │ ├── fsdp_train.yaml │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ ├── 3b_lora │ │ ├── fsdp_gcp_job.yaml │ │ ├── fsdp_train.yaml │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ │ └── 3b_qlora │ │ ├── fsdp_gcp_job.yaml │ │ ├── fsdp_train.yaml │ │ ├── gcp_job.yaml │ │ ├── polaris_job.yaml │ │ └── train.yaml │ ├── llama3_3 │ ├── README.md │ ├── evaluation │ │ ├── 70b_eval.yaml │ │ └── 70b_gcp_job.yaml │ ├── inference │ │ ├── 70b_infer.yaml │ │ └── 70b_vllm_infer.yaml │ └── sft │ │ ├── 70b_full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ ├── 70b_lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── 70b_qlora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── llama4 │ ├── README.md │ ├── evaluation │ │ └── scout_instruct_eval.yaml │ ├── inference │ │ ├── maverick_instruct_together_infer.yaml │ │ ├── scout_instruct_infer.yaml │ │ ├── scout_instruct_together_infer.yaml │ │ └── scout_instruct_vllm_infer.yaml │ └── sft │ │ ├── scout_base_full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ ├── scout_instruct_full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ ├── scout_instruct_lora │ │ └── train.yaml │ │ └── scout_instruct_qlora │ │ └── train.yaml │ ├── phi3 │ ├── README.md │ ├── dpo │ │ ├── gcp_job.yaml │ │ ├── mac_train.yaml │ │ ├── nvidia_24g_train.yaml │ │ ├── nvidia_80g_train.yaml │ │ └── train.yaml │ ├── evaluation │ │ ├── eval.yaml │ │ └── gcp_job.yaml │ └── sft │ │ ├── lora_train.yaml │ │ └── mac_lora_train.yaml │ ├── phi4 │ ├── README.md │ ├── evaluation │ │ ├── reasoning_plus_eval.yaml │ │ └── reasoning_plus_gcp_job.yaml │ ├── inference │ │ └── reasoning_plus_infer.yaml │ └── sft │ │ └── reasoning_plus │ │ ├── full_gcp_job.yaml │ │ ├── full_train.yaml │ │ ├── lora_gcp_job.yaml │ │ ├── lora_train.yaml │ │ ├── qlora_gcp_job.yaml │ │ └── qlora_train.yaml │ ├── qwen3 │ ├── README.md │ ├── evaluation │ │ ├── 30b_a3b_eval.yaml │ │ ├── 30b_a3b_gcp_job.yaml │ │ ├── 32b_eval.yaml │ │ └── 32b_gcp_job.yaml │ ├── inference │ │ ├── 30b_a3b_infer.yaml │ │ └── 32b_infer.yaml │ └── sft │ │ ├── 30b_a3b_lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── 32b_lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── qwq │ ├── evaluation │ │ ├── eval.yaml │ │ └── gcp_job.yaml │ ├── inference │ │ └── infer.yaml │ └── sft │ │ ├── full_gcp_job.yaml │ │ ├── full_train.yaml │ │ ├── lora_gcp_job.yaml │ │ ├── lora_train.yaml │ │ ├── qlora_gcp_job.yaml │ │ └── qlora_train.yaml │ ├── smollm │ ├── README.md │ ├── evaluation │ │ └── 135m │ │ │ ├── eval.yaml │ │ │ ├── gcp_job.yaml │ │ │ ├── leaderboards │ │ │ ├── huggingface_leaderboard_v1_eval.yaml │ │ │ ├── huggingface_leaderboard_v1_gcp_job.yaml │ │ │ ├── huggingface_leaderboard_v2_eval.yaml │ │ │ └── huggingface_leaderboard_v2_gcp_job.yaml │ │ │ ├── quickstart_alpaca_v2_eval.yaml │ │ │ ├── quickstart_eval.yaml │ │ │ └── quickstart_gcp_job.yaml │ ├── inference │ │ └── 135m_infer.yaml │ └── sft │ │ └── 135m │ │ ├── gcp_job.yaml │ │ ├── quickstart_gcp_job.yaml │ │ ├── quickstart_train.yaml │ │ └── train.yaml │ └── vision │ ├── README.md │ ├── internvl3 │ ├── README.md │ └── sft │ │ └── full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── llama3_2_vision │ ├── README.md │ ├── evaluation │ │ ├── 11b_eval.yaml │ │ └── 11b_gcp_job.yaml │ ├── inference │ │ ├── 11b_infer.yaml │ │ ├── 11b_rvllm_infer.yaml │ │ ├── 11b_sglang_infer.yaml │ │ └── 11b_vllm_infer.yaml │ └── sft │ │ ├── 11b_full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ ├── 11b_lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── 90b_full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── llava_7b │ ├── README.md │ ├── inference │ │ ├── infer.yaml │ │ └── vllm_infer.yaml │ └── sft │ │ ├── oumi_gcp_job.yaml │ │ ├── train.yaml │ │ └── trl_gcp_job.yaml │ ├── molmo │ ├── README.md │ ├── grpo │ │ └── train.yaml │ └── sft │ │ ├── molmo_d_full │ │ └── train.yaml │ │ └── molmo_o_full │ │ └── train.yaml │ ├── phi3 │ ├── README.md │ ├── inference │ │ └── vllm_infer.yaml │ └── sft │ │ ├── full │ │ ├── completions_only_train.yaml │ │ ├── oumi_gcp_job.yaml │ │ ├── train.yaml │ │ └── trl_gcp_job.yaml │ │ └── lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── phi4 │ ├── README.md │ ├── inference │ │ ├── infer.yaml │ │ └── vllm_infer.yaml │ └── sft │ │ ├── full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── qwen2_5_vl_3b │ ├── README.md │ ├── inference │ │ ├── infer.yaml │ │ └── vllm_infer.yaml │ └── sft │ │ ├── full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ ├── qwen2_5_vl_7b │ └── sft │ │ └── full │ │ └── train.yaml │ ├── qwen2_vl_2b │ ├── README.md │ ├── evaluation │ │ ├── eval.yaml │ │ └── gcp_job.yaml │ ├── inference │ │ ├── infer.yaml │ │ ├── sglang_infer.yaml │ │ └── vllm_infer.yaml │ └── sft │ │ ├── full │ │ ├── gcp_job.yaml │ │ └── train.yaml │ │ └── lora │ │ ├── gcp_job.yaml │ │ └── train.yaml │ └── smolvlm │ ├── README.md │ ├── inference │ ├── infer.yaml │ └── vllm_infer.yaml │ └── sft │ ├── full │ ├── gcp_job.yaml │ └── train.yaml │ └── lora │ ├── gcp_job.yaml │ └── train.yaml ├── data └── dataset_examples │ ├── README.md │ ├── alpaca_format.json │ ├── alpaca_format.jsonl │ ├── oumi_format.json │ ├── oumi_format.jsonl │ └── vision_language_oumi_format.jsonl ├── docs ├── .gitignore ├── _doclinks.config ├── _docsummaries.sh ├── _manage_doclinks.py ├── _static │ ├── judge │ │ └── judge_figure.svg │ └── logo │ │ ├── favicon.png │ │ ├── header_logo.png │ │ ├── oumi_logo_dark.png │ │ └── oumi_logo_light.png ├── _summarize_module.py ├── _templates │ ├── apidoc │ │ └── package.rst.jinja │ └── autodoc2 │ │ └── index.jinja ├── about │ ├── acknowledgements.md │ ├── changelog.md │ ├── citations.md │ └── license.md ├── citations.bib ├── cli │ └── commands.md ├── conf.py ├── development │ ├── code_of_conduct.md │ ├── contributing.md │ ├── dev_setup.md │ ├── docs_guide.md │ └── style_guide.md ├── faq │ ├── oom.md │ └── troubleshooting.md ├── get_started │ ├── core_concepts.md │ ├── installation.md │ ├── quickstart.md │ └── tutorials.md ├── index.md ├── resources │ ├── datasets │ │ ├── data_formats.md │ │ ├── datasets.md │ │ ├── other_datasets.md │ │ ├── preference_datasets.md │ │ ├── pretraining_datasets.md │ │ ├── sft_datasets.md │ │ └── vl_sft_datasets.md │ ├── models │ │ ├── custom_models.md │ │ ├── models.md │ │ └── supported_models.md │ └── recipes.md └── user_guides │ ├── customization.md │ ├── evaluate │ ├── custom_evals.md │ ├── evaluate.md │ ├── evaluation_config.md │ ├── generative_benchmarks.md │ ├── leaderboards.md │ └── standardized_benchmarks.md │ ├── infer │ ├── common_workflows.md │ ├── configuration.md │ ├── infer.md │ ├── inference_cli.md │ └── inference_engines.md │ ├── judge │ ├── built_in_judge.md │ ├── custom_infer.md │ ├── custom_prompt.md │ └── judge.md │ ├── launch │ ├── custom_cluster.md │ ├── deploy.md │ └── launch.md │ └── train │ ├── configuration.md │ ├── environments │ ├── environments.md │ ├── local.md │ ├── notebooks.md │ └── vscode.md │ ├── monitoring.md │ ├── train.md │ └── training_methods.md ├── notebooks ├── Oumi - A Tour.ipynb ├── Oumi - Build your own Custom Evaluation (Hallucination Classifier).ipynb ├── Oumi - Custom Judge.ipynb ├── Oumi - Deploying a Job.ipynb ├── Oumi - Distill a Large Model.ipynb ├── Oumi - Evaluation with AlpacaEval 2.0.ipynb ├── Oumi - Evaluation with MT Bench.ipynb ├── Oumi - Evaluation with Oumi.ipynb ├── Oumi - Finetuning Tutorial.ipynb ├── Oumi - Launching Jobs on Custom Clusters.ipynb ├── Oumi - MiniMath-R1-1.5B.ipynb ├── Oumi - Oumi Judge.ipynb ├── Oumi - Running Jobs Remotely.ipynb ├── Oumi - Train a Letter Counting Model using GRPO.ipynb ├── Oumi - Training CNN on Custom Dataset.ipynb ├── Oumi - Using NanoGPT.ipynb ├── Oumi - Using vLLM Engine for Inference.ipynb └── Oumi - Vision Language Models.ipynb ├── pyproject.toml ├── scripts ├── .gitignore ├── benchmarks │ ├── benchmark_dataloader.py │ ├── benchmark_nccl.py │ ├── benchmark_trainers.sh │ ├── minimal_fsdp_training.py │ └── minimal_multimodal_training.py ├── datasets │ ├── pretokenize │ │ ├── README.md │ │ ├── process_dataset.py │ │ └── sky.yaml │ └── save_conversations.py ├── demo.py ├── docker │ └── build_docker.sh ├── examples │ ├── batch_inference │ │ ├── README.md │ │ ├── bulk_infer.py │ │ ├── infer.yaml │ │ └── smollm_infer.yaml │ └── evaluation │ │ ├── README.md │ │ └── custom_evaluation.py ├── frontier │ ├── README.md │ ├── frontier_init.sh │ ├── jobs │ │ └── example_job.sh │ └── launcher.sh ├── inference │ ├── README.md │ └── gcp_inference.py ├── llama_e2e.py ├── memcalc.py └── polaris │ ├── README.md │ ├── jobs │ ├── build_apptainer_from_docker.sh │ ├── download_model_from_hf.sh │ ├── example_job.sh │ ├── fineweb_pt_job.sh │ ├── fineweb_pt_worker.sh │ ├── llama_tune.sh │ ├── python │ │ ├── vllm_inference.py │ │ └── vllm_parallel_inference.py │ ├── vllm_job.sh │ └── vllm_worker.sh │ ├── launcher.sh │ ├── notebooks │ ├── Oumi - Multinode Inference on Polaris.ipynb │ └── Oumi - Tuning Llama.ipynb │ └── polaris_init.sh ├── src ├── experimental │ ├── __init__.py │ ├── configs │ │ ├── projects │ │ │ └── zephyr │ │ │ │ ├── README.md │ │ │ │ ├── evaluation │ │ │ │ └── eval.yaml │ │ │ │ └── sft │ │ │ │ ├── full_gcp_job.yaml │ │ │ │ ├── full_train.yaml │ │ │ │ ├── qlora_gcp_job.yaml │ │ │ │ └── qlora_train.yaml │ │ └── recipes │ │ │ └── phi3 │ │ │ └── dpo │ │ │ ├── fsdp_gcp_job.yaml │ │ │ └── fsdp_nvidia_24g_train.yaml │ └── notebooks │ │ └── Oumi - Datasets Tutorial.ipynb └── oumi │ ├── __init__.py │ ├── __main__.py │ ├── builders │ ├── __init__.py │ ├── callbacks.py │ ├── collators.py │ ├── data.py │ ├── inference_engines.py │ ├── lr_schedules.py │ ├── metrics.py │ ├── models.py │ ├── optimizers.py │ ├── oumi_data.py │ ├── processors.py │ ├── rewards.py │ └── training.py │ ├── cli │ ├── alias.py │ ├── cli_utils.py │ ├── distributed_run.py │ ├── env.py │ ├── evaluate.py │ ├── fetch.py │ ├── infer.py │ ├── judge.py │ ├── launch.py │ ├── main.py │ └── train.py │ ├── core │ ├── __init__.py │ ├── async_utils.py │ ├── callbacks │ │ ├── __init__.py │ │ ├── base_trainer_callback.py │ │ ├── bitnet_callback.py │ │ ├── hf_mfu_callback.py │ │ ├── mfu_callback.py │ │ ├── nan_inf_detection_callback.py │ │ ├── profiler_step_callback.py │ │ └── telemetry_callback.py │ ├── collators │ │ ├── text_collator_with_padding.py │ │ ├── text_completions_collator_with_padding.py │ │ ├── vision_language_collator_with_padding.py │ │ └── vision_language_sft_collator.py │ ├── configs │ │ ├── __init__.py │ │ ├── async_evaluation_config.py │ │ ├── base_config.py │ │ ├── evaluation_config.py │ │ ├── inference_config.py │ │ ├── inference_engine_type.py │ │ ├── internal │ │ │ ├── internal_model_config.py │ │ │ └── supported_models.py │ │ ├── job_config.py │ │ ├── judge_config.py │ │ ├── judge_config_v2.py │ │ ├── params │ │ │ ├── base_params.py │ │ │ ├── data_params.py │ │ │ ├── evaluation_params.py │ │ │ ├── fsdp_params.py │ │ │ ├── generation_params.py │ │ │ ├── grpo_params.py │ │ │ ├── guided_decoding_params.py │ │ │ ├── model_params.py │ │ │ ├── peft_params.py │ │ │ ├── profiler_params.py │ │ │ ├── remote_params.py │ │ │ ├── synthesis_params.py │ │ │ ├── telemetry_params.py │ │ │ └── training_params.py │ │ ├── synthesis_config.py │ │ └── training_config.py │ ├── constants.py │ ├── datasets │ │ ├── __init__.py │ │ ├── base_dpo_dataset.py │ │ ├── base_grpo_dataset.py │ │ ├── base_iterable_dataset.py │ │ ├── base_map_dataset.py │ │ ├── base_pretraining_dataset.py │ │ ├── base_sft_dataset.py │ │ ├── packed_sft_dataset.py │ │ ├── pretraining_async_text_dataset.py │ │ └── vision_language_dataset.py │ ├── distributed.py │ ├── evaluation │ │ ├── __init__.py │ │ ├── backends │ │ │ ├── alpaca_eval.py │ │ │ └── lm_harness.py │ │ ├── evaluation_result.py │ │ ├── evaluator.py │ │ ├── metrics.py │ │ └── utils │ │ │ ├── platform_prerequisites.py │ │ │ └── save_utils.py │ ├── feature_generators │ │ ├── __init__.py │ │ ├── base_feature_generator.py │ │ └── vision_language_conversation_feature_generator.py │ ├── inference │ │ ├── __init__.py │ │ └── base_inference_engine.py │ ├── launcher │ │ ├── __init__.py │ │ ├── base_cloud.py │ │ └── base_cluster.py │ ├── models │ │ ├── __init__.py │ │ └── base_model.py │ ├── processors │ │ ├── base_image_processor.py │ │ ├── base_processor.py │ │ ├── default_image_processor.py │ │ └── default_processor.py │ ├── registry │ │ ├── __init__.py │ │ └── registry.py │ ├── tokenizers │ │ ├── __init__.py │ │ ├── base_tokenizer.py │ │ ├── special_tokens.py │ │ └── utils.py │ ├── trainers │ │ ├── __init__.py │ │ ├── base_trainer.py │ │ ├── hf_trainer.py │ │ ├── oumi_trainer.py │ │ ├── verl_grpo_trainer.py │ │ └── verl_trainer_config.yaml │ └── types │ │ ├── __init__.py │ │ ├── conversation.py │ │ ├── exceptions.py │ │ └── proto │ │ ├── conversation.proto │ │ └── generated │ │ ├── __init__.py │ │ ├── conversation_pb2.py │ │ └── conversation_pb2.pyi │ ├── datasets │ ├── __init__.py │ ├── chat_templates │ │ ├── chat_ml.jinja │ │ ├── default.jinja │ │ ├── default_gen.jinja │ │ ├── gpt2.jinja │ │ ├── internvl3.jinja │ │ ├── llama3-instruct.jinja │ │ ├── llava.jinja │ │ ├── molmo.jinja │ │ ├── phi3-instruct.jinja │ │ ├── qwen2-vl-instruct.jinja │ │ └── zephyr.jinja │ ├── debug.py │ ├── evaluation │ │ ├── __init__.py │ │ ├── alpaca.py │ │ └── utils.py │ ├── grpo │ │ ├── __init__.py │ │ ├── berry_bench.py │ │ ├── countdown.py │ │ ├── letter_count.py │ │ ├── rewards │ │ │ ├── __init__.py │ │ │ ├── completion_length_rewards.py │ │ │ ├── count_letters_rewards.py │ │ │ └── countdown_rewards.py │ │ └── tldr.py │ ├── mmlu.py │ ├── preference_tuning │ │ ├── __init__.py │ │ └── orpo_dpo_mix.py │ ├── pretraining │ │ ├── __init__.py │ │ ├── c4.py │ │ ├── dolma.py │ │ ├── falcon_refinedweb.py │ │ ├── fineweb_edu.py │ │ ├── pile.py │ │ ├── red_pajama_v1.py │ │ ├── red_pajama_v2.py │ │ ├── slim_pajama.py │ │ ├── starcoder.py │ │ ├── the_stack.py │ │ ├── tiny_stories.py │ │ ├── tiny_textbooks.py │ │ ├── wikipedia.py │ │ ├── wikitext.py │ │ └── youtube_commons.py │ ├── sft │ │ ├── __init__.py │ │ ├── alpaca.py │ │ ├── aya.py │ │ ├── chatqa.py │ │ ├── chatrag_bench.py │ │ ├── coalm.py │ │ ├── dolly.py │ │ ├── huggingface.py │ │ ├── magpie.py │ │ ├── openo1_sft.py │ │ ├── prompt_response.py │ │ ├── sft_jsonlines.py │ │ ├── tulu3_sft_mixture.py │ │ ├── ultrachat.py │ │ └── wildchat.py │ └── vision_language │ │ ├── __init__.py │ │ ├── coco_captions.py │ │ ├── docmatix.py │ │ ├── flickr30k.py │ │ ├── geometry3k.py │ │ ├── huggingface.py │ │ ├── llava_instruct_mix_vsft.py │ │ ├── lmms_lab_multimodal_open_r1.py │ │ ├── mnist_sft.py │ │ ├── pixmo_ask_model_anything.py │ │ ├── pixmo_cap.py │ │ ├── pixmo_cap_qa.py │ │ ├── the_cauldron.py │ │ ├── vision_jsonlines.py │ │ └── vqav2_small.py │ ├── evaluate.py │ ├── evaluate_async.py │ ├── evaluation │ └── registry │ │ ├── __init__.py │ │ ├── berry_bench_task.py │ │ └── count_letters_task.py │ ├── infer.py │ ├── inference │ ├── __init__.py │ ├── anthropic_inference_engine.py │ ├── deepseek_inference_engine.py │ ├── gcp_inference_engine.py │ ├── gemini_inference_engine.py │ ├── lambda_inference_engine.py │ ├── llama_cpp_inference_engine.py │ ├── native_text_inference_engine.py │ ├── openai_inference_engine.py │ ├── parasail_inference_engine.py │ ├── remote_inference_engine.py │ ├── remote_vllm_inference_engine.py │ ├── sambanova_inference_engine.py │ ├── sglang_inference_engine.py │ ├── together_inference_engine.py │ └── vllm_inference_engine.py │ ├── judge.py │ ├── judge_v2.py │ ├── judges │ ├── __init__.py │ ├── base_judge.py │ ├── judge_court.py │ ├── oumi_judge.py │ ├── oumi_v1 │ │ ├── helpful.json │ │ ├── honest.json │ │ ├── safe.json │ │ └── valid.json │ └── test_judge │ │ └── helpful.json │ ├── judges_v2 │ ├── __init__.py │ ├── base_judge.py │ └── simple_judge.py │ ├── launcher │ ├── __init__.py │ ├── clients │ │ ├── local_client.py │ │ ├── polaris_client.py │ │ ├── sky_client.py │ │ └── slurm_client.py │ ├── clouds │ │ ├── __init__.py │ │ ├── frontier_cloud.py │ │ ├── local_cloud.py │ │ ├── polaris_cloud.py │ │ ├── sky_cloud.py │ │ └── slurm_cloud.py │ ├── clusters │ │ ├── frontier_cluster.py │ │ ├── local_cluster.py │ │ ├── polaris_cluster.py │ │ ├── sky_cluster.py │ │ └── slurm_cluster.py │ └── launcher.py │ ├── models │ ├── __init__.py │ ├── cnn_classifier.py │ ├── experimental │ │ └── cambrian │ │ │ ├── __init__.py │ │ │ ├── constants.py │ │ │ ├── mm_utils.py │ │ │ ├── model │ │ │ ├── __init__.py │ │ │ ├── builder.py │ │ │ ├── cambrian_arch.py │ │ │ ├── language_model │ │ │ │ ├── cambrian_llama.py │ │ │ │ ├── cambrian_phi3.py │ │ │ │ └── phi3 │ │ │ │ │ └── __init__.py │ │ │ ├── multimodal_encoder │ │ │ │ ├── __init__.py │ │ │ │ ├── base_encoder.py │ │ │ │ ├── builder.py │ │ │ │ ├── clip_convnext_encoder.py │ │ │ │ ├── clip_encoder.py │ │ │ │ ├── dino_encoder.py │ │ │ │ ├── load.py │ │ │ │ └── siglip_encoder.py │ │ │ ├── multimodal_projector │ │ │ │ ├── builder.py │ │ │ │ └── projectors.py │ │ │ └── vision_sampler.py │ │ │ └── utils.py │ ├── layers │ │ ├── ring_attention.py │ │ ├── zigzag.py │ │ └── zigzag_utils.py │ └── mlp.py │ ├── performance │ ├── mfu.py │ ├── telemetry.py │ └── torch_profiler_utils.py │ ├── train.py │ └── utils │ ├── batching.py │ ├── conversation_utils.py │ ├── debug_utils.py │ ├── device_utils.py │ ├── distributed_utils.py │ ├── git_utils.py │ ├── grpo_utils.py │ ├── hf_utils.py │ ├── http.py │ ├── image_utils.py │ ├── io_utils.py │ ├── logging.py │ ├── math_utils.py │ ├── model_caching.py │ ├── packaging.py │ ├── peft_utils.py │ ├── saver.py │ ├── serialization_utils.py │ ├── str_utils.py │ ├── torch_naming_heuristics.py │ ├── torch_utils.py │ ├── verl_model_merger.py │ └── version_utils.py └── tests ├── __init__.py ├── conftest.py ├── e2e ├── __init__.py ├── deps │ └── test_circular_deps.py ├── sambanova_infer_tutorial.yaml ├── test_eval_e2e.py ├── test_notebooks.py ├── test_sambanova_inference.py ├── test_simple_judge.py └── test_train_e2e.py ├── integration ├── cli │ └── test_judge_e2e.py ├── datasets │ ├── test_preference_tuning_datasets_full_epoch.py │ ├── test_pretraining_datasets_full_epoch.py │ ├── test_sft_datasets_full_epoch.py │ ├── test_sft_datasets_load_datasets.py │ ├── test_sft_vision_datasets_load_datasets.py │ └── test_vision_language_completions_only.py ├── evaluate │ ├── test_evaluate_async.py │ └── test_evaluate_lm_harness.py ├── infer │ ├── __init__.py │ ├── test_infer.py │ └── test_native_text_inference_engine.py ├── models │ └── test_integration_cnn_classifier.py └── train │ ├── test_custom_models.py │ └── test_train.py ├── markers.py ├── scripts ├── e2e_tests_job.yaml ├── launch_tests.sh ├── predownload_for_github_gpu_tests.sh └── runpod_e2e_tests_job.yaml ├── testdata ├── adapter_config.json ├── images │ ├── oumi_logo_dark.png │ ├── oumi_logo_light.png │ └── the_great_wave_off_kanagawa.jpg └── pdfs │ ├── oumi_getting_started_first_1page.pdf │ ├── oumi_getting_started_first_2pages.pdf │ └── oumi_getting_started_full_4pages.pdf └── unit ├── builders ├── test_build_data.py ├── test_callbacks.py ├── test_collators.py ├── test_data_mixtures.py ├── test_lr_schedules.py ├── test_models.py ├── test_oumi_data.py ├── test_processors.py └── test_rewards.py ├── cli ├── test_cli_alias.py ├── test_cli_distributed_run.py ├── test_cli_env.py ├── test_cli_evaluate.py ├── test_cli_fetch.py ├── test_cli_infer.py ├── test_cli_judge.py ├── test_cli_launch.py ├── test_cli_main.py ├── test_cli_speed_regression.py ├── test_cli_train.py └── test_cli_utils.py ├── conftest.py ├── core ├── collators │ ├── test_text_collator_with_padding.py │ ├── test_text_completions_collator_with_padding.py │ ├── test_vision_completions_only.py │ └── test_vision_language_collator_with_padding.py ├── configs │ ├── internal │ │ └── test_supported_models.py │ ├── params │ │ ├── test_base_params.py │ │ ├── test_data_params.py │ │ ├── test_evaluation_params.py │ │ ├── test_model_params.py │ │ ├── test_remote_params.py │ │ └── test_synthesis_params.py │ ├── test_config.py │ ├── test_guided_params.py │ ├── test_parse_configs.py │ ├── test_synthesis_config.py │ └── test_training_config.py ├── datasets │ ├── test_base_map_dataset.py │ ├── test_base_sft_dataset.py │ ├── test_packed_sft_dataset.py │ ├── test_pretraining_dataset.py │ └── test_vision_language_dataset.py ├── evaluation │ ├── test_backend_alpaca_eval.py │ ├── test_backend_lm_harness.py │ ├── test_evaluator.py │ └── test_save_utils.py ├── test_async_utils.py ├── test_distributed.py ├── test_registry.py ├── trainers │ ├── test_oumi_trainer.py │ └── test_verl_grpo_trainer.py └── types │ └── test_conversation.py ├── datasets ├── grpo │ └── rewards │ │ ├── test_completion_length_rewards.py │ │ ├── test_count_letters_rewards.py │ │ └── test_countdown_rewards.py ├── test_chat_templates.py ├── test_datasets_demo_examples.py ├── test_huggingface_vision_dataset.py ├── test_pixmo.py ├── test_pretraining_async_text_dataset.py ├── test_text_jsonlines_dataset.py ├── test_tulu3_sft_mixture.py └── test_vision_language_jsonlines_dataset.py ├── inference ├── test_anthropic_inference_engine.py ├── test_deepseek_inference_engine.py ├── test_gcp_inference_engine.py ├── test_gemini_inference_engine.py ├── test_generation_params.py ├── test_inference_engine_init.py ├── test_lambda_inference_engine.py ├── test_llama_cpp_inference_engine.py ├── test_openai_inference_engine.py ├── test_parasail_inference_engine.py ├── test_remote_inference_engine.py ├── test_sambanova_inference_engine.py ├── test_sglang_inference_engine.py ├── test_together_inference_engine.py ├── test_vllm_inference_engine.py └── test_vllm_inference_engine_quantization.py ├── judges ├── test_base_judge.py └── test_simple_judge.py ├── launcher ├── clients │ ├── data │ │ ├── qstat.txt │ │ ├── sacct.txt │ │ └── sacct_full.txt │ ├── test_local_client.py │ ├── test_polaris_client.py │ ├── test_sky_client.py │ └── test_slurm_client.py ├── clouds │ ├── test_frontier_cloud.py │ ├── test_local_cloud.py │ ├── test_polaris_cloud.py │ ├── test_sky_cloud.py │ └── test_slurm_cloud.py ├── clusters │ ├── test_frontier_cluster.py │ ├── test_local_cluster.py │ ├── test_polaris_cluster.py │ ├── test_sky_cluster.py │ └── test_slurm_cluster.py └── test_launcher.py ├── models └── test_cnn_classifier.py ├── performance ├── test_mfu.py ├── test_telemetry.py └── test_torch_profiler_utils.py ├── test_apache_license_header.py └── utils ├── test_conversation_utils.py ├── test_device_utils.py ├── test_distributed_utils.py ├── test_hf_utils.py ├── test_http.py ├── test_image_utils.py ├── test_io_utils.py ├── test_math_utils.py ├── test_model_caching.py ├── test_packaging.py ├── test_peft_utils.py ├── test_saver.py ├── test_str_utils.py ├── test_torch_naming_heuristics.py ├── test_torch_utils.py └── test_version_utils.py /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Questions 4 | url: https://discord.gg/oumi 5 | about: Questions and community discussions 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Request a new feature for Oumi 3 | title: "[Feature]" 4 | labels: ["Feature", "enhancement", "triage"] 5 | type: "Feature" 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this feature request! 11 | - type: textarea 12 | id: feature-request 13 | attributes: 14 | label: Feature request 15 | description: | 16 | Give a clear and concise description of the feature you'd like to see added to 17 | Oumi. 18 | validations: 19 | required: true 20 | - type: textarea 21 | id: motivation 22 | attributes: 23 | label: Motivation / references 24 | description: | 25 | Please provide the motivation and rationale for the feature request. Link any 26 | relevant GitHub issues, PRs, papers, or other resources so we can better 27 | understand your request. 28 | validations: 29 | required: true 30 | - type: textarea 31 | id: contribution 32 | attributes: 33 | label: Your contribution 34 | description: | 35 | Can you help with this feature request (submitting a PR, etc)? 36 | validations: 37 | required: true 38 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD034": false, 3 | "MD013": false 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "charliermarsh.ruff", 3 | "editor.rulers": [88], 4 | "python.testing.pytestArgs": [ 5 | "tests" 6 | ], 7 | "python.testing.unittestEnabled": false, 8 | "python.testing.pytestEnabled": true, 9 | "python.languageServer": "Pylance", 10 | "[toml]": { 11 | "editor.defaultFormatter": "tamasfe.even-better-toml" 12 | }, 13 | "[yaml]": { 14 | "editor.defaultFormatter": "redhat.vscode-yaml" 15 | }, 16 | "[markdown]": { 17 | "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" 18 | }, 19 | "notebook.formatOnSave.enabled": true 20 | } 21 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: >- 3 | Oumi: an Open, End-to-end Platform for Building Large Foundation Models 4 | message: >- 5 | If you use this software, please cite it using the 6 | metadata from this file. 7 | type: software 8 | authors: 9 | - name: Oumi Community 10 | repository-code: "https://github.com/oumi-ai/oumi" 11 | url: "https://oumi.ai" 12 | keywords: 13 | - machine-learning 14 | - artificial-intelligence 15 | - natural-language-processing 16 | - deep-learning 17 | - foundation-models 18 | - llm 19 | license: Apache-2.0 20 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TARGETPLATFORM=linux/amd64 2 | FROM --platform=${TARGETPLATFORM} pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime 3 | 4 | # ARG for oumi version - defaults to empty string which will install latest 5 | ARG OUMI_VERSION= 6 | 7 | WORKDIR /oumi_workdir 8 | 9 | # Create oumi user 10 | RUN groupadd -r oumi && useradd -r -g oumi -m -s /bin/bash oumi 11 | RUN chown -R oumi:oumi /oumi_workdir 12 | 13 | # Install system dependencies 14 | RUN apt-get update && \ 15 | apt-get install -y --no-install-recommends \ 16 | git \ 17 | vim \ 18 | htop \ 19 | tree \ 20 | screen \ 21 | curl \ 22 | ca-certificates && \ 23 | apt-get clean && \ 24 | rm -rf /var/lib/apt/lists/* 25 | 26 | 27 | # Install Oumi dependencies 28 | # If OUMI_VERSION is provided, install that specific version, otherwise install latest 29 | RUN pip install --no-cache-dir uv && \ 30 | if [ -z "$OUMI_VERSION" ]; then \ 31 | uv pip install --system --no-cache-dir --prerelease=allow "oumi[gpu]"; \ 32 | else \ 33 | uv pip install --system --no-cache-dir --prerelease=allow "oumi[gpu]==$OUMI_VERSION"; \ 34 | fi 35 | 36 | # Switch to oumi user 37 | USER oumi 38 | 39 | # Copy application code 40 | COPY . /oumi_workdir 41 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | The Oumi team and community take security bugs in Oumi seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. 6 | 7 | To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/oumi-ai/oumi/security/advisories/new) tab. 8 | 9 | The Oumi team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. 10 | 11 | Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through [PyPi](https://pypi.org/security/). 12 | 13 | ## Acknowledgements 14 | 15 | We deeply appreciate security researchers who take the time to report vulnerabilities to us. We will acknowledge your contribution in our security advisory and release notes (unless you prefer to remain anonymous). 16 | 17 | ## Security Updates 18 | 19 | Security updates and advisories will be published through GitHub Security Advisories. 20 | -------------------------------------------------------------------------------- /configs/README.md: -------------------------------------------------------------------------------- 1 | # Configs 2 | 3 | This directory contains YAML configs used for training, evaluation, and inference with Oumi, in addition to launching remote jobs for those tasks. We use [Omegaconf](https://omegaconf.readthedocs.io/en/) to load these config files into our [config classes](../src/oumi/core/configs). 4 | 5 | As a convention, we name these files according to their corresponding class. For example: 6 | 7 | - `*train.yaml`: [TrainingConfig](../src/oumi/core/configs/training_config.py) 8 | - `*eval.yaml`: [EvaluationConfig](../src/oumi/core/configs/evaluation_config.py) 9 | - `*infer.yaml`: [InferenceConfig](../src/oumi/core/configs/inference_config.py) 10 | - `*gcp_job.yaml`: [JobConfig](../src/oumi/core/configs/job_config.py), GCP cloud 11 | - `*polaris_job.yaml`: [JobConfig](../src/oumi/core/configs/job_config.py), Polaris cloud 12 | 13 | ## Structure 14 | 15 | We use the following sub-directories to organize our configs: 16 | 17 | - `recipes/`: This directory contains configs for training, evaluation, and inference of common model families. This is a great starting point for most users. 18 | - `projects/`: Configs for fully replicating the training of specific models (ex. Aya). 19 | - `examples/`: Configs for specific use cases. This is less structured than `configs/recipes` and `configs/projects`, and includes more experimental jobs. 20 | -------------------------------------------------------------------------------- /configs/apis/anthropic/eval_claude_3_5_sonnet.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "claude-3-5-sonnet-latest" 3 | 4 | inference_engine: ANTHROPIC 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/anthropic/eval_claude_3_7_sonnet.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "claude-3-7-sonnet-latest" 3 | 4 | inference_engine: ANTHROPIC 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/anthropic/infer_claude_3_5_sonnet.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "claude-3-5-sonnet-latest" 3 | 4 | engine: ANTHROPIC 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/anthropic/infer_claude_3_7_sonnet.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "claude-3-7-sonnet-latest" 3 | 4 | engine: ANTHROPIC 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/gemini/eval_gemini_1_5_pro.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "gemini-1.5-pro" 3 | 4 | inference_engine: GOOGLE_GEMINI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/gemini/infer_gemini_1_5_pro.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "gemini-1.5-pro" 3 | 4 | engine: GOOGLE_GEMINI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/openai/eval_gpt_4o.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "gpt-4o" 3 | 4 | inference_engine: OPENAI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/openai/eval_gpt_o1_preview.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "o1-preview" 3 | 4 | inference_engine: OPENAI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/openai/infer_gpt_4o.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "gpt-4o" 3 | 4 | engine: OPENAI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/openai/infer_gpt_o1_preview.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "o1-preview" 3 | 4 | engine: OPENAI 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/vertex/eval_llama_3_1_405b.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "meta/llama-3.1-405b-instruct-maas" 3 | 4 | inference_engine: GOOGLE_VERTEX 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/vertex/eval_llama_3_3_70b.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "meta/llama-3.3-70b-instruct-maas" 3 | 4 | inference_engine: GOOGLE_VERTEX 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 0.0 9 | 10 | tasks: 11 | - evaluation_backend: custom 12 | task_name: berry_bench 13 | -------------------------------------------------------------------------------- /configs/apis/vertex/infer_llama_3_1_405b.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "meta/llama-3.1-405b-instruct-maas" 3 | 4 | engine: GOOGLE_VERTEX 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/apis/vertex/infer_llama_3_3_70b.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "meta/llama-3.3-70b-instruct-maas" 3 | 4 | engine: GOOGLE_VERTEX 5 | 6 | generation: 7 | max_new_tokens: 8192 8 | temperature: 1.0 9 | -------------------------------------------------------------------------------- /configs/examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Configs for specific use cases. This is less structured than `configs/recipes` and `configs/projects`, and includes more experimental jobs. 4 | -------------------------------------------------------------------------------- /configs/examples/berry_bench/evaluation/eval.yaml: -------------------------------------------------------------------------------- 1 | # Config to evaluate an LLM on the Oumi BerryBench dataset. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c oumi://configs/examples/berry_bench/evaluation/eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-3B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | # This isn't used by vLLM, but is used for the NATIVE inference engine. 27 | batch_size: 4 28 | 29 | tasks: 30 | - evaluation_backend: custom 31 | task_name: berry_bench 32 | num_samples: 1000 33 | 34 | inference_engine: VLLM # Can also use NATIVE if not running on GPUs 35 | 36 | output_dir: "output/berry_bench/evaluation" 37 | -------------------------------------------------------------------------------- /configs/examples/bulk_inference/README.md: -------------------------------------------------------------------------------- 1 | # Bulk Inference 2 | 3 | Configs for running bulk inference on a large dataset in GCP. This script will grab all files from the input bucket, run inference on them, and save the results to an output bucket, using filenames mirroring those in the input bucket. 4 | 5 | NOTES: 6 | 7 | 1. The input files are required to be JSONL. 8 | 2. The script will skip inference on input files which already have corresponding output files. This prevents repetitive work if running the script multiple times. 9 | 3. If you use multiple GPUs, the script will distribute the model across them using parallel tensors. 10 | 11 | ## How to run 12 | 13 | 1. Update the input and output GCS buckets to your desired locations. 14 | 2. Update `INFERENCE_CONFIG` to your desired inference config. We use Llama 3.1 8B by default. 15 | 3. Run `oumi launch up -c configs/examples/bulk_inference/gcp_job.yaml --cluster oumi-bulk-inference` 16 | -------------------------------------------------------------------------------- /configs/examples/fineweb_ablation_pretraining/README.md: -------------------------------------------------------------------------------- 1 | # HuggingFace FineWeb Ablation Model 2 | 3 | Configs for pre-training the FineWeb ablation model, a Llama 2B model. The primary focus 4 | is improving MFU. See https://huggingface.co/HuggingFaceFW/ablation-model-fineweb-v1. 5 | 6 | ## Model Info 7 | 8 | | Attribute | Value | 9 | |--|--| 10 | | Vocab size | 50,272 | 11 | | Hidden size | 2048 | 12 | | MLP intermediate size | 8192 | 13 | | Num layers | 24 | 14 | | Num attention heads | 32 | 15 | | Num KV heads | 32 | 16 | | Weight tying | True | 17 | 18 | ## Launch Command 19 | 20 | Currently, the best training method is DDP: 21 | ```shell 22 | oumi launch up -c configs/examples/fineweb_ablation_pretraining/ddp/gcp_job.yaml --cluster fineweb 23 | ``` 24 | 25 | For FSDP training: 26 | ```shell 27 | oumi launch up -c configs/examples/fineweb_ablation_pretraining/fsdp/gcp_job.yaml --cluster fineweb-fsdp 28 | ``` 29 | -------------------------------------------------------------------------------- /configs/examples/letter_counting/evaluation/eval.yaml: -------------------------------------------------------------------------------- 1 | # Config to eval an LLM's ability to count letters in words. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c oumi://configs/examples/letter_counting/evaluation/eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-3B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | # This isn't used by vLLM, but is used for the NATIVE inference engine. 27 | batch_size: 4 28 | 29 | tasks: 30 | - evaluation_backend: custom 31 | task_name: count_letters 32 | num_samples: 1000 33 | 34 | inference_engine: VLLM # Can also use NATIVE if not running on GPUs 35 | 36 | output_dir: "output/letter_counting/evaluation" 37 | -------------------------------------------------------------------------------- /configs/examples/misc/README.md: -------------------------------------------------------------------------------- 1 | # Misc 2 | 3 | Miscellaneous configs. 4 | -------------------------------------------------------------------------------- /configs/examples/misc/hello_world_gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # GCP Hello World job config. 2 | # 3 | # Usage: 4 | # oumi launch up -c configs/examples/misc/hello_world_gcp_job.yaml --cluster hello-world-gcp 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 8 | # - Config class: oumi.core.configs.JobConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 10 | # - Other job configs: configs/**/*job.yaml 11 | 12 | name: hello-world 13 | resources: 14 | cloud: gcp 15 | accelerators: "A100:1" 16 | 17 | working_dir: . 18 | 19 | envs: 20 | TEST_ENV_VARIABLE: '"Hello, World!"' 21 | 22 | # For GCP, setup is only run once at cluster creation. 23 | setup: | 24 | echo "Running setup..." 25 | 26 | run: | 27 | set -e # Exit if any command failed. 28 | 29 | echo "$TEST_ENV_VARIABLE" 30 | -------------------------------------------------------------------------------- /configs/examples/misc/sky_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Run some checks, export "OUMI_*" env vars, and print cluster info. 3 | 4 | echo "SkyPilot task ID: ${SKYPILOT_TASK_ID}" 5 | echo "SkyPilot cluster: ${SKYPILOT_CLUSTER_INFO}" 6 | echo "Current dir: $(pwd)" 7 | echo "SkyPilot node IPs: ${SKYPILOT_NODE_IPS}" 8 | echo "" 9 | echo "Running on host: $(hostname)" 10 | echo "SkyPilot node rank: ${SKYPILOT_NODE_RANK}" 11 | export OUMI_NUM_NODES=$(echo "$SKYPILOT_NODE_IPS" | wc -l) 12 | export OUMI_TOTAL_NUM_GPUS=$((${OUMI_NUM_NODES} * ${SKYPILOT_NUM_GPUS_PER_NODE})) 13 | export OUMI_MASTER_ADDR=$(echo "$SKYPILOT_NODE_IPS" | head -n1) 14 | echo "Master address: ${OUMI_MASTER_ADDR}" 15 | echo "Number of nodes: ${OUMI_NUM_NODES}" 16 | echo "Number of GPUs per node: ${SKYPILOT_NUM_GPUS_PER_NODE}" 17 | 18 | if [[ -z "${OUMI_MASTER_ADDR}" ]]; then 19 | echo "Master address is empty!" 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /configs/projects/README.md: -------------------------------------------------------------------------------- 1 | # Projects 2 | 3 | Configs for fully replicating the training of specific models. 4 | -------------------------------------------------------------------------------- /configs/projects/aya/README.md: -------------------------------------------------------------------------------- 1 | # Aya 2 | 3 | Configs for training Llama 3.1 8B Instruct with the Cohere Aya dataset. See https://huggingface.co/datasets/CohereForAI/aya_dataset 4 | -------------------------------------------------------------------------------- /configs/projects/chatqa/README.md: -------------------------------------------------------------------------------- 1 | # ChatQA 2 | 3 | Configs for reproducing results from the Nvidia ChatQA paper. 4 | 5 | ## References 6 | 7 | - [ChatQA Project Website](https://chatqa-project.github.io) 8 | - [ChatQA Paper](https://arxiv.org/abs/2401.10225) 9 | -------------------------------------------------------------------------------- /configs/projects/coalm/70b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for CoALM-70B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c ./70b_infer.yaml 5 | # 6 | 7 | model: 8 | model_name: "uiuc-convai/CoALM-70B" 9 | adapter_model: null # Update for LoRA-tuned models. 10 | model_max_length: 2048 # Update based on your hardware constraints 11 | torch_dtype_str: "bfloat16" 12 | attn_implementation: "sdpa" 13 | load_pretrained_weights: True 14 | trust_remote_code: True 15 | 16 | generation: 17 | max_new_tokens: 2048 18 | 19 | engine: NATIVE 20 | -------------------------------------------------------------------------------- /configs/projects/coalm/8b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for CoALM-8B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c ./8b_infer.yaml 5 | # 6 | 7 | model: 8 | model_name: "uiuc-convai/CoALM-8B" 9 | adapter_model: null # Update for LoRA-tuned models. 10 | model_max_length: 2048 # Update based on your hardware constraints 11 | torch_dtype_str: "bfloat16" 12 | attn_implementation: "sdpa" 13 | load_pretrained_weights: True 14 | trust_remote_code: True 15 | 16 | generation: 17 | max_new_tokens: 2048 18 | 19 | engine: NATIVE 20 | -------------------------------------------------------------------------------- /configs/projects/coalm/images/dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/configs/projects/coalm/images/dataset.png -------------------------------------------------------------------------------- /configs/projects/coalm/images/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/configs/projects/coalm/images/results.png -------------------------------------------------------------------------------- /configs/projects/wc50m/README.md: -------------------------------------------------------------------------------- 1 | # WildChat-50M Reproduction 2 | 3 | This directory contains the training configuration to partially reproduce the results from the [WildChat-50M paper](https://arxiv.org/abs/2501.18511). 4 | 5 | ## Details 6 | 7 | Training was done using the Oumi platform; following the paper, evaluation was done using [Evalchemy](https://github.com/mlfoundations/evalchemy/). 8 | 9 | ## Model 10 | 11 | The checkpoint for the fully trained model, as well as the evaluation results and details about the training run, can be found on [HuggingFace](https://huggingface.co/penfever/oumi-l8b-ultrachat). 12 | -------------------------------------------------------------------------------- /configs/projects/wc50m/configs/base_ultrachat.yaml: -------------------------------------------------------------------------------- 1 | # Class: oumi.core.configs.TrainingConfig 2 | # https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 3 | # SFT Config for WC50M reproduction of UltraChat baseline. 4 | 5 | model: 6 | model_name: "meta-llama/Meta-Llama-3.1-8B" 7 | model_max_length: 8192 8 | torch_dtype_str: "bfloat16" 9 | attn_implementation: "flash_attention_2" 10 | load_pretrained_weights: True 11 | trust_remote_code: True 12 | chat_template: "llama3-instruct" 13 | enable_liger_kernel: True 14 | 15 | data: 16 | train: 17 | datasets: 18 | - dataset_name: "HuggingFaceH4/ultrachat_200k" 19 | split: "train_sft" 20 | trust_remote_code: True 21 | 22 | training: 23 | trainer_type: "TRL_SFT" 24 | save_steps: 800 25 | num_train_epochs: 1 26 | per_device_train_batch_size: 1 27 | gradient_accumulation_steps: 8 28 | 29 | enable_gradient_checkpointing: True 30 | gradient_checkpointing_kwargs: 31 | use_reentrant: False 32 | ddp_find_unused_parameters: False 33 | optimizer: "paged_adamw_8bit" 34 | learning_rate: 2.0e-05 35 | compile: False 36 | 37 | dataloader_num_workers: "auto" 38 | dataloader_prefetch_factor: 32 39 | 40 | logging_steps: 100 41 | log_model_summary: False 42 | empty_device_cache_steps: 50 43 | output_dir: "output/llama8b-ultrachat" 44 | include_performance_metrics: True 45 | enable_wandb: True 46 | 47 | fsdp: 48 | enable_fsdp: False 49 | -------------------------------------------------------------------------------- /configs/projects/wc50m/results/baseline.csv: -------------------------------------------------------------------------------- 1 | Metric,Value 2 | MTBench,5.0187 3 | Alpaca Eval (LC),4.126 4 | BBH,0.4845 5 | GPQA,0.3204 6 | MATH,0.0458 7 | MUSR,0.3917 8 | "IFEval (Prompt Level, Strict)",0.2643 9 | "IFEval (Instance Level, Loose)",0.4281 10 | MMLU Pro,0.3198 11 | MixEval,0.63 12 | MBPP,0.006 13 | -------------------------------------------------------------------------------- /configs/projects/wc50m/results/oumi.csv: -------------------------------------------------------------------------------- 1 | Metric,Value 2 | MTBench,5.2313 3 | Alpaca Eval (LC),1.6157 4 | BBH,0.4861 5 | GPQA,0.2903 6 | MATH,0.0552 7 | MUSR,0.4116 8 | "IFEval (Prompt Level, Strict)",0.1978 9 | "IFEval (Instance Level, Loose)",0.3501 10 | MMLU Pro,0.3118 11 | MixEval,0.5935 12 | MBPP,0.372 13 | -------------------------------------------------------------------------------- /configs/recipes/README.md: -------------------------------------------------------------------------------- 1 | # Recipes 2 | 3 | This directory contains configs for training, evaluation, and inference of common model families. This is a great starting point for most users. 4 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/README.md: -------------------------------------------------------------------------------- 1 | # Deepseek 2 | 3 | Configs for Deepseek R1 models, including distilled models. 4 | 5 | Models in this directory include: 6 | 7 | - `deepseek-ai/DeepSeek-R1-Distill-Llama-8B` 8 | - `deepseek-ai/DeepSeek-R1-Distill-Llama-70B` 9 | - `deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B` 10 | - `deepseek-ai/DeepSeek-R1-Distill-Qwen-32B` 11 | 12 | Model family on HuggingFace Hub: https://huggingface.co/collections/deepseek-ai/deepseek-r1-678e1e131c0169c0bc89728d 13 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/evaluation/distill_llama_70b/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Deepseek R1 Distill Llama 3.3 70B. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c configs/recipes/deepseek_r1/evaluation/distill_llama_70b/eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B" 17 | model_max_length: 131072 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 3 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/evaluation/distill_llama_8b/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Deepseek R1 Distill Llama 3.1 8B. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c configs/recipes/deepseek_r1/evaluation/distill_llama_8b/eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Llama-8B" 17 | model_max_length: 131072 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 4 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/evaluation/distill_qwen_1_5b/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Deepseek R1 Distill Qwen2.5 1.5B. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c configs/recipes/deepseek_r1/evaluation/distill_qwen_1_5b/eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B" 17 | model_max_length: 131072 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 4 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/evaluation/distill_qwen_32b/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Deepseek R1 Distill Qwen2.5 32B. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c configs/recipes/deepseek_r1/evaluation/distill_qwen_32b/eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" 17 | model_max_length: 131072 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 4 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/inference/671b_together_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Deepseek R1 671B. 2 | # 3 | # Requirements: 4 | # - Set the `TOGETHER_API_KEY` env var to your Together API key. 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/deepseek_r1/inference/671b_together_infer.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 11 | # - Config class: oumi.core.configs.InferenceConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 13 | # - Other inference configs: configs/**/inference/ 14 | 15 | model: 16 | model_name: "deepseek-ai/DeepSeek-R1" 17 | 18 | generation: 19 | max_new_tokens: 2048 20 | 21 | engine: TOGETHER 22 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/inference/distill_llama_70b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Deepseek R1 Distill Llama 3.3 70B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/deepseek_r1/inference/distill_llama_70b_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/inference/distill_llama_8b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Deepseek R1 Distill Llama 3.1 8B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/deepseek_r1/inference/distill_llama_8b_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Llama-8B" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/inference/distill_qwen_1_5b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Deepseek R1 Distill Qwen2.5 1.5B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/deepseek_r1/inference/distill_qwen_1_5b_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | batch_size: 4 22 | 23 | engine: NATIVE 24 | -------------------------------------------------------------------------------- /configs/recipes/deepseek_r1/inference/distill_qwen_32b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Deepseek R1 Distill Qwen2.5 32B. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/deepseek_r1/inference/distill_qwen_32b_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/falcon_e/dpo/falcon_e_1b_instruct/dpo.yaml: -------------------------------------------------------------------------------- 1 | # Falcon-E DPO train config. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/falcon_e/dpo/falcon_e_1b_instruct/dpo.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "tiiuae/Falcon-E-1B-Instruct" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | enable_liger_kernel: False 19 | tokenizer_kwargs: 20 | pad_token: "<|pad|>" 21 | model_revision: "prequantized" 22 | 23 | data: 24 | train: 25 | datasets: 26 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 27 | 28 | training: 29 | optimizer: "adamw_torch" 30 | use_peft: false 31 | output_dir: "output/falcon-e-1b.dpo" 32 | trainer_type: "TRL_DPO" 33 | per_device_train_batch_size: 2 34 | -------------------------------------------------------------------------------- /configs/recipes/falcon_e/evaluation/falcon_e_1b/eval.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "output/falcon_e_1b.fft/checkpoint-800-quantized" 3 | torch_dtype_str: "bfloat16" 4 | 5 | inference_engine: NATIVE 6 | 7 | tasks: 8 | - evaluation_backend: lm_harness 9 | task_name: mmlu_college_computer_science 10 | 11 | output_dir: "output/falcon_e_1b.fft/evaluation" 12 | generation: 13 | batch_size: null # This will let LM HARNESS find the maximum possible batch size. 14 | -------------------------------------------------------------------------------- /configs/recipes/falcon_e/evaluation/falcon_e_1b_instruct/eval.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "output/falcon_e_1b_instruct.fft/checkpoint-800-quantized" 3 | torch_dtype_str: "bfloat16" 4 | 5 | inference_engine: NATIVE 6 | 7 | tasks: 8 | - evaluation_backend: lm_harness 9 | task_name: mmlu_college_computer_science 10 | 11 | output_dir: "output/falcon_e_1b_instruct.fft/evaluation" 12 | generation: 13 | batch_size: null # This will let LM HARNESS find the maximum possible batch size. 14 | -------------------------------------------------------------------------------- /configs/recipes/falcon_e/evaluation/falcon_e_3b/eval.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "output/falcon_e_3b.fft/checkpoint-800-quantized" 3 | torch_dtype_str: "bfloat16" 4 | 5 | inference_engine: NATIVE 6 | 7 | tasks: 8 | - evaluation_backend: lm_harness 9 | task_name: mmlu_college_computer_science 10 | 11 | output_dir: "output/falcon_e_3b.fft/evaluation" 12 | generation: 13 | batch_size: null # This will let LM HARNESS find the maximum possible batch size. 14 | -------------------------------------------------------------------------------- /configs/recipes/falcon_e/evaluation/falcon_e_3b_instruct/eval.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "output/falcon_e_3b_instruct.fft/checkpoint-800-quantized" 3 | torch_dtype_str: "bfloat16" 4 | 5 | inference_engine: NATIVE 6 | 7 | tasks: 8 | - evaluation_backend: lm_harness 9 | task_name: mmlu_college_computer_science 10 | 11 | output_dir: "output/falcon_e_3b_instruct.fft/evaluation" 12 | generation: 13 | batch_size: null # This will let LM HARNESS find the maximum possible batch size. 14 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/dpo/falcon_h1_0_5b/qlora_dpo.yaml: -------------------------------------------------------------------------------- 1 | # Falcon DPO + QLoRA train config. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/falcon_h1/dpo/falcon_h1_0_5b/qlora_dpo.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "tiiuae/Falcon-H1-0.5B-Instruct" 14 | model_max_length: 16385 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | shard_for_eval: True 19 | 20 | data: 21 | train: 22 | datasets: 23 | - dataset_name: "HumanLLMs/Human-Like-DPO-Dataset" 24 | 25 | training: 26 | optimizer: "adamw_torch" 27 | use_peft: true 28 | output_dir: "output/falcon-e-1b.dpo" 29 | trainer_type: "TRL_DPO" 30 | per_device_train_batch_size: 2 31 | 32 | peft: 33 | q_lora: True 34 | bnb_4bit_quant_type: "nf4" 35 | bnb_4bit_quant_storage: "bfloat16" 36 | bnb_4bit_compute_dtype: "bfloat16" 37 | llm_int8_skip_modules: 38 | - "out_proj" 39 | lora_r: 16 40 | lora_alpha: 32 41 | lora_dropout: 0.0 42 | lora_target_modules: 43 | - "q_proj" 44 | - "k_proj" 45 | - "v_proj" 46 | - "o_proj" 47 | - "gate_proj" 48 | - "up_proj" 49 | - "down_proj" 50 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/0_5b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-0.5B-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/0_5b_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-0.5B-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/1_5b_deep_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-1.5B-Deep-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/1_5b_deep_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-1.5B-Deep-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/1_5b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-1.5B-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/1_5b_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-1.5B-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/34b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-34B-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/34b_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-34B-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/3b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-3B-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/3b_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-3B-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/falcon_h1/inference/7b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for tiiuae/Falcon-H1-7B-Instruct. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # Usage: 6 | # oumi infer -i -c oumi://configs/recipes/falcon_h1/inference/7b_infer.yaml 7 | # 8 | # See Also: 9 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 10 | # - Config class: oumi.core.configs.InferenceConfig 11 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 12 | # - Other inference configs: configs/**/inference/ 13 | 14 | model: 15 | model_name: "tiiuae/Falcon-H1-7B-Instruct" 16 | model_max_length: 2048 17 | torch_dtype_str: "bfloat16" 18 | attn_implementation: "sdpa" 19 | trust_remote_code: True 20 | 21 | generation: 22 | max_new_tokens: 2048 23 | temperature: 0.1 24 | top_p: 0.95 25 | min_p: 0.0 26 | use_sampling: True 27 | # If repetitions are still present, consider increasing this value (up to 2.0). 28 | presence_penalty: 0.0 29 | 30 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 31 | -------------------------------------------------------------------------------- /configs/recipes/gpt2/README.md: -------------------------------------------------------------------------------- 1 | # GPT-2 2 | 3 | Configs for OpenAI's Generative Pre-trained Transformer 2, 124M parameters. 4 | -------------------------------------------------------------------------------- /configs/recipes/gpt2/evaluation/async_eval.yaml: -------------------------------------------------------------------------------- 1 | # Async eval config for GPT2. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # python -m oumi.evaluate_async -c configs/recipes/gpt2/evaluation/async_eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.AsyncEvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/async_evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | evaluation: 16 | output_dir: "output/gpt2.pt" # NOTE: Update to your output directory. 17 | 18 | model: 19 | model_name: "gpt2" # 124M params 20 | # For local testing. 21 | # model_max_length: 128 22 | model_max_length: 1024 23 | torch_dtype_str: "bfloat16" 24 | attn_implementation: "sdpa" 25 | compile: True 26 | trust_remote_code: True 27 | 28 | tasks: 29 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 30 | - evaluation_backend: lm_harness 31 | task_name: mmlu_college_computer_science 32 | eval_kwargs: 33 | num_fewshot: 5 34 | 35 | generation: 36 | batch_size: 32 37 | 38 | enable_wandb: True 39 | 40 | checkpoints_dir: "" # NOTE: Update to directory containing checkpoints. 41 | polling_interval: 5 42 | -------------------------------------------------------------------------------- /configs/recipes/gpt2/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # GPT2 inference config. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/gpt2/inference/infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "openai-community/gpt2" 14 | chat_template: "gpt2" 15 | tokenizer_pad_token: "<|endoftext|>" 16 | trust_remote_code: True 17 | 18 | generation: 19 | max_new_tokens: 32 20 | batch_size: 1 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/llama3_1/evaluation/70b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 3.1 70B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.1: https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama3_1/evaluation/70b_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.1-70B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | shard_for_eval: True 25 | 26 | generation: 27 | batch_size: 3 # 4 will OOM on a Polaris node 28 | 29 | tasks: 30 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 31 | - evaluation_backend: lm_harness 32 | task_name: mmlu_college_computer_science 33 | eval_kwargs: 34 | num_fewshot: 5 35 | 36 | enable_wandb: True 37 | -------------------------------------------------------------------------------- /configs/recipes/llama3_1/evaluation/8b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 3.1 8B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.1: https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama3_1/evaluation/8b_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.1-8B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | shard_for_eval: True 25 | 26 | generation: 27 | batch_size: 4 28 | 29 | tasks: 30 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 31 | - evaluation_backend: lm_harness 32 | task_name: mmlu_college_computer_science 33 | eval_kwargs: 34 | num_fewshot: 5 35 | 36 | enable_wandb: True 37 | -------------------------------------------------------------------------------- /configs/recipes/llama3_1/inference/70b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 70B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.1: https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama3_1/inference/70b_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-3.1-70B-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/llama3_1/inference/8b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 8B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.1: https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama3_1/inference/8b_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-3.1-8B-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/llama3_1/sft/8b_full/accelerate.yaml: -------------------------------------------------------------------------------- 1 | compute_environment: LOCAL_MACHINE 2 | debug: false 3 | distributed_type: FSDP 4 | downcast_bf16: 'no' 5 | enable_cpu_affinity: false 6 | fsdp_config: 7 | fsdp_activation_checkpointing: true 8 | fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP 9 | fsdp_backward_prefetch: BACKWARD_PRE 10 | fsdp_cpu_ram_efficient_loading: true 11 | fsdp_forward_prefetch: true 12 | fsdp_limit_all_gathers: true 13 | fsdp_offload_params: false 14 | fsdp_sharding_strategy: HYBRID_SHARD 15 | fsdp_state_dict_type: FULL_STATE_DICT 16 | fsdp_sync_module_states: true 17 | fsdp_transformer_layer_cls_to_wrap: LlamaDecoderLayer 18 | fsdp_use_orig_params: true 19 | machine_rank: 0 20 | main_training_function: main 21 | num_machines: 1 22 | num_processes: 4 23 | rdzv_backend: static 24 | same_network: true 25 | tpu_env: [] 26 | tpu_use_cluster: false 27 | tpu_use_sudo: false 28 | use_cpu: false 29 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/README.md: -------------------------------------------------------------------------------- 1 | # Llama 3.2 2 | 3 | Configs for Meta's Llama 3.2 model family. This includes the 1B and 3B text-to-text models. 4 | 5 | ## 1B 6 | 7 | ### Model Info 8 | 9 | | Attribute | Value | 10 | |--|--| 11 | | Vocab size | 128,256 | 12 | | Hidden size | 2048 | 13 | | MLP intermediate size | 8192 | 14 | | Num layers | 16 | 15 | | Num attention heads | 32 | 16 | | Num KV heads | 8 | 17 | | Weight tying | True | 18 | | Model max length | 131,072 (initially trained with 8192) | 19 | 20 | ### Launch Command 21 | 22 | Example command for 1B full fine-tuning on your local machine: 23 | ```shell 24 | oumi train -c configs/recipes/llama3_2/sft/1b_full/train.yaml 25 | ``` 26 | 27 | ## 3B 28 | 29 | ### Model Info 30 | 31 | | Attribute | Value | 32 | |--|--| 33 | | Vocab size | 128,256 | 34 | | Hidden size | 3072 | 35 | | MLP intermediate size | 8192 | 36 | | Num layers | 28 | 37 | | Num attention heads | 24 | 38 | | Num KV heads | 8 | 39 | | Weight tying | True | 40 | | Model max length | 131,072 (initially trained with 8192) | 41 | 42 | ### Launch Command 43 | 44 | Example command for 3B full fine-tuning on GCP: 45 | ```shell 46 | oumi launch up -c configs/recipes/llama3_2/sft/3b_full/gcp_job.yaml --cluster llama3-2 47 | ``` 48 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/dpo/1b_qlora_dpo.yaml: -------------------------------------------------------------------------------- 1 | # Llama 3.2 (1B) DPO train config. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/llama3_2/dpo/1b_qlora_dpo.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/evaluation/, configs/**/inference/, configs/**/sft/ 11 | 12 | model: 13 | model_name: "meta-llama/Llama-3.2-1B-Instruct" 14 | model_max_length: 131072 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | load_pretrained_weights: True 18 | trust_remote_code: True 19 | 20 | data: 21 | train: 22 | datasets: 23 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 24 | 25 | training: 26 | optimizer: "adamw_torch" 27 | use_peft: true 28 | output_dir: "output/llama3_2_1b.dpo" 29 | trainer_type: "TRL_DPO" 30 | per_device_train_batch_size: 2 31 | 32 | peft: 33 | q_lora: True 34 | bnb_4bit_quant_type: "nf4" 35 | bnb_4bit_quant_storage: "bfloat16" 36 | bnb_4bit_compute_dtype: "bfloat16" 37 | lora_r: 16 38 | lora_alpha: 32 39 | lora_dropout: 0.0 40 | lora_target_modules: 41 | - "q_proj" 42 | - "k_proj" 43 | - "v_proj" 44 | - "o_proj" 45 | - "gate_proj" 46 | - "up_proj" 47 | - "down_proj" 48 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/evaluation/1b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 3.2 1B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama3_2/evaluation/1b_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-1B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | batch_size: 4 27 | 28 | tasks: 29 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 30 | - evaluation_backend: lm_harness 31 | task_name: mmlu_college_computer_science 32 | eval_kwargs: 33 | num_fewshot: 5 34 | 35 | enable_wandb: True 36 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/evaluation/3b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 3.2 3B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama3_2/evaluation/3b_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-3B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | batch_size: 4 27 | 28 | tasks: 29 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 30 | - evaluation_backend: lm_harness 31 | task_name: mmlu_college_computer_science 32 | eval_kwargs: 33 | num_fewshot: 5 34 | 35 | enable_wandb: True 36 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/inference/1b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 1B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama3_2/inference/1b_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-3.2-1B-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | batch_size: 4 27 | 28 | engine: NATIVE 29 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/inference/1b_vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 1B Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct 7 | # 8 | # Usage: 9 | # oumi infer -i -c configs/recipes/llama3_2/inference/1b_vllm_infer.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-1B-Instruct" 19 | model_max_length: 2048 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | max_new_tokens: 2048 27 | batch_size: 4 28 | 29 | engine: VLLM 30 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/inference/3b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 3B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama3_2/inference/3b_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-3.2-3B-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | batch_size: 4 27 | 28 | engine: NATIVE 29 | -------------------------------------------------------------------------------- /configs/recipes/llama3_2/inference/3b_vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 3B Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct 7 | # 8 | # Usage: 9 | # oumi infer -i -c configs/recipes/llama3_2/inference/3b_vllm_infer.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-3B-Instruct" 19 | model_max_length: 2048 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | max_new_tokens: 2048 27 | batch_size: 4 28 | 29 | engine: VLLM 30 | -------------------------------------------------------------------------------- /configs/recipes/llama3_3/README.md: -------------------------------------------------------------------------------- 1 | # Llama 3.3 2 | 3 | Configs for Meta's Llama 3.3 model family. This includes the 70B text-to-text models. 4 | 5 | ## 70B 6 | 7 | ### Model Info 8 | 9 | | Attribute | Value | 10 | |--|--| 11 | | Vocab size | 128,256 | 12 | | Hidden size | 8192 | 13 | | MLP intermediate size | 28,672 | 14 | | Num layers | 80 | 15 | | Num attention heads | 64 | 16 | | Num KV heads | 8 | 17 | | Weight tying | False | 18 | | Model max length | 131,072 (initially trained with 8192) | 19 | 20 | ### Launch Command 21 | 22 | Example command for 70B full fine-tuning on GCP: 23 | ```shell 24 | oumi launch up -c configs/recipes/llama3_3/sft/70b_full/gcp_job.yaml --cluster llama3-3 25 | ``` 26 | 27 | Example command for 70B LoRA fine-tuning on GCP: 28 | ```shell 29 | oumi launch up -c configs/recipes/llama3_3/sft/70b_lora/gcp_job.yaml --cluster llama3-3 30 | ``` 31 | 32 | Example command for 70B quantized LoRA fine-tuning on GCP: 33 | ```shell 34 | oumi launch up -c configs/recipes/llama3_3/sft/70b_qlora/gcp_job.yaml --cluster llama3-3 35 | ``` 36 | -------------------------------------------------------------------------------- /configs/recipes/llama3_3/evaluation/70b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 3.3 70B Instruct. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.3: https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama3_3/evaluation/70b_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.3-70B-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | shard_for_eval: True 25 | 26 | generation: 27 | batch_size: 3 28 | 29 | tasks: 30 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 31 | - evaluation_backend: lm_harness 32 | task_name: mmlu_college_computer_science 33 | eval_kwargs: 34 | num_fewshot: 5 35 | 36 | enable_wandb: True 37 | -------------------------------------------------------------------------------- /configs/recipes/llama3_3/inference/70b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 3.3 70B Instruct with a NATIVE engine. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.3: https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama3_3/inference/70b_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-3.3-70B-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/llama3_3/inference/70b_vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 3.3 70B Instruct with VLLM. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.3: https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct 7 | # 8 | # Usage: 9 | # oumi infer -i -c configs/recipes/llama3_3/inference/70b_vllm_infer.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.3-70B-Instruct" 19 | model_max_length: 2048 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | max_new_tokens: 2048 27 | batch_size: 1 28 | 29 | engine: VLLM 30 | -------------------------------------------------------------------------------- /configs/recipes/llama4/evaluation/scout_instruct_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Llama 4 Scout-17B-16E Instruct 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 4: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/llama4/evaluation/scout_instruct_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-4-Scout-17B-16E-Instruct" 19 | model_max_length: 131072 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | shard_for_eval: True 25 | 26 | generation: 27 | batch_size: 1 28 | 29 | tasks: 30 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 31 | - evaluation_backend: lm_harness 32 | task_name: mmlu_college_computer_science 33 | eval_kwargs: 34 | num_fewshot: 5 35 | 36 | enable_wandb: True 37 | -------------------------------------------------------------------------------- /configs/recipes/llama4/inference/maverick_instruct_together_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 4 Maverick-17B-128E Instruct with a TOGETHER engine. 2 | # 3 | # Requirements: 4 | # - Set the `TOGETHER_API_KEY` env var to your Together API key. 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/llama4/inference/maverick_instruct_together_infer.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 11 | # - Config class: oumi.core.configs.InferenceConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 13 | # - Other inference configs: configs/**/inference/ 14 | 15 | model: 16 | model_name: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8" 17 | 18 | generation: 19 | max_new_tokens: 2048 20 | 21 | engine: TOGETHER 22 | -------------------------------------------------------------------------------- /configs/recipes/llama4/inference/scout_instruct_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 4 Scout-17B-16E Instruct with a NATIVE engine. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 4: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/llama4/inference/scout_instruct_infer.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "meta-llama/Llama-4-Scout-17B-16E-Instruct" 18 | model_max_length: 2048 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | load_pretrained_weights: True 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 2048 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/llama4/inference/scout_instruct_together_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 4 Scout-17B-16E Instruct with a NATIVE engine. 2 | # 3 | # Requirements: 4 | # - Set the `TOGETHER_API_KEY` env var to your Together API key. 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/llama4/inference/scout_instruct_together_infer.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 11 | # - Config class: oumi.core.configs.InferenceConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 13 | # - Other inference configs: configs/**/inference/ 14 | 15 | model: 16 | model_name: "meta-llama/Llama-4-Scout-17B-16E-Instruct" 17 | 18 | generation: 19 | max_new_tokens: 2048 20 | 21 | engine: TOGETHER 22 | -------------------------------------------------------------------------------- /configs/recipes/llama4/inference/scout_instruct_vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # vLLM Inference config for Llama 4 Scout-17B-16E Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 4: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct 7 | # 8 | # Usage: 9 | # oumi infer -i -c configs/recipes/llama4/inference/scout_instruct_vllm_infer.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-4-Scout-17B-16E-Instruct" 19 | model_max_length: 2048 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | max_new_tokens: 2048 27 | 28 | engine: VLLM 29 | -------------------------------------------------------------------------------- /configs/recipes/phi3/README.md: -------------------------------------------------------------------------------- 1 | # Phi-3 2 | 3 | Configs for Microsoft's Phi-3 model family. 4 | -------------------------------------------------------------------------------- /configs/recipes/phi3/dpo/mac_train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 DPO train config for Mac. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/dpo/mac_train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | torch_dtype_str: "float16" 15 | trust_remote_code: True 16 | 17 | data: 18 | train: 19 | datasets: 20 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 21 | 22 | training: 23 | optimizer: "adamw_torch" 24 | use_peft: true 25 | output_dir: "output/phi3.dpo" 26 | trainer_type: "TRL_DPO" 27 | per_device_train_batch_size: 1 28 | gradient_accumulation_steps: 8 29 | 30 | # Use for debugging purposes 31 | # max_steps: 10 32 | 33 | peft: 34 | q_lora: False 35 | lora_target_modules: 36 | - "qkv_proj" 37 | - "o_proj" 38 | - "gate_up_proj" 39 | - "down_proj" 40 | -------------------------------------------------------------------------------- /configs/recipes/phi3/dpo/nvidia_24g_train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 DPO train config for an Nvidia GPU with >=24GB memory. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/dpo/nvidia_24g_train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | torch_dtype_str: "bfloat16" 15 | trust_remote_code: True 16 | 17 | data: 18 | train: 19 | datasets: 20 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 21 | 22 | training: 23 | optimizer: "adamw_torch_fused" 24 | use_peft: true 25 | output_dir: "output/phi3.dpo" 26 | trainer_type: "TRL_DPO" 27 | per_device_train_batch_size: 2 # Each batch seems to be approx. 1.8GB 28 | gradient_accumulation_steps: 8 29 | 30 | # Use for debugging purposes 31 | # max_steps: 10 32 | 33 | peft: 34 | q_lora: False 35 | lora_target_modules: 36 | - "qkv_proj" 37 | -------------------------------------------------------------------------------- /configs/recipes/phi3/dpo/nvidia_80g_train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 DPO train config for an Nvidia GPU with >=80GB memory. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/dpo/nvidia_80g_train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | torch_dtype_str: "bfloat16" 15 | trust_remote_code: True 16 | 17 | data: 18 | train: 19 | datasets: 20 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 21 | 22 | training: 23 | optimizer: "adamw_torch" 24 | use_peft: true 25 | output_dir: "output/phi3.dpo" 26 | trainer_type: "TRL_DPO" 27 | per_device_train_batch_size: 4 28 | gradient_accumulation_steps: 64 29 | 30 | # Use for debugging purposes 31 | # max_steps: 10 32 | 33 | peft: 34 | q_lora: False 35 | lora_target_modules: 36 | - "qkv_proj" 37 | - "o_proj" 38 | - "gate_up_proj" 39 | - "down_proj" 40 | -------------------------------------------------------------------------------- /configs/recipes/phi3/dpo/train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 DPO train config. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/dpo/train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | trust_remote_code: True 15 | 16 | data: 17 | train: 18 | datasets: 19 | - dataset_name: "mlabonne/orpo-dpo-mix-40k" 20 | 21 | training: 22 | optimizer: "adamw_torch" 23 | use_peft: true 24 | output_dir: "output/phi3.dpo" 25 | trainer_type: "TRL_DPO" 26 | 27 | peft: 28 | q_lora: False 29 | lora_target_modules: 30 | - "q_proj" 31 | - "k_proj" 32 | - "v_proj" 33 | - "o_proj" 34 | - "gate_proj" 35 | - "up_proj" 36 | - "down_proj" 37 | -------------------------------------------------------------------------------- /configs/recipes/phi3/evaluation/gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # Job config to eval Phi3 Instruct on GCP. 2 | # 3 | # Requirements: 4 | # - Set up SkyPilot GCP: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html#setup 5 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 6 | # 7 | # Usage: 8 | # oumi launch up -c configs/recipes/phi3/evaluation/gcp_job.yaml --cluster phi3-eval 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 12 | # - Config class: oumi.core.configs.JobConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 14 | # - Other job configs: configs/**/*job.yaml 15 | 16 | 17 | name: phi3-eval 18 | 19 | resources: 20 | cloud: gcp 21 | accelerators: "A100:4" 22 | disk_size: 200 # Disk size in GB 23 | use_spot: false 24 | 25 | working_dir: . 26 | 27 | file_mounts: 28 | ~/.netrc: ~/.netrc # WandB credentials 29 | 30 | envs: 31 | # HF datasets require trusting remote code to be enabled. 32 | HF_DATASETS_TRUST_REMOTE_CODE: 1 33 | WANDB_PROJECT: oumi-eval 34 | OUMI_RUN_NAME: phi3.eval 35 | 36 | setup: | 37 | set -e 38 | pip install uv && uv pip install oumi[gpu,evaluation] 39 | 40 | run: | 41 | set -e # Exit if any command failed. 42 | source ./configs/examples/misc/sky_init.sh 43 | 44 | oumi evaluate \ 45 | -c configs/recipes/phi3/evaluation/eval.yaml \ 46 | --run_name "${OUMI_RUN_NAME}.${SKYPILOT_TASK_ID}" 47 | -------------------------------------------------------------------------------- /configs/recipes/phi3/sft/lora_train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 LoRA train config. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/sft/lora_train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | torch_dtype_str: "bfloat16" 15 | trust_remote_code: True 16 | 17 | data: 18 | train: 19 | datasets: 20 | - dataset_name: "yahma/alpaca-cleaned" 21 | target_col: "prompt" 22 | 23 | training: 24 | optimizer: "adamw_torch" 25 | use_peft: true 26 | output_dir: "output/phi3.fft" 27 | trainer_type: "TRL_SFT" 28 | per_device_train_batch_size: 2 # Each batch seems to be approx. 1.8GB 29 | gradient_accumulation_steps: 8 30 | 31 | # Use for debugging purposes 32 | # max_steps: 10 33 | 34 | peft: 35 | q_lora: False 36 | lora_target_modules: 37 | - "q_proj" 38 | - "k_proj" 39 | - "v_proj" 40 | - "o_proj" 41 | - "gate_proj" 42 | - "up_proj" 43 | - "down_proj" 44 | -------------------------------------------------------------------------------- /configs/recipes/phi3/sft/mac_lora_train.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 LoRA train config for Mac. 2 | # 3 | # Usage: 4 | # oumi train -c configs/recipes/phi3/sft/mac_lora_train.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/train/train.html 8 | # - Config class: oumi.core.configs.TrainingConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/training_config.py 10 | # - Other training configs: configs/**/pretraining/, configs/**/sft/, configs/**/dpo/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-3-mini-4k-instruct" 14 | trust_remote_code: True 15 | 16 | data: 17 | train: 18 | datasets: 19 | - dataset_name: "yahma/alpaca-cleaned" 20 | target_col: "prompt" 21 | 22 | training: 23 | optimizer: "adamw_torch" 24 | use_peft: true 25 | trainer_type: "TRL_SFT" 26 | output_dir: "output/phi3.lora" 27 | 28 | peft: 29 | q_lora: False 30 | lora_target_modules: 31 | - "q_proj" 32 | - "k_proj" 33 | - "v_proj" 34 | - "o_proj" 35 | - "gate_proj" 36 | - "up_proj" 37 | - "down_proj" 38 | -------------------------------------------------------------------------------- /configs/recipes/phi4/evaluation/reasoning_plus_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Phi-4-reasoning-plus (14B params). 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c oumi://configs/recipes/phi4/evaluation/reasoning_plus_eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "microsoft/Phi-4-reasoning-plus" 17 | model_max_length: 32768 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 4 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/phi4/inference/reasoning_plus_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Phi-4-reasoning-plus (14B params). 2 | # 3 | # Usage: 4 | # oumi infer -i -c oumi://configs/recipes/phi4/inference/reasoning_plus_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "microsoft/Phi-4-reasoning-plus" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/qwen3/evaluation/30b_a3b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Qwen3 30B A3B (MoE model with 3B activated params). 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 6 | # 7 | # Usage: 8 | # oumi evaluate -c oumi://configs/recipes/qwen3/evaluation/30b_a3b_eval.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 12 | # - Config class: oumi.core.configs.EvaluationConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 14 | # - Other eval configs: configs/**/evaluation/ 15 | 16 | model: 17 | model_name: "Qwen/Qwen3-30B-A3B" 18 | model_max_length: 32768 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | trust_remote_code: True 22 | shard_for_eval: True 23 | 24 | generation: 25 | batch_size: 4 26 | 27 | tasks: 28 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 29 | - evaluation_backend: lm_harness 30 | task_name: mmlu_college_computer_science 31 | eval_kwargs: 32 | num_fewshot: 5 33 | 34 | enable_wandb: True 35 | 36 | inference_engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 37 | 38 | output_dir: "output/qwen3_30b_a3b/evaluation" 39 | -------------------------------------------------------------------------------- /configs/recipes/qwen3/evaluation/32b_eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Qwen3 32B. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 6 | # 7 | # Usage: 8 | # oumi evaluate -c oumi://configs/recipes/qwen3/evaluation/32b_eval.yaml 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 12 | # - Config class: oumi.core.configs.EvaluationConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 14 | # - Other eval configs: configs/**/evaluation/ 15 | 16 | model: 17 | model_name: "Qwen/Qwen3-32B" 18 | model_max_length: 32768 19 | torch_dtype_str: "bfloat16" 20 | attn_implementation: "sdpa" 21 | trust_remote_code: True 22 | shard_for_eval: True 23 | 24 | generation: 25 | batch_size: 4 26 | 27 | tasks: 28 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 29 | - evaluation_backend: lm_harness 30 | task_name: mmlu_college_computer_science 31 | eval_kwargs: 32 | num_fewshot: 5 33 | 34 | enable_wandb: True 35 | 36 | inference_engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 37 | 38 | output_dir: "output/qwen3_32b/evaluation" 39 | -------------------------------------------------------------------------------- /configs/recipes/qwen3/inference/30b_a3b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Qwen3 30B A3B (MoE model with 3B activated params). 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # 6 | # Usage: 7 | # oumi infer -i -c oumi://configs/recipes/qwen3/inference/30b_a3b_infer.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 11 | # - Config class: oumi.core.configs.InferenceConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 13 | # - Other inference configs: configs/**/inference/ 14 | 15 | model: 16 | model_name: "Qwen/Qwen3-30B-A3B" 17 | model_max_length: 32768 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | 22 | generation: 23 | max_new_tokens: 32768 24 | # Set based on recommended Qwen3 best practices for thinking model: 25 | # https://huggingface.co/Qwen/Qwen3-235B-A22B#best-practices. 26 | temperature: 0.6 27 | top_p: 0.95 28 | min_p: 0.0 29 | use_sampling: True 30 | # If repetitions are still present, consider increasing this value (up to 2.0). 31 | presence_penalty: 0.0 32 | 33 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 34 | -------------------------------------------------------------------------------- /configs/recipes/qwen3/inference/32b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Qwen3 32B. 2 | # 3 | # Requirements: 4 | # - (Optional) Run `pip install oumi[gpu]` if using the VLLM inference engine. 5 | # 6 | # Usage: 7 | # oumi infer -i -c oumi://configs/recipes/qwen3/inference/32b_infer.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 11 | # - Config class: oumi.core.configs.InferenceConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 13 | # - Other inference configs: configs/**/inference/ 14 | 15 | model: 16 | model_name: "Qwen/Qwen3-32B" 17 | model_max_length: 32768 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | 22 | generation: 23 | max_new_tokens: 32768 24 | # Set based on recommended Qwen3 best practices for thinking model: 25 | # https://huggingface.co/Qwen/Qwen3-235B-A22B#best-practices. 26 | temperature: 0.6 27 | top_p: 0.95 28 | min_p: 0.0 29 | use_sampling: True 30 | # If repetitions are still present, consider increasing this value (up to 2.0). 31 | presence_penalty: 0.0 32 | 33 | engine: NATIVE # Can also use `VLLM` for faster inference on GPUs. 34 | -------------------------------------------------------------------------------- /configs/recipes/qwq/evaluation/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for QwQ (based on Qwen2.5 32B). 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # 6 | # Usage: 7 | # oumi evaluate -c configs/recipes/qwq/evaluation/eval.yaml 8 | # 9 | # See Also: 10 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 11 | # - Config class: oumi.core.configs.EvaluationConfig 12 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 13 | # - Other eval configs: configs/**/evaluation/ 14 | 15 | model: 16 | model_name: "Qwen/QwQ-32B" 17 | model_max_length: 131072 18 | torch_dtype_str: "bfloat16" 19 | attn_implementation: "sdpa" 20 | trust_remote_code: True 21 | shard_for_eval: True 22 | 23 | generation: 24 | batch_size: 4 25 | 26 | tasks: 27 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu_college_computer_science 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | enable_wandb: True 34 | -------------------------------------------------------------------------------- /configs/recipes/qwq/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for QwQ (based on Qwen2.5 32B). 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/qwq/inference/infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "Qwen/QwQ-32B" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | trust_remote_code: True 18 | 19 | generation: 20 | max_new_tokens: 2048 21 | 22 | engine: NATIVE 23 | -------------------------------------------------------------------------------- /configs/recipes/smollm/README.md: -------------------------------------------------------------------------------- 1 | # SmolLM 2 | 3 | Configs for HuggingFace's SmolLM model family. 4 | -------------------------------------------------------------------------------- /configs/recipes/smollm/evaluation/135m/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for SmolLM 135M Instruct. 2 | # 3 | # Usage: 4 | # oumi evaluate -c configs/recipes/smollm/evaluation/135m/eval.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 8 | # - Config class: oumi.core.configs.EvaluationConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 10 | # - Other eval configs: configs/**/evaluation/ 11 | 12 | model: 13 | model_name: "HuggingFaceTB/SmolLM2-135M-Instruct" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | load_pretrained_weights: True 18 | trust_remote_code: True 19 | shard_for_eval: True 20 | 21 | generation: 22 | batch_size: 4 23 | 24 | tasks: 25 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 26 | - evaluation_backend: lm_harness 27 | task_name: mmlu_college_computer_science 28 | eval_kwargs: 29 | num_fewshot: 5 30 | 31 | inference_engine: NATIVE 32 | enable_wandb: False 33 | -------------------------------------------------------------------------------- /configs/recipes/smollm/evaluation/135m/gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # Job config to evaluate smollm 135M on 1 GCP node. 2 | # 3 | # Usage: 4 | # oumi launch up -c configs/recipes/smollm/evaluation/135m/gcp_job.yaml --cluster smollm-135m-eval 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 8 | # - Config class: oumi.core.configs.JobConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 10 | # - Other job configs: configs/**/*job.yaml 11 | 12 | name: smollm-135m-eval 13 | 14 | resources: 15 | cloud: gcp 16 | accelerators: "A100:1" 17 | use_spot: false 18 | disk_size: 100 # Disk size in GBs 19 | 20 | working_dir: . 21 | 22 | envs: 23 | OUMI_RUN_NAME: smollm135m.eval 24 | # https://github.com/huggingface/tokenizers/issues/899#issuecomment-1027739758 25 | TOKENIZERS_PARALLELISM: false 26 | 27 | setup: | 28 | set -e 29 | pip install uv && uv pip install oumi[gpu,evaluation] 30 | 31 | run: | 32 | set -e # Exit if any command failed. 33 | source ./configs/examples/misc/sky_init.sh 34 | 35 | set -x 36 | oumi evaluate -c configs/recipes/smollm/evaluation/135m/eval.yaml \ 37 | --enable_wandb false 38 | 39 | echo "Evaluation complete!" 40 | -------------------------------------------------------------------------------- /configs/recipes/smollm/evaluation/135m/quickstart_alpaca_v2_eval.yaml: -------------------------------------------------------------------------------- 1 | # Quickstart Alpaca v2 eval config for SmolLM 135M Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[evaluation]` or `pip install alpaca_eval` 5 | # - Set the env var `OPENAI_API_KEY` to your OpenAI API key. 6 | # - For full evaluation, comment out the `num_samples` line. 7 | # 8 | # Usage: 9 | # oumi evaluate -c configs/recipes/smollm/evaluation/135m/quickstart_alpaca_v2_eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | model_name: "HuggingFaceTB/SmolLM2-135M-Instruct" 19 | model_max_length: 2048 20 | torch_dtype_str: "bfloat16" 21 | attn_implementation: "sdpa" 22 | load_pretrained_weights: True 23 | trust_remote_code: True 24 | 25 | generation: 26 | # NOTE: Adjust based on your available GPU memory. 27 | batch_size: 4 28 | 29 | tasks: 30 | - evaluation_backend: alpaca_eval # 805 examples. 31 | # NOTE: We use a small subset for demonstration purposes, and to reduce the cost of 32 | # OpenAI inference. Comment out for full evaluation. 33 | num_samples: 3 34 | eval_kwargs: 35 | version: 2.0 36 | 37 | # inference_engine: VLLM # Uncomment if you're running on a CUDA GPU. 38 | -------------------------------------------------------------------------------- /configs/recipes/smollm/evaluation/135m/quickstart_eval.yaml: -------------------------------------------------------------------------------- 1 | # Quickstart eval config for SmolLM 135M Instruct. 2 | # 3 | # Usage: 4 | # oumi evaluate -c configs/recipes/smollm/evaluation/135m/quickstart_eval.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 8 | # - Config class: oumi.core.configs.EvaluationConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 10 | # - Other eval configs: configs/**/evaluation/ 11 | 12 | model: 13 | model_name: "HuggingFaceTB/SmolLM2-135M-Instruct" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | load_pretrained_weights: True 18 | trust_remote_code: True 19 | 20 | generation: 21 | batch_size: 4 22 | 23 | tasks: 24 | # For all available tasks, see https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 25 | - evaluation_backend: lm_harness 26 | task_name: mmlu_college_computer_science 27 | eval_kwargs: 28 | num_fewshot: 5 29 | -------------------------------------------------------------------------------- /configs/recipes/smollm/evaluation/135m/quickstart_gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # Job config to evaluate smollm 135M on 1 GCP node. 2 | # 3 | # Usage: 4 | # oumi launch up -c configs/recipes/smollm/evaluation/135m/quickstart_gcp_job.yaml --cluster smollm-135m-eval 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 8 | # - Config class: oumi.core.configs.JobConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 10 | # - Other job configs: configs/**/*job.yaml 11 | 12 | name: smollm-135m-eval 13 | 14 | resources: 15 | cloud: gcp 16 | accelerators: "A100:1" 17 | use_spot: false 18 | disk_size: 100 # Disk size in GBs 19 | 20 | working_dir: . 21 | 22 | envs: 23 | OUMI_RUN_NAME: smollm135m.eval 24 | # https://github.com/huggingface/tokenizers/issues/899#issuecomment-1027739758 25 | TOKENIZERS_PARALLELISM: false 26 | 27 | setup: | 28 | set -e 29 | pip install uv && uv pip install oumi[gpu,evaluation] 30 | 31 | run: | 32 | set -e # Exit if any command failed. 33 | source ./configs/examples/misc/sky_init.sh 34 | 35 | set -x 36 | oumi evaluate -c configs/recipes/smollm/evaluation/135m/quickstart_eval.yaml 37 | 38 | echo "Evaluation complete!" 39 | -------------------------------------------------------------------------------- /configs/recipes/smollm/inference/135m_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for SmolLM 135M Instruct. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/smollm/inference/135m_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "HuggingFaceTB/SmolLM2-135M-Instruct" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | load_pretrained_weights: True 18 | trust_remote_code: True 19 | 20 | generation: 21 | max_new_tokens: 100 22 | batch_size: 4 23 | 24 | engine: NATIVE 25 | -------------------------------------------------------------------------------- /configs/recipes/smollm/sft/135m/gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # Job config to tune smollm 135M on 1 GCP node. 2 | # 3 | # Usage: 4 | # oumi launch up -c configs/recipes/smollm/sft/135m/gcp_job.yaml --cluster smollm-135m-fft 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 8 | # - Config class: oumi.core.configs.JobConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 10 | # - Other job configs: configs/**/*job.yaml 11 | 12 | name: smollm-135m-sft 13 | 14 | resources: 15 | cloud: gcp 16 | accelerators: "A100:1" 17 | use_spot: false 18 | disk_size: 100 # Disk size in GBs 19 | 20 | working_dir: . 21 | 22 | envs: 23 | OUMI_RUN_NAME: smollm135m.train 24 | 25 | setup: | 26 | set -e 27 | pip install uv && uv pip install oumi[gpu] 28 | 29 | run: | 30 | set -e # Exit if any command failed. 31 | source ./configs/examples/misc/sky_init.sh 32 | 33 | set -x 34 | oumi train -c configs/recipes/smollm/sft/135m/train.yaml \ 35 | --training.enable_wandb false 36 | 37 | echo "Training complete!" 38 | -------------------------------------------------------------------------------- /configs/recipes/smollm/sft/135m/quickstart_gcp_job.yaml: -------------------------------------------------------------------------------- 1 | # Job config to tune smollm 135M on 1 GCP node. 2 | # 3 | # Usage: 4 | # oumi launch up -c configs/recipes/smollm/sft/135m/quickstart_gcp_job.yaml --cluster smollm-135m-fft 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/launch/launch.html 8 | # - Config class: oumi.core.configs.JobConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/job_config.py 10 | # - Other job configs: configs/**/*job.yaml 11 | 12 | name: smollm-135m-sft 13 | 14 | resources: 15 | cloud: gcp 16 | accelerators: "A100:1" 17 | use_spot: false 18 | disk_size: 100 # Disk size in GBs 19 | 20 | working_dir: . 21 | 22 | envs: 23 | OUMI_RUN_NAME: smollm135m.train 24 | # https://github.com/huggingface/tokenizers/issues/899#issuecomment-1027739758 25 | TOKENIZERS_PARALLELISM: false 26 | 27 | setup: | 28 | set -e 29 | pip install uv && uv pip install oumi[gpu] 30 | 31 | run: | 32 | set -e # Exit if any command failed. 33 | source ./configs/examples/misc/sky_init.sh 34 | 35 | set -x 36 | oumi train -c configs/recipes/smollm/sft/135m/quickstart_train.yaml 37 | 38 | echo "Training complete!" 39 | -------------------------------------------------------------------------------- /configs/recipes/vision/README.md: -------------------------------------------------------------------------------- 1 | # Vision 2 | 3 | Configs for vision-language models. 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/internvl3/README.md: -------------------------------------------------------------------------------- 1 | ## **InternVL 3.0 1B — A Multimodal Large Language Model (MLLM)** 2 | 3 | **InternVL 3.0 1B** is an efficient multimodal model that integrates both **text and visual inputs**, following the **ViT-MLP-LLM** design paradigm. 4 | 5 | 📘 Learn more: [huggingface.co/OpenGVLab/InternVL3-1B-hf](https://huggingface.co/OpenGVLab/InternVL3-1B-hf) 6 | 7 | --- 8 | 9 | ### ⚠️CAUTION⚠️ points: 10 | 11 | This model has been integrated in Oumi with significant *limitations*. 12 | 13 | 1. It requires the latest transformers version (4.52.0.dev0), which you can install with: 14 | ```sh 15 | pip install git+https://github.com/huggingface/transformers.git 16 | ``` 17 | Use this with caution, as it might break some of Oumi's features which is as of today (April 23rd 2025) is using transformers <4.52. 18 | 19 | 2. The model is currently working with a *single* GPU environment, and requires its weights in full precision (fp32). Multi-GPU and half-point precision version are WIP. 20 | -------------------------------------------------------------------------------- /configs/recipes/vision/llama3_2_vision/README.md: -------------------------------------------------------------------------------- 1 | # Llama 3.2-Vision Instruct 11B 2 | 3 | Configs for Llama 3.2-Vision Instruct 11B model. See https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/llama3_2_vision/inference/11b_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Llama 3.2 11B Vision Instruct. 2 | # 3 | # Requirements: 4 | # - Log into HF: `huggingface-cli login` 5 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/vision/llama3_2_vision/inference/11b_infer.yaml \ 9 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "meta-llama/Llama-3.2-11B-Vision-Instruct" 19 | torch_dtype_str: "bfloat16" 20 | model_max_length: 1024 21 | chat_template: "llama3-instruct" 22 | trust_remote_code: True 23 | 24 | generation: 25 | max_new_tokens: 32 26 | batch_size: 1 27 | 28 | engine: NATIVE 29 | -------------------------------------------------------------------------------- /configs/recipes/vision/llama3_2_vision/inference/11b_vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # vLLM inference config for Llama 3.2 11B Vision Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Llama 3.2: https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct 7 | # 8 | # Usage: 9 | # oumi infer -i -c configs/recipes/vision/llama3_2_vision/inference/11b_vllm_infer.yaml \ 10 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 11 | # 12 | # See Also: 13 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 14 | # - Config class: oumi.core.configs.InferenceConfig 15 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 16 | # - Other inference configs: configs/**/inference/ 17 | 18 | model: 19 | model_name: "meta-llama/Llama-3.2-11B-Vision-Instruct" 20 | adapter_model: null # As of 01/25, VLLM does not fully support LoRA adapters for MllamaForConditionalGeneration (see: https://docs.vllm.ai/en/latest/models/supported_models.html) 21 | torch_dtype_str: "bfloat16" 22 | model_max_length: 1024 23 | chat_template: "llama3-instruct" 24 | trust_remote_code: True 25 | model_kwargs: 26 | max_num_seqs: 2 # Set to a low number to reduce GPU memory requirements. 27 | 28 | generation: 29 | max_new_tokens: 32 30 | batch_size: 1 31 | 32 | engine: VLLM 33 | -------------------------------------------------------------------------------- /configs/recipes/vision/llava_7b/README.md: -------------------------------------------------------------------------------- 1 | # LLaVA 1.5 7B 2 | 3 | Configs for LLaVA 1.5 7B model. See https://huggingface.co/llava-hf/llava-1.5-7b-hf. 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/llava_7b/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # Llava 7B inference config. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/vision/llava_7b/inference/infer.yaml \ 5 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 6 | # 7 | # See Also: 8 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 9 | # - Config class: oumi.core.configs.InferenceConfig 10 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 11 | # - Other inference configs: configs/**/inference/ 12 | 13 | model: 14 | model_name: "llava-hf/llava-1.5-7b-hf" 15 | torch_dtype_str: "bfloat16" 16 | model_max_length: 1024 17 | chat_template: "llava" 18 | trust_remote_code: True 19 | 20 | generation: 21 | max_new_tokens: 32 22 | batch_size: 1 23 | 24 | engine: NATIVE 25 | -------------------------------------------------------------------------------- /configs/recipes/vision/llava_7b/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Llava 7B vLLM inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/llava_7b/inference/vllm_infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "llava-hf/llava-1.5-7b-hf" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 1024 20 | chat_template: "llava" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 32 25 | batch_size: 1 26 | 27 | engine: VLLM 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/phi3/README.md: -------------------------------------------------------------------------------- 1 | # Phi-3-vision-128k-instruct 2 | 3 | Configs for Phi-3-vision-128k-instruct 4.2B model. See https://huggingface.co/microsoft/Phi-3-vision-128k-instruct 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/phi3/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Phi3 vision vLLM inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/phi3/inference/vllm_infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "microsoft/Phi-3-vision-128k-instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 4096 20 | chat_template: "phi3-instruct" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 64 25 | batch_size: 1 26 | 27 | engine: VLLM 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/phi4/README.md: -------------------------------------------------------------------------------- 1 | # **Phi-4-multimodal-instruct 5.6B** 2 | 3 | Configs for Phi-4-multimodal-instruct 5.6Β model. 4 | 🔗 **Reference:** [Phi-4-multimodal-instruct on Hugging Face](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) 5 | 6 | --- 7 | 8 | This is a multimodal model that combines text, visual, and audio inputs. 9 | It uses a "Mixture of LoRAs" approach, allowing you to plug in adapters for each 10 | modality without needing to retrain the base model. For more information consider 11 | reading the following: 12 | 13 | - [Mixture-of-LoRAs](https://arxiv.org/abs/2403.03432) 14 | - [Phi-4 Multimodal Technical Report](https://arxiv.org/abs/2503.01743) 15 | 16 | ⚠️ This model requires `flash attention 2`. Run the following if executing in a custom fashion: 17 | ```sh 18 | pip install -U flash-attn --no-build-isolation 19 | ``` 20 | -------------------------------------------------------------------------------- /configs/recipes/vision/phi4/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # Phi-4-multimodal-instruct 5.6B inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install -U flash-attn --no-build-isolation` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/phi4/inference/infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "microsoft/Phi-4-multimodal-instruct" 19 | torch_dtype_str: "bfloat16" 20 | model_max_length: 4096 21 | trust_remote_code: True 22 | attn_implementation: "flash_attention_2" # The model requires Flash Attention. 23 | 24 | generation: 25 | max_new_tokens: 64 26 | batch_size: 1 27 | 28 | engine: NATIVE 29 | -------------------------------------------------------------------------------- /configs/recipes/vision/phi4/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Phi-4-multimodal-instruct 5.6B vLLM inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # - Run `pip install -U flash-attn --no-build-isolation` 6 | # 7 | # Usage: 8 | # oumi infer -i -c configs/recipes/vision/phi4/inference/vllm_infer.yaml \ 9 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 13 | # - Config class: oumi.core.configs.InferenceConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 15 | # - Other inference configs: configs/**/inference/ 16 | 17 | model: 18 | model_name: "microsoft/Phi-4-multimodal-instruct" 19 | torch_dtype_str: "bfloat16" 20 | model_max_length: 4096 21 | trust_remote_code: True 22 | attn_implementation: "flash_attention_2" # The model requires Flash Attention. 23 | 24 | generation: 25 | max_new_tokens: 64 26 | batch_size: 1 27 | 28 | engine: VLLM 29 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_5_vl_3b/README.md: -------------------------------------------------------------------------------- 1 | # **Qwen2.5-VL 3B** 2 | 3 | Configs for the **`Qwen2.5-VL`** 3B model. 4 | 🔗 **Reference:** [Qwen2.5-VL-3B-Instruct on Hugging Face](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct) 5 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_5_vl_3b/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # Qwen 2.5 VL 3B inference config. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/vision/qwen2_5_vl_3b/inference/infer.yaml \ 5 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 6 | # 7 | # See Also: 8 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 9 | # - Config class: oumi.core.configs.InferenceConfig 10 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 11 | # - Other inference configs: configs/**/inference/ 12 | 13 | model: 14 | model_name: "Qwen/Qwen2.5-VL-3B-Instruct" 15 | torch_dtype_str: "bfloat16" 16 | model_max_length: 4096 17 | chat_template: "qwen2-vl-instruct" # 2.5 uses the same template as 2.0 18 | trust_remote_code: True 19 | 20 | generation: 21 | max_new_tokens: 64 22 | batch_size: 1 23 | 24 | engine: NATIVE 25 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_5_vl_3b/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Qwen 2.5 VL 3B vLLM inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/qwen2_5_vl_3b/inference/vllm_infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "Qwen/Qwen2.5-VL-3B-Instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 4096 20 | chat_template: "qwen2-vl-instruct" # 2.5 uses the same template as 2.0 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 64 25 | batch_size: 1 26 | 27 | engine: VLLM 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_vl_2b/README.md: -------------------------------------------------------------------------------- 1 | # Qwen2-VL 2B 2 | 3 | Configs for Qwen2-VL 2B model. See https://huggingface.co/Qwen/Qwen2-VL-2B-Instruct 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_vl_2b/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for Qwen2 VL 2B Instruct. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/vision/qwen2_vl_2b/inference/infer.yaml \ 5 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 6 | # 7 | # See Also: 8 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 9 | # - Config class: oumi.core.configs.InferenceConfig 10 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 11 | # - Other inference configs: configs/**/inference/ 12 | 13 | # Note, if you are running on a multi-GPU machine, constraint the execution 14 | # to a single GPU, e.g., `export CUDA_VISIBLE_DEVICES=0` 15 | 16 | model: 17 | model_name: "Qwen/Qwen2-VL-2B-Instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 4096 20 | chat_template: "qwen2-vl-instruct" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 64 25 | batch_size: 1 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/qwen2_vl_2b/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # vLLM inference config for Qwen2 VL 2B Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/qwen2_vl_2b/inference/vllm_infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "Qwen/Qwen2-VL-2B-Instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 4096 20 | chat_template: "qwen2-vl-instruct" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 64 25 | batch_size: 1 26 | 27 | engine: VLLM 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/smolvlm/README.md: -------------------------------------------------------------------------------- 1 | # SmolVLM-Instruct 2 | 3 | Configs for SmolVLM-Instruct 2B model. See https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct 4 | -------------------------------------------------------------------------------- /configs/recipes/vision/smolvlm/inference/infer.yaml: -------------------------------------------------------------------------------- 1 | # SmolVLM Instruct inference config. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/smolvlm/inference/infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "HuggingFaceTB/SmolVLM-Instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 3072 20 | chat_template: "llava" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 32 25 | batch_size: 1 26 | 27 | engine: NATIVE 28 | -------------------------------------------------------------------------------- /configs/recipes/vision/smolvlm/inference/vllm_infer.yaml: -------------------------------------------------------------------------------- 1 | # vLLM inference config for SmolVLM Instruct. 2 | # 3 | # Requirements: 4 | # - Run `pip install oumi[gpu]` 5 | # 6 | # Usage: 7 | # oumi infer -i -c configs/recipes/vision/smolvlm/inference/vllm_infer.yaml \ 8 | # --image "tests/testdata/images/the_great_wave_off_kanagawa.jpg" 9 | # 10 | # See Also: 11 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 12 | # - Config class: oumi.core.configs.InferenceConfig 13 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 14 | # - Other inference configs: configs/**/inference/ 15 | 16 | model: 17 | model_name: "HuggingFaceTB/SmolVLM-Instruct" 18 | torch_dtype_str: "bfloat16" 19 | model_max_length: 3072 20 | chat_template: "llava" 21 | trust_remote_code: True 22 | 23 | generation: 24 | max_new_tokens: 32 25 | batch_size: 1 26 | 27 | engine: VLLM 28 | -------------------------------------------------------------------------------- /data/dataset_examples/alpaca_format.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "instruction": "What's the weather like in Seattle today?", 4 | "input": "", 5 | "output": "I apologize, but I don't have access to real-time weather information for Seattle." 6 | }, 7 | { 8 | "instruction": "Compute the average of the presented numbers.", 9 | "input": "5, 6, 10", 10 | "output": "The average for the numbers: 5, 6, 10 can be computed by adding first all of them, and then dividing this sum by their total number. First, 5+6+10 = 21. Then, 21 / 3 = 7. The average is 7." 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /data/dataset_examples/alpaca_format.jsonl: -------------------------------------------------------------------------------- 1 | {"instruction":"What's the weather like in Seattle today?","input":"","output":"I apologize, but I don't have access to real-time weather information for Seattle."} 2 | {"instruction":"Compute the average of the presented numbers.","input":"5, 6, 10","output":"The average for the numbers: 5, 6, 10 can be computed by adding first all of them, and then dividing this sum by their total number. First, 5+6+10 = 21. Then, 21 \/ 3 = 7. The average is 7."} 3 | -------------------------------------------------------------------------------- /data/dataset_examples/oumi_format.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "messages": [ 4 | { 5 | "role": "user", 6 | "content": "What's the weather like in Seattle today?" 7 | }, 8 | { 9 | "role": "assistant", 10 | "content": "I apologize, but I don't have access to real-time weather information for Seattle." 11 | } 12 | ] 13 | }, 14 | { 15 | "messages": [ 16 | { 17 | "role": "system", 18 | "content": "You are a helpful AI assistant with knowledge about architecture." 19 | }, 20 | { 21 | "role": "user", 22 | "content": "Tell me about the Golden Gate Bridge." 23 | }, 24 | { 25 | "role": "assistant", 26 | "content": "The Golden Gate Bridge is an iconic suspension bridge in San Francisco." 27 | }, 28 | { 29 | "role": "user", 30 | "content": "And where is San Francisco?" 31 | }, 32 | { 33 | "role": "assistant", 34 | "content": "In California, USA!" 35 | } 36 | ], 37 | "metadata": 38 | { 39 | "category": "demo multi-turn oumi format", 40 | "timestamp": "2025-01-19T18:32:00Z" 41 | } 42 | } 43 | ] 44 | -------------------------------------------------------------------------------- /data/dataset_examples/oumi_format.jsonl: -------------------------------------------------------------------------------- 1 | {"messages":[{"role":"user","content":"What's the weather like in Seattle today?"},{"role":"assistant","content":"I apologize, but I don't have access to real-time weather information for Seattle."}]} 2 | {"messages":[{"role":"system","content":"You are a helpful AI assistant with knowledge about architecture."},{"role":"user","content":"Tell me about the Golden Gate Bridge."},{"role":"assistant","content":"The Golden Gate Bridge is an iconic suspension bridge in San Francisco."},{"role":"user", "content":"And where is San Francisco?"},{"role":"assistant", "content": "In California, USA!"}],"metadata":{"category":"demo multi-turn oumi format","timestamp":"2025-01-19T18:32:00Z"}} 3 | -------------------------------------------------------------------------------- /data/dataset_examples/vision_language_oumi_format.jsonl: -------------------------------------------------------------------------------- 1 | {"messages":[{"role":"user","content":[{"type":"image_url","content":"https://example.com/image_of_dog.jpg"},{"type":"text","content":"What breed is this dog?"}]},{"role":"assistant","content":"This appears to be a Shih Tzu puppy."}]} 2 | {"messages":[{"role":"system","content":"You are a helpful AI assistant with knowledge about architecture."},{"role":"user","content":[{"type":"image_url","content":"https://example.com/golden_gate_bridge.jpg"},{"type":"text","content":"What is shown in the image?"}]},{"role":"assistant","content":"The image shows the Golden Gate Bridge which is an iconic suspension bridge in San Francisco."},{"role":"user","content":"And where is San Francisco?"},{"role":"assistant","content":"In California, USA!"}],"metadata":{"category":"demo multi-turn vision-language conversations","timestamp":"2025-01-24T16:03:00Z"}} 3 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Jupyter notebooks, auto-copied from notebooks/ to docs/ 2 | *.ipynb 3 | 4 | # Auto-generated summary files 5 | api/summary/* 6 | 7 | # Automatically copied during build 8 | development/contributing.md 9 | -------------------------------------------------------------------------------- /docs/_doclinks.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/docs/_doclinks.config -------------------------------------------------------------------------------- /docs/_docsummaries.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -xe 4 | 5 | # Summarize datasets classes into markdown tables 6 | python docs/_summarize_module.py summarize-module "oumi.datasets.vision_language" --filter-type "class" --output-file docs/api/summary/vl_sft_datasets.md 7 | python docs/_summarize_module.py summarize-module "oumi.datasets.pretraining" --filter-type "class" --output-file docs/api/summary/pretraining_datasets.md 8 | python docs/_summarize_module.py summarize-module "oumi.datasets.sft" --filter-type "class" --output-file docs/api/summary/sft_datasets.md 9 | python docs/_summarize_module.py summarize-module "oumi.datasets.preference_tuning" --filter-type "class" --output-file docs/api/summary/preference_tuning_datasets.md 10 | python docs/_summarize_module.py summarize-module "oumi.inference" --parent-class "oumi.core.inference.BaseInferenceEngine" --filter-type "class" --output-file docs/api/summary/inference_engines.md 11 | # python docs/_summarize_module.py summarize-module "oumi.judges.judge_court" --filter-type "function" --exclude-imported --output-file docs/api/summary/judges.md # Not currently used in the docs 12 | -------------------------------------------------------------------------------- /docs/_static/logo/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/docs/_static/logo/favicon.png -------------------------------------------------------------------------------- /docs/_static/logo/header_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/docs/_static/logo/header_logo.png -------------------------------------------------------------------------------- /docs/_static/logo/oumi_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/docs/_static/logo/oumi_logo_dark.png -------------------------------------------------------------------------------- /docs/_static/logo/oumi_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/docs/_static/logo/oumi_logo_light.png -------------------------------------------------------------------------------- /docs/_templates/apidoc/package.rst.jinja: -------------------------------------------------------------------------------- 1 | {%- macro automodule(modname, options) -%} 2 | .. automodule:: {{ modname }} 3 | {%- for option in options %} 4 | :{{ option }}: 5 | {%- endfor %} 6 | {%- endmacro %} 7 | 8 | {%- macro toctree(docnames) -%} 9 | .. toctree:: 10 | :maxdepth: {{ maxdepth }} 11 | {% for docname in docnames %} 12 | {{ docname }} 13 | {%- endfor %} 14 | {%- endmacro %} 15 | 16 | {#- 17 | ## Oumi change: we don't want to show the package|namespace suffix 18 | -#} 19 | {{- pkgname | e | heading }} 20 | 21 | 22 | {%- if is_namespace %} 23 | .. py:module:: {{ pkgname }} 24 | {% endif %} 25 | 26 | {%- if modulefirst and not is_namespace %} 27 | {{ automodule(pkgname, automodule_options) }} 28 | {% endif %} 29 | 30 | {%- if subpackages %} 31 | Subpackages 32 | ----------- 33 | 34 | {{ toctree(subpackages) }} 35 | {% endif %} 36 | 37 | {%- if submodules and not subpackages and is_namespace %} 38 | Submodules 39 | ---------- 40 | {% if separatemodules %} 41 | {{ toctree(submodules) }} 42 | {% else %} 43 | {%- for submodule in submodules %} 44 | {% if show_headings %} 45 | {{- [submodule, "module"] | join(" ") | e | heading(2) }} 46 | {% endif %} 47 | {{ automodule(submodule, automodule_options) }} 48 | {% endfor %} 49 | {%- endif %} 50 | {%- endif %} 51 | 52 | {%- if not modulefirst and not is_namespace %} 53 | Module contents 54 | --------------- 55 | 56 | {{ automodule(pkgname, automodule_options) }} 57 | {% endif %} 58 | -------------------------------------------------------------------------------- /docs/_templates/autodoc2/index.jinja: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. toctree:: 5 | :titlesonly: 6 | 7 | {% for package in top_level %} 8 | {{ package }} 9 | {%- endfor %} 10 | -------------------------------------------------------------------------------- /docs/about/citations.md: -------------------------------------------------------------------------------- 1 | # Citations 2 | 3 | ## Citing Oumi 4 | 5 | If you find Oumi useful in your research, please consider citing it using the following entry: 6 | 7 | ```bibtex 8 | @software{oumi2025, 9 | author = {Oumi Community}, 10 | title = {Oumi: an Open, End-to-end Platform for Building Large Foundation Models}, 11 | month = {January}, 12 | year = {2025}, 13 | url = {https://github.com/oumi-ai/oumi} 14 | } 15 | ``` 16 | 17 | ## References 18 | 19 | :::{bibliography} 20 | :cited: 21 | :notcited: 22 | ::: 23 | -------------------------------------------------------------------------------- /docs/about/license.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | This project is licensed under the Apache License 2.0, which allows for broad use, modification, and distribution within the open source community. 4 | 5 | The full license terms and conditions can be found below. 6 | 7 | ## Apache License 2.0 8 | 9 | ```{include} ../../LICENSE 10 | ``` 11 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | oumi_demo/ 2 | -------------------------------------------------------------------------------- /scripts/datasets/pretokenize/README.md: -------------------------------------------------------------------------------- 1 | # Dataset Pre-tokenization Script 2 | 3 | This script allows you to pre-tokenize datasets for faster training. It supports both HuggingFace datasets and local files in various formats (jsonl, parquet, arrow). 4 | 5 | ## Usage 6 | 7 | ### Using with HuggingFace Datasets 8 | 9 | ```bash 10 | python process_dataset.py \ 11 | -c path/to/config.yaml \ 12 | --input_dataset "dataset_name" \ 13 | --dataset_split "train" \ 14 | --target_col "text" \ 15 | --output_dir "output/path" \ 16 | --num_shards 512 17 | ``` 18 | 19 | ### Using with Local Files 20 | 21 | ```bash 22 | python process_dataset.py \ 23 | -c path/to/config.yaml \ 24 | --input_path "data/*.jsonl" \ 25 | --input_format "jsonl" \ 26 | --target_col "text" \ 27 | --output_dir "output/path" 28 | ``` 29 | -------------------------------------------------------------------------------- /scripts/docker/build_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to build the docker image and push it to the docker hub. 3 | 4 | set -xe 5 | 6 | OUMI_TAG=oumi:latest 7 | 8 | echo "Building image..." 9 | docker build -t $OUMI_TAG . 10 | 11 | echo "Running basic tests..." 12 | docker run --rm $OUMI_TAG oumi env 13 | 14 | # echo "Pushing docker image" 15 | # docker push $DOCKER_HUB/$OUMI_TAG 16 | 17 | echo "Build complete!" 18 | -------------------------------------------------------------------------------- /scripts/examples/batch_inference/README.md: -------------------------------------------------------------------------------- 1 | # Oumi Batch / Bulk Inference 2 | 3 | This folder contains the code used in https://youtu.be/3Yg3ycxCEYQ 4 | -------------------------------------------------------------------------------- /scripts/examples/batch_inference/infer.yaml: -------------------------------------------------------------------------------- 1 | model: 2 | model_name: "claude-3-7-sonnet-20250219" 3 | 4 | engine: ANTHROPIC 5 | 6 | remote_params: 7 | politeness_policy: .5 8 | -------------------------------------------------------------------------------- /scripts/examples/batch_inference/smollm_infer.yaml: -------------------------------------------------------------------------------- 1 | # Inference config for SmolLM 135M Instruct. 2 | # 3 | # Usage: 4 | # oumi infer -i -c configs/recipes/smollm/inference/135m_infer.yaml 5 | # 6 | # See Also: 7 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/infer/infer.html 8 | # - Config class: oumi.core.configs.InferenceConfig 9 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/inference_config.py 10 | # - Other inference configs: configs/**/inference/ 11 | 12 | model: 13 | model_name: "HuggingFaceTB/SmolLM2-135M-Instruct" 14 | model_max_length: 2048 15 | torch_dtype_str: "bfloat16" 16 | attn_implementation: "sdpa" 17 | load_pretrained_weights: True 18 | trust_remote_code: True 19 | 20 | generation: 21 | max_new_tokens: 200 22 | batch_size: 4 23 | 24 | engine: NATIVE 25 | -------------------------------------------------------------------------------- /scripts/examples/evaluation/README.md: -------------------------------------------------------------------------------- 1 | # Oumi Custom Evaluation 2 | 3 | This folder contains the code used in https://youtu.be/GhHmtjMw-l4 4 | -------------------------------------------------------------------------------- /scripts/inference/README.md: -------------------------------------------------------------------------------- 1 | # GCP Inference Script 2 | 3 | A script for running batch inference on files stored in Google Cloud Storage buckets using vLLM. 4 | 5 | ## Overview 6 | 7 | This script monitors an input GCS bucket for new files, runs inference on them using a specified model, and writes the results to an output GCS bucket. It's designed to work with vLLM for efficient inference. 8 | 9 | ## Usage 10 | 11 | ```bash 12 | # Basic usage (single worker) 13 | python gcp_inference.py 14 | 15 | # With multiple workers for parallel inference 16 | python gcp_inference.py 17 | ``` 18 | 19 | ## Configuration 20 | 21 | The script requires the following environment variables: 22 | 23 | - `INFERENCE_CONFIG`: Path to the YAML configuration file containing inference settings 24 | -------------------------------------------------------------------------------- /scripts/polaris/jobs/build_apptainer_from_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #PBS -l select=1:system=polaris 4 | #PBS -l place=scatter 5 | #PBS -l walltime=00:10:00 6 | #PBS -l filesystems=home:eagle 7 | #PBS -l singularity_fakeroot=true 8 | #PBS -q debug 9 | #PBS -A community_ai 10 | #PBS -o /eagle/community_ai/jobs/logs 11 | #PBS -e /eagle/community_ai/jobs/logs 12 | 13 | set -e 14 | 15 | export HTTP_PROXY=http://proxy.alcf.anl.gov:3128 16 | export HTTPS_PROXY=http://proxy.alcf.anl.gov:3128 17 | export http_proxy=http://proxy.alcf.anl.gov:3128 18 | export https_proxy=http://proxy.alcf.anl.gov:3128 19 | 20 | export SHARED_DIR=/eagle/community_ai 21 | 22 | # Run several checks and export "OUMI_*" env vars. 23 | source ${PBS_O_WORKDIR}/scripts/polaris/polaris_init.sh 24 | 25 | module use /soft/spack/gcc/0.6.1/install/modulefiles/Core 26 | 27 | # Set up apptainer (docker-equivalent) 28 | module load apptainer 29 | 30 | set -x 31 | export APPTAINER_TMPDIR="/home/$USER/oumi/temp" 32 | apptainer -v build --fakeroot "${SHARED_DIR}/apptainer/vllm_vllm_openai_v0.5.4.sif" docker://vllm/vllm-openai:v0.5.4 33 | 34 | echo "Polaris job is all done!" 35 | -------------------------------------------------------------------------------- /scripts/polaris/jobs/download_model_from_hf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #PBS -l select=1:system=polaris 4 | #PBS -l place=scatter 5 | #PBS -l walltime=001:00:00 6 | #PBS -l filesystems=home:eagle 7 | #PBS -q debug 8 | #PBS -A community_ai 9 | #PBS -o /eagle/community_ai/jobs/logs 10 | #PBS -e /eagle/community_ai/jobs/logs 11 | 12 | set -e 13 | 14 | export MPICH_GPU_SUPPORT_ENABLED=1 15 | 16 | export HTTP_PROXY=http://proxy.alcf.anl.gov:3128 17 | export HTTPS_PROXY=http://proxy.alcf.anl.gov:3128 18 | export http_proxy=http://proxy.alcf.anl.gov:3128 19 | export https_proxy=http://proxy.alcf.anl.gov:3128 20 | 21 | export SHARED_DIR=/eagle/community_ai 22 | export HF_HOME="${SHARED_DIR}/.cache/huggingface" 23 | REPO="neuralmagic" 24 | MODEL="Meta-Llama-3.1-70B-Instruct-quantized.w8a8" 25 | MODEL_REPO="${REPO}/${MODEL}" 26 | 27 | # Various setup for running on Polaris. 28 | source ${PBS_O_WORKDIR}/scripts/polaris/polaris_init.sh 29 | 30 | set -x 31 | 32 | huggingface-cli download "${MODEL_REPO}" 33 | 34 | echo "Polaris job is all done!" 35 | -------------------------------------------------------------------------------- /scripts/polaris/jobs/example_job.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #PBS -l select=1:system=polaris 4 | #PBS -l place=scatter 5 | #PBS -l walltime=00:10:00 6 | #PBS -l filesystems=home:eagle 7 | #PBS -q debug 8 | #PBS -A community_ai 9 | #PBS -o /eagle/community_ai/jobs/logs/ 10 | #PBS -e /eagle/community_ai/jobs/logs/ 11 | 12 | set -e 13 | 14 | # Various setup for running on Polaris. 15 | source ${PBS_O_WORKDIR}/scripts/polaris/polaris_init.sh 16 | 17 | TRAIN_DATASETS="--data.train.datasets= 18 | - dataset_name: \"/eagle/community_ai/datasets/fineweb-edu/sample-10BT\" 19 | subset: \"default\" 20 | split: \"train\" 21 | " 22 | 23 | # Each batch should be 512 examples. With 4 GPUS and batch size 32 per GPU, we need 24 | # 4 gradient accumulation steps. 25 | oumi distributed torchrun \ 26 | -m oumi train \ 27 | -c configs/recipes/gpt2/pretraining/train.yaml \ 28 | --training.run_name "gpt2.pt.${PBS_JOBID}" \ 29 | "$TRAIN_DATASETS" \ 30 | --training.max_steps 100 \ 31 | --training.include_performance_metrics true \ 32 | --training.ddp_find_unused_parameters false \ 33 | --training.dataloader_num_workers 2 \ 34 | --training.dataloader_prefetch_factor 4 \ 35 | --training.per_device_train_batch_size 32 \ 36 | --training.gradient_accumulation_steps 4 37 | -------------------------------------------------------------------------------- /scripts/polaris/jobs/fineweb_pt_job.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #PBS -l select=2:system=polaris 4 | #PBS -l place=scatter 5 | #PBS -l walltime=00:30:00 6 | #PBS -l filesystems=home:eagle 7 | #PBS -q debug-scaling 8 | #PBS -A community_ai 9 | #PBS -o /eagle/community_ai/jobs/logs/ 10 | #PBS -e /eagle/community_ai/jobs/logs/ 11 | 12 | set -e 13 | 14 | # Various setup for running on Polaris. 15 | source ${PBS_O_WORKDIR}/scripts/polaris/polaris_init.sh 16 | 17 | TRAINING_MODE="fsdp" # NOTE: Modify this value to configure training mode. 18 | 19 | echo "Starting ${TRAINING_MODE} training with ${OUMI_NUM_NODES} node(s)..." 20 | 21 | # Overwrites values set in polaris_init.sh 22 | if [ "${TRAINING_MODE}" == "ddp1gpu" ]; then 23 | NRANKS=4 # Spawn 4 MPI ranks per Polaris node (1 `torchrun` for each GPU) 24 | NDEPTH=16 # Number of threads per rank 25 | CPU_BIND="numa" 26 | fi 27 | 28 | set -x 29 | mpiexec --verbose \ 30 | --np $((${OUMI_NUM_NODES} * ${NRANKS})) \ 31 | -ppn ${NRANKS} \ 32 | -d ${NDEPTH} --cpu-bind "${CPU_BIND}" \ 33 | ./scripts/polaris/jobs/fineweb_pt_worker.sh -m "${TRAINING_MODE} -t " 34 | 35 | echo -e "Finished ${TRAINING_MODE} training on ${OUMI_NUM_NODES} node(s):\n$(cat $PBS_NODEFILE)" 36 | echo "Polaris job is all done!" 37 | -------------------------------------------------------------------------------- /scripts/polaris/jobs/vllm_job.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #PBS -l select=1:system=polaris 4 | #PBS -l place=scatter 5 | #PBS -l walltime=00:40:00 6 | #PBS -l filesystems=home:eagle 7 | #PBS -q debug 8 | #PBS -A community_ai 9 | #PBS -o /eagle/community_ai/jobs/logs 10 | #PBS -e /eagle/community_ai/jobs/logs 11 | 12 | set -e 13 | 14 | # Various setup for running on Polaris. 15 | source ${PBS_O_WORKDIR}/scripts/polaris/polaris_init.sh 16 | 17 | export SHARED_DIR=/eagle/community_ai 18 | export HF_HOME="${SHARED_DIR}/.cache/huggingface" 19 | 20 | export OPENAI_API_KEY="EMPTY" 21 | 22 | export SNAPSHOT_DIR="${REPO}--${MODEL}" 23 | SNAPSHOTS=$(ls "${HF_HOME}/hub/models--${SNAPSHOT_DIR}/snapshots") 24 | readarray -t SNAPSHOT_ARRAY <<<"$SNAPSHOTS" 25 | export SNAPSHOT=${SNAPSHOT_ARRAY[-1]} 26 | 27 | echo "Setting up vLLM inference with ${OUMI_NUM_NODES} node(s)..." 28 | 29 | set -x 30 | 31 | # Start worker nodes 32 | mpiexec --verbose \ 33 | --np ${OUMI_NUM_NODES} \ 34 | --ppn ${NRANKS} \ 35 | --depth ${NDEPTH} \ 36 | --cpu-bind ${CPU_BIND} \ 37 | ./scripts/polaris/jobs/vllm_worker.sh 38 | 39 | echo "Polaris job is all done!" 40 | -------------------------------------------------------------------------------- /src/experimental/__init__.py: -------------------------------------------------------------------------------- 1 | """Experimental package for the Oumi (Open Universal Machine Intelligence) library. 2 | 3 | This package contains experimental features and components that are still 4 | under development or testing. Contents here may change frequently and are 5 | not guaranteed to be stable. 6 | 7 | Warning: 8 | The features in this package are experimental and may be subject to 9 | significant changes or removal without notice. Use with caution in 10 | production environments. 11 | 12 | Note: 13 | Feedback and contributions to experimental features are welcome. 14 | Please refer to the contribution guidelines for more information. 15 | 16 | See Also: 17 | :mod:`oumi.core`: For stable, production-ready features 18 | """ 19 | -------------------------------------------------------------------------------- /src/experimental/configs/projects/zephyr/README.md: -------------------------------------------------------------------------------- 1 | # Zephyr 2 | 3 | Configs for training HuggingFace's Zephyr model: a Mistral 7B model trained on a filtered version of UltraChat 200k. 4 | 5 | Dataset: https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k 6 | Model: https://huggingface.co/mistralai/Mistral-7B-v0.1 7 | -------------------------------------------------------------------------------- /src/experimental/configs/projects/zephyr/evaluation/eval.yaml: -------------------------------------------------------------------------------- 1 | # Eval config for Zephyr. 2 | # 3 | # Requirements: 4 | # - Log into WandB (`wandb login`) or disable `enable_wandb` 5 | # - Log into HF: `huggingface-cli login` 6 | # - Request access to Mistral: https://huggingface.co/mistralai/Mistral-7B-v0.1 7 | # 8 | # Usage: 9 | # oumi evaluate -c src/experimental/configs/projects/zephyr/evaluation/eval.yaml 10 | # 11 | # See Also: 12 | # - Documentation: https://oumi.ai/docs/en/latest/user_guides/evaluate/evaluate.html 13 | # - Config class: oumi.core.configs.EvaluationConfig 14 | # - Config source: https://github.com/oumi-ai/oumi/blob/main/src/oumi/core/configs/evaluation_config.py 15 | # - Other eval configs: configs/**/evaluation/ 16 | 17 | model: 18 | # Note: Update with your FFT or LoRA checkpoint 19 | model_name: "mistralai/Mistral-7B-v0.1" 20 | trust_remote_code: True 21 | # TODO: currently below are not passed in LM_HARNESS 22 | torch_dtype_str: "bfloat16" 23 | model_max_length: 2048 24 | chat_template: "zephyr" 25 | attn_implementation: "sdpa" 26 | 27 | tasks: 28 | - evaluation_backend: lm_harness 29 | task_name: mmlu 30 | eval_kwargs: 31 | num_fewshot: 5 32 | 33 | generation: 34 | batch_size: 32 35 | 36 | enable_wandb: True 37 | -------------------------------------------------------------------------------- /src/oumi/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Oumi (Open Universal Machine Intelligence).""" 16 | 17 | from oumi.cli.main import run 18 | 19 | if __name__ == "__main__": 20 | import sys 21 | 22 | # Per https://docs.python.org/3/library/sys_path_init.html , the first entry in 23 | # sys.path is the directory containing the input script. 24 | # This means `python ./src/oumi` will result in `import datasets` resolving to 25 | # `oumi.datasets` instead of the installed `datasets` package. 26 | # Moving the first entry of sys.path to the end will ensure that the installed 27 | # packages are found first. 28 | if len(sys.path) > 1: 29 | sys.path = sys.path[1:] + sys.path[:1] 30 | run() 31 | -------------------------------------------------------------------------------- /src/oumi/builders/metrics.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Callable, Optional 16 | 17 | from oumi.core.configs import TrainingParams 18 | from oumi.core.registry import REGISTRY 19 | 20 | 21 | def build_metrics_function(config: TrainingParams) -> Optional[Callable]: 22 | """Builds the metrics function.""" 23 | metrics_function = None 24 | if config.metrics_function: 25 | metrics_function = REGISTRY.get_metrics_function(config.metrics_function) 26 | if not metrics_function: 27 | raise KeyError( 28 | f"metrics_function `{config.metrics_function}` " 29 | "was not found in the registry." 30 | ) 31 | 32 | return metrics_function 33 | -------------------------------------------------------------------------------- /src/oumi/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Core package for the Oumi (Open Universal Machine Intelligence) library. 16 | 17 | This package contains fundamental components and abstractions used throughout 18 | the Oumi framework, including configurations, datasets, models, and more. 19 | """ 20 | -------------------------------------------------------------------------------- /src/oumi/core/callbacks/base_trainer_callback.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import transformers 16 | 17 | BaseTrainerCallback = transformers.TrainerCallback 18 | -------------------------------------------------------------------------------- /src/oumi/core/constants.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Common constants used in oumi codebase.""" 16 | 17 | from typing import Final 18 | 19 | # Tokens with this label value don't contribute to the loss computation. 20 | # For example, this can be `PAD`, or image tokens. `-100` is the PyTorch convention. 21 | # Refer to the `ignore_index` parameter of `torch.nn.CrossEntropyLoss()` 22 | # for more details. 23 | LABEL_IGNORE_INDEX: Final[int] = -100 24 | -------------------------------------------------------------------------------- /src/oumi/core/feature_generators/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Feature generators module for the Oumi (Open Universal Machine Intelligence) library. 16 | 17 | This module provides classes to generate model input features, which can be used 18 | in multiple contexts (datasets, collators, etc). 19 | """ 20 | 21 | from oumi.core.feature_generators.base_feature_generator import ( 22 | BaseConversationFeatureGenerator, 23 | FeatureGeneratorOptions, 24 | ) 25 | from oumi.core.feature_generators.vision_language_conversation_feature_generator import ( # noqa: E501 26 | VisionLanguageConversationFeatureGenerator, 27 | ) 28 | 29 | __all__ = [ 30 | "BaseConversationFeatureGenerator", 31 | "FeatureGeneratorOptions", 32 | "VisionLanguageConversationFeatureGenerator", 33 | ] 34 | -------------------------------------------------------------------------------- /src/oumi/core/inference/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Inference module for the Oumi (Open Universal Machine Intelligence) library. 16 | 17 | This module provides base classes for model inference in the Oumi framework. 18 | """ 19 | 20 | from oumi.core.inference.base_inference_engine import BaseInferenceEngine 21 | 22 | __all__ = [ 23 | "BaseInferenceEngine", 24 | ] 25 | -------------------------------------------------------------------------------- /src/oumi/core/launcher/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Launcher module for the Oumi (Open Universal Machine Intelligence) library. 16 | 17 | This module provides base classes for cloud and cluster management in 18 | the Oumi framework. 19 | 20 | These classes serve as foundations for implementing cloud-specific and cluster-specific 21 | launchers for running machine learning jobs. 22 | """ 23 | 24 | from oumi.core.launcher.base_cloud import BaseCloud 25 | from oumi.core.launcher.base_cluster import BaseCluster, JobStatus 26 | 27 | __all__ = [ 28 | "BaseCloud", 29 | "BaseCluster", 30 | "JobStatus", 31 | ] 32 | -------------------------------------------------------------------------------- /src/oumi/core/processors/base_image_processor.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import abc 16 | from typing import Optional 17 | 18 | import PIL.Image 19 | import transformers 20 | 21 | 22 | class BaseImageProcessor(abc.ABC): 23 | """Base class for oumi image processors.""" 24 | 25 | @abc.abstractmethod 26 | def __call__( 27 | self, 28 | images: list[PIL.Image.Image], 29 | *, 30 | return_tensors: Optional[str] = "pt", 31 | ) -> transformers.BatchFeature: 32 | """Extracts image features. 33 | 34 | Args: 35 | images: A list of input images. 36 | return_tensors: The format of returned tensors. 37 | 38 | Returns: 39 | transformers.BatchFeature: The model-specific input features. 40 | """ 41 | raise NotImplementedError 42 | -------------------------------------------------------------------------------- /src/oumi/core/registry/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """A framework used for registering and accessing objects across Oumi.""" 16 | 17 | from oumi.core.registry.registry import ( 18 | REGISTRY, 19 | Registry, 20 | RegistryType, 21 | register, 22 | register_cloud_builder, 23 | register_dataset, 24 | register_evaluation_function, 25 | register_judge, 26 | ) 27 | 28 | __all__ = [ 29 | "REGISTRY", 30 | "Registry", 31 | "RegistryType", 32 | "register", 33 | "register_cloud_builder", 34 | "register_dataset", 35 | "register_evaluation_function", 36 | "register_judge", 37 | ] 38 | -------------------------------------------------------------------------------- /src/oumi/core/tokenizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Tokenizers module for the Oumi (Open Universal Machine Intelligence) library. 16 | 17 | This module provides base classes for tokenizers used in the Oumi framework. 18 | These base classes serve as foundations for creating custom tokenizers for various 19 | natural language processing tasks. 20 | """ 21 | 22 | from oumi.core.tokenizers.base_tokenizer import BaseTokenizer 23 | from oumi.core.tokenizers.special_tokens import get_default_special_tokens 24 | 25 | __all__ = [ 26 | "BaseTokenizer", 27 | "get_default_special_tokens", 28 | ] 29 | -------------------------------------------------------------------------------- /src/oumi/core/tokenizers/base_tokenizer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import transformers 16 | 17 | BaseTokenizer = transformers.PreTrainedTokenizerBase 18 | -------------------------------------------------------------------------------- /src/oumi/core/types/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | class HardwareException(Exception): 17 | """An exception thrown for invalid hardware configurations.""" 18 | -------------------------------------------------------------------------------- /src/oumi/core/types/proto/generated/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/chat_ml.jinja: -------------------------------------------------------------------------------- 1 | {% if messages[0]['role'] == 'system' %} 2 | {% set offset = 1 %} 3 | {% else %} 4 | {% set offset = 0 %} 5 | {% endif %} 6 | 7 | {{ bos_token }} 8 | {% for message in messages %} 9 | {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %} 10 | {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }} 11 | {% endif %} 12 | 13 | {{ '<|im_start|>' + message['role'] + '\n' + message['content'] | trim + '<|im_end|>\n' }} 14 | {% endfor %} 15 | 16 | {% if add_generation_prompt %} 17 | {{ '<|im_start|>assistant\n' }} 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/default.jinja: -------------------------------------------------------------------------------- 1 | {% set role_suffix = ': ' %} 2 | {% set turn_suffix = '\n' %} 3 | 4 | {% for message in messages %} 5 | {{ message['role'].upper() + role_suffix + message['content'] | trim }}{% if not loop.last %}{{ turn_suffix }}{% endif %} 6 | {% endfor %} 7 | {% if add_generation_prompt %} 8 | {{ turn_suffix + "ASSISTANT" + role_suffix }} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/default_gen.jinja: -------------------------------------------------------------------------------- 1 | {% set role_suffix = ': ' %} 2 | {% set turn_suffix = '\n' %} 3 | 4 | {% for message in messages %} 5 | {% if message['role'].upper() == 'ASSISTANT' %} 6 | {{ message['role'].upper() + role_suffix }}{% generation %}{{message['content'] | trim}}{% endgeneration %}{% if not loop.last %}{{ turn_suffix }}{% endif %} 7 | {% else %} 8 | {{ message['role'].upper() + role_suffix + message['content'] | trim }}{% if not loop.last %}{{ turn_suffix }}{% endif %} 9 | {% endif %} 10 | {% endfor %} 11 | {% if add_generation_prompt %} 12 | {{ turn_suffix + "ASSISTANT" + role_suffix }} 13 | {% endif %} 14 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/gpt2.jinja: -------------------------------------------------------------------------------- 1 | {% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %} 2 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/internvl3.jinja: -------------------------------------------------------------------------------- 1 | {%- for message in messages -%} 2 | {{'<|im_start|>' + message['role'] + '\n'}} 3 | {%- if message['content'] is string -%} 4 | {{ message['content'] }} 5 | {%- elif message['content'] is iterable -%} 6 | {%- for item in message['content'] -%} 7 | {%- if item['type'].startswith('image') -%} 8 | {{ '\n' }} 9 | {%- elif item['type'] == 'video' -%} 10 | {{ raise_exception('Video data are not yet supported by Oumi for this model.') }} 11 | {%- elif item['type'] == 'text' -%} 12 | {{ item['text'] if 'text' in item else item['content'] }} 13 | {%- endif -%} 14 | {%- endfor -%} 15 | {%- endif -%} 16 | 17 | {{'<|im_end|>\n'}} 18 | {%- endfor -%} 19 | 20 | {%- if add_generation_prompt -%} 21 | {{'<|im_start|>assistant\n' }} 22 | {%- endif -%} 23 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/llama3-instruct.jinja: -------------------------------------------------------------------------------- 1 | {% set role_prefix = '<|start_header_id|>' %} 2 | {% set role_suffix = '<|end_header_id|>\n\n' %} 3 | {% set turn_suffix = '<|eot_id|>' %} 4 | {% set image_token = '<|image|>' %} 5 | 6 | {{ bos_token }} 7 | {%- for message in messages -%} 8 | {{ role_prefix + message['role'] + role_suffix }} 9 | 10 | {%- if message['content'] is string -%} 11 | {{ message['content'] | trim }} 12 | {%- elif message['content'] is iterable -%} 13 | {%- for item in message['content'] -%} 14 | {%- if item['type'] == 'text' -%} 15 | {{ (item['text'] if 'text' in item else item['content']) | trim }} 16 | {%- elif item['type'].startswith('image') -%} 17 | {{ image_token }} 18 | {%- endif -%} 19 | {%- endfor -%} 20 | {%- endif -%} 21 | {{ turn_suffix }} 22 | {%- endfor -%} 23 | 24 | {%- if add_generation_prompt -%} 25 | {{ role_prefix + 'assistant' + role_suffix }} 26 | {%- endif -%} 27 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/llava.jinja: -------------------------------------------------------------------------------- 1 | {%- if messages[0]['role'] == 'system' -%} 2 | {%- set system_message = messages[0]['content'] -%} 3 | {%- set messages = messages[1:] -%} 4 | {%- else -%} 5 | {% set system_message = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions." -%} 6 | {%- endif -%} 7 | 8 | {{ system_message + ' '}} 9 | 10 | {%- for message in messages if message['role'] in ('user','assistant') -%} 11 | {%- if message['role'] == 'user' -%} 12 | {{ 'USER: ' }} 13 | {%- elif message['role'] == 'assistant' -%} 14 | {{ 'ASSISTANT: ' }} 15 | {%- endif -%} 16 | 17 | {%- if message['content'] is string -%} 18 | {{ message['content'] + ' ' }} 19 | {%- elif message['content'] is iterable -%} 20 | {%- for item in message['content'] -%} 21 | {%- if item['type'] == 'text' -%} 22 | {{ (item['text'] if 'text' in item else item['content']) + ' ' }} 23 | {%- elif item['type'].startswith('image') -%} 24 | {{ ' ' }} 25 | {%- endif -%} 26 | {%- endfor -%} 27 | {%- endif -%} 28 | 29 | {%- if message['role'] == 'assistant' -%} 30 | {{eos_token}} 31 | {%- endif -%} 32 | {%- endfor -%} 33 | 34 | {%- if add_generation_prompt -%} 35 | {{ 'ASSISTANT: ' }} 36 | {%- endif -%} 37 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/molmo.jinja: -------------------------------------------------------------------------------- 1 | {% for message in messages -%} 2 | {%- if (loop.index % 2 == 1 and message['role'].lower() != 'user') or 3 | (loop.index % 2 == 0 and message['role'].lower() != 'assistant') -%} 4 | {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }} 5 | {%- endif -%} 6 | 7 | {{ message['role'].capitalize() + ': ' }} 8 | 9 | {%- if message['content'] is string -%} 10 | {{ message['content'] }} 11 | {%- elif message['content'] is iterable -%} 12 | {%- for item in message['content'] -%} 13 | {%- if item['type'] == 'text' -%} 14 | {{ (item['text'] if 'text' in item else item['content']) }} 15 | {%- endif -%} 16 | {%- endfor -%} 17 | {%- endif -%} 18 | 19 | {%- if not loop.last -%} 20 | {{ ' ' }} 21 | {%- endif -%} 22 | {%- endfor -%} 23 | {%- if add_generation_prompt -%} 24 | {{ ' Assistant:' }} 25 | {%- endif %} 26 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/phi3-instruct.jinja: -------------------------------------------------------------------------------- 1 | {%- set vars = namespace(next_image_id=1) -%} 2 | {%- for message in messages -%} 3 | {{ '<|' + message['role'] + '|>' + '\n' }} 4 | 5 | {%- if message['content'] is string -%} 6 | {{ message['content'] }} 7 | {%- elif message['content'] is iterable -%} 8 | {%- for item in message['content'] -%} 9 | {%- if item['type'] == 'text' -%} 10 | {{ item['text'] if 'text' in item else item['content'] }} 11 | {%- elif item['type'].startswith('image') -%} 12 | {{ '<|image_{i:d}|>'.format(i=vars.next_image_id) }} 13 | {%- set vars.next_image_id = vars.next_image_id + 1 -%} 14 | {%- endif -%} 15 | {%- endfor -%} 16 | {%- endif -%} 17 | 18 | {{ '<|end|>\n' }} 19 | {%- endfor -%} 20 | 21 | {% if add_generation_prompt and messages[-1]['role'] != 'assistant' %} 22 | {{- '<|assistant|>\n' -}} 23 | {% endif %} 24 | -------------------------------------------------------------------------------- /src/oumi/datasets/chat_templates/zephyr.jinja: -------------------------------------------------------------------------------- 1 | {% if messages[0]['role'] == 'system' %} 2 | {% set offset = 1 %} 3 | {% else %} 4 | {% set offset = 0 %} 5 | {% endif %} 6 | 7 | {% for message in messages %} 8 | {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %} 9 | {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }} 10 | {% endif %} 11 | 12 | {{ '<|' + message['role'] + '|>\n' + message['content'] | trim + eos_token + '\n' }} 13 | {% endfor %} 14 | 15 | {% if add_generation_prompt %} 16 | {{ '<|assistant|>\n' }} 17 | {% endif %} 18 | -------------------------------------------------------------------------------- /src/oumi/datasets/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Evaluation datasets module.""" 16 | 17 | from oumi.datasets.evaluation.alpaca import AlpacaEvalDataset 18 | 19 | __all__ = [ 20 | "AlpacaEvalDataset", 21 | ] 22 | -------------------------------------------------------------------------------- /src/oumi/datasets/grpo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """GRPO datasets module.""" 16 | 17 | from oumi.datasets.grpo.berry_bench import BerryBenchGrpoDataset 18 | from oumi.datasets.grpo.countdown import CountdownGrpoDataset 19 | from oumi.datasets.grpo.letter_count import LetterCountGrpoDataset 20 | from oumi.datasets.grpo.tldr import TldrGrpoDataset 21 | 22 | __all__ = [ 23 | "BerryBenchGrpoDataset", 24 | "CountdownGrpoDataset", 25 | "LetterCountGrpoDataset", 26 | "TldrGrpoDataset", 27 | ] 28 | -------------------------------------------------------------------------------- /src/oumi/datasets/grpo/rewards/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """GRPO reward functions module.""" 16 | 17 | from oumi.datasets.grpo.rewards.completion_length_rewards import ( 18 | compute_sharp_target_token_length_reward, 19 | compute_soft_target_token_length_reward, 20 | ) 21 | from oumi.datasets.grpo.rewards.count_letters_rewards import compute_letter_count_reward 22 | from oumi.datasets.grpo.rewards.countdown_rewards import countdown_reward 23 | 24 | __all__ = [ 25 | "compute_letter_count_reward", 26 | "compute_soft_target_token_length_reward", 27 | "compute_sharp_target_token_length_reward", 28 | "countdown_reward", 29 | ] 30 | -------------------------------------------------------------------------------- /src/oumi/datasets/grpo/tldr.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from oumi.core.datasets.base_grpo_dataset import BaseExperimentalGrpoDataset 16 | from oumi.core.registry import register_dataset 17 | 18 | 19 | @register_dataset("trl-lib/tldr") 20 | class TldrGrpoDataset(BaseExperimentalGrpoDataset): 21 | """Dataset class for the `trl-lib/tldr` dataset.""" 22 | 23 | default_dataset = "trl-lib/tldr" 24 | -------------------------------------------------------------------------------- /src/oumi/datasets/preference_tuning/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Preference tuning datasets module.""" 16 | 17 | from oumi.datasets.preference_tuning.orpo_dpo_mix import OrpoDpoMix40kDataset 18 | 19 | __all__ = [ 20 | "OrpoDpoMix40kDataset", 21 | ] 22 | -------------------------------------------------------------------------------- /src/oumi/datasets/pretraining/tiny_stories.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from oumi.core.datasets import BasePretrainingDataset 16 | from oumi.core.registry import register_dataset 17 | 18 | 19 | @register_dataset("roneneldan/TinyStories") 20 | class TinyStoriesDataset(BasePretrainingDataset): 21 | """TinyStoriesDataset class for loading and processing the TinyStories dataset. 22 | 23 | This dataset contains synthetically generated short stories with a small 24 | vocabulary, created by GPT-3.5 and GPT-4. It is designed for text generation 25 | tasks and is available in English. 26 | 27 | See Also: 28 | - Paper: https://arxiv.org/abs/2305.07759 29 | - Huggingface hub: https://huggingface.co/datasets/roneneldan/TinyStories 30 | 31 | Note: 32 | The dataset is available under the CDLA-Sharing-1.0 license. 33 | """ 34 | 35 | default_dataset = "roneneldan/TinyStories" 36 | -------------------------------------------------------------------------------- /src/oumi/datasets/sft/openo1_sft.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """OpenO1 synthetic reasoning SFT dataset.""" 16 | 17 | from oumi.core.registry.registry import register_dataset 18 | from oumi.datasets.sft.prompt_response import PromptResponseDataset 19 | 20 | 21 | @register_dataset("O1-OPEN/OpenO1-SFT") 22 | class OpenO1SFTDataset(PromptResponseDataset): 23 | """Synthetic reasoning SFT dataset.""" 24 | 25 | default_dataset = "O1-OPEN/OpenO1-SFT" 26 | 27 | def __init__( 28 | self, 29 | **kwargs, 30 | ) -> None: 31 | """Initializes a dataset for OpenO1SFT from HuggingFace.""" 32 | super().__init__( 33 | hf_dataset_path="O1-OPEN/OpenO1-SFT", 34 | prompt_column="instruction", 35 | response_column="output", 36 | **kwargs, 37 | ) 38 | -------------------------------------------------------------------------------- /src/oumi/evaluate.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Any 16 | 17 | from oumi.core.configs import EvaluationConfig 18 | from oumi.core.evaluation.evaluation_result import EvaluationResult 19 | from oumi.core.evaluation.evaluator import Evaluator 20 | 21 | 22 | def evaluate(config: EvaluationConfig) -> list[dict[str, Any]]: 23 | """Evaluates a model using the provided configuration. 24 | 25 | Args: 26 | config: The desired configuration for evaluation. 27 | 28 | Returns: 29 | A list of evaluation results (one for each task). Each evaluation result is a 30 | dictionary of metric names and their corresponding values. 31 | """ 32 | evaluator = Evaluator() 33 | results: list[EvaluationResult] = evaluator.evaluate(config) 34 | return [result.task_result for result in results] 35 | -------------------------------------------------------------------------------- /src/oumi/evaluation/registry/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Evaluation registry module.""" 16 | 17 | from oumi.evaluation.registry.berry_bench_task import berry_bench 18 | from oumi.evaluation.registry.count_letters_task import count_letters 19 | 20 | __all__ = [ 21 | "berry_bench", 22 | "count_letters", 23 | ] 24 | -------------------------------------------------------------------------------- /src/oumi/inference/deepseek_inference_engine.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from oumi.inference.remote_inference_engine import RemoteInferenceEngine 16 | 17 | 18 | class DeepSeekInferenceEngine(RemoteInferenceEngine): 19 | """Engine for running inference against the DeepSeek API. 20 | 21 | Documentation: https://api-docs.deepseek.com 22 | """ 23 | 24 | base_url = "https://api.deepseek.com/v1/chat/completions" 25 | """The base URL for the DeepSeek API.""" 26 | 27 | api_key_env_varname = "DEEPSEEK_API_KEY" 28 | """The environment variable name for the DeepSeek API key.""" 29 | -------------------------------------------------------------------------------- /src/oumi/inference/parasail_inference_engine.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Optional 16 | 17 | from typing_extensions import override 18 | 19 | from oumi.inference.remote_inference_engine import RemoteInferenceEngine 20 | 21 | 22 | class ParasailInferenceEngine(RemoteInferenceEngine): 23 | """Engine for running inference against the Parasail API.""" 24 | 25 | @property 26 | @override 27 | def base_url(self) -> Optional[str]: 28 | """Return the default base URL for the Parasail API.""" 29 | return "https://api.parasail.io/v1/chat/completions" 30 | 31 | @property 32 | @override 33 | def api_key_env_varname(self) -> Optional[str]: 34 | """Return the default environment variable name for the Parasail API key.""" 35 | return "PARASAIL_API_KEY" 36 | -------------------------------------------------------------------------------- /src/oumi/inference/together_inference_engine.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Optional 16 | 17 | from typing_extensions import override 18 | 19 | from oumi.inference.remote_inference_engine import RemoteInferenceEngine 20 | 21 | 22 | class TogetherInferenceEngine(RemoteInferenceEngine): 23 | """Engine for running inference against the Together AI API.""" 24 | 25 | @property 26 | @override 27 | def base_url(self) -> Optional[str]: 28 | """Return the default base URL for the Together API.""" 29 | return "https://api.together.xyz/v1/chat/completions" 30 | 31 | @property 32 | @override 33 | def api_key_env_varname(self) -> Optional[str]: 34 | """Return the default environment variable name for the Together API key.""" 35 | return "TOGETHER_API_KEY" 36 | -------------------------------------------------------------------------------- /src/oumi/judges/test_judge/helpful.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "helpful", 3 | "system_prompt": "Act as an impartial judge and evaluate whether the response provided by an AI chatbot to the user request below is helpful.", 4 | "examples": [ 5 | { 6 | "template": "{{ request }}\n{% if context %}{{ context }}{% endif %}\n{% if response %}{{ response }}{% endif %}\n", 7 | "role": "user", 8 | "request": "Give me a brief summary of the history of the Mona Lisa painting without mentioning any specific dates", 9 | "response": "The Mona Lisa is a renowned portrait created by Leonardo da Vinci. It features a woman with an enigmatic smile, believed to be Lisa Gherardini. The painting is celebrated for its intricate detail, use of sfumato technique, and lifelike representation. Over time, it has become one of the most iconic and recognizable artworks in the world, housed in the Louvre Museum in Paris." 10 | } 11 | ], 12 | "value_type": "bool" 13 | } 14 | -------------------------------------------------------------------------------- /src/oumi/judges_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """This module provides access to various judge configurations for the Oumi project. 16 | 17 | The judges are used to evaluate the quality of AI-generated responses based on 18 | different criteria such as helpfulness, honesty, and safety. 19 | """ 20 | 21 | from oumi.judges_v2.base_judge import ( 22 | BaseJudge, 23 | JudgeOutput, 24 | JudgeOutputField, 25 | ) 26 | from oumi.judges_v2.simple_judge import SimpleJudge 27 | 28 | __all__ = [ 29 | "BaseJudge", 30 | "SimpleJudge", 31 | "JudgeOutputField", 32 | "JudgeOutput", 33 | ] 34 | -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/__init__.py: -------------------------------------------------------------------------------- 1 | from .model.language_model.cambrian_llama import ( 2 | CambrianConfig, 3 | CambrianLlamaForCausalLM, 4 | ) 5 | -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/constants.py: -------------------------------------------------------------------------------- 1 | CONTROLLER_HEART_BEAT_EXPIRATION = 30 2 | WORKER_HEART_BEAT_INTERVAL = 15 3 | 4 | LOGDIR = "." 5 | 6 | # Model Constants 7 | IGNORE_INDEX = -100 8 | IMAGE_TOKEN_INDEX = -200 9 | DEFAULT_IMAGE_TOKEN = "" 10 | DEFAULT_IMAGE_PATCH_TOKEN = "" 11 | DEFAULT_IM_START_TOKEN = "" 12 | DEFAULT_IM_END_TOKEN = "" 13 | IMAGE_PLACEHOLDER = "" 14 | -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/model/__init__.py: -------------------------------------------------------------------------------- 1 | from .language_model.cambrian_llama import CambrianConfig, CambrianLlamaForCausalLM 2 | -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/model/language_model/phi3/__init__.py: -------------------------------------------------------------------------------- 1 | from transformers.models.phi3.configuration_phi3 import Phi3Config 2 | 3 | # Consider using Cambrian clone of `modeling_phi3.py`, 4 | # which has some XLA special cases. 5 | from transformers.models.phi3.modeling_phi3 import Phi3ForCausalLM, Phi3Model 6 | -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/model/multimodal_encoder/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/src/oumi/models/experimental/cambrian/model/multimodal_encoder/__init__.py -------------------------------------------------------------------------------- /src/oumi/models/experimental/cambrian/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | from oumi.models.experimental.cambrian.constants import LOGDIR 5 | 6 | server_error_msg = ( 7 | "**NETWORK ERROR DUE TO HIGH TRAFFIC. PLEASE REGENERATE OR REFRESH THIS PAGE.**" 8 | ) 9 | moderation_msg = ( 10 | "YOUR INPUT VIOLATES OUR CONTENT MODERATION GUIDELINES. PLEASE TRY AGAIN." 11 | ) 12 | 13 | # handler = None 14 | 15 | # TODO: move elsewhere? 16 | IS_XLA_AVAILABLE = False 17 | try: 18 | import torch_xla 19 | 20 | IS_XLA_AVAILABLE = True 21 | except ImportError: 22 | pass 23 | -------------------------------------------------------------------------------- /src/oumi/utils/math_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | def is_power_of_two(n: int) -> bool: 17 | """Check if a number is a power of two. 18 | 19 | Args: 20 | n (int): The number to check. 21 | 22 | Returns: 23 | bool: True if n is a power of two, False otherwise. 24 | """ 25 | n = abs(n) 26 | return (n != 0) and (n & (n - 1) == 0) 27 | -------------------------------------------------------------------------------- /src/oumi/utils/version_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 - Oumi 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from importlib import metadata 16 | from importlib.metadata import version 17 | 18 | 19 | def is_dev_build() -> bool: 20 | """Checks if the current version of Oumi is a development build.""" 21 | return ".dev" in version("oumi") 22 | 23 | 24 | def get_python_package_versions() -> dict[str, str]: 25 | """Returns a dictionary of the installed package names and their versions.""" 26 | packages = {} 27 | for distribution in metadata.distributions(): 28 | package_name = distribution.metadata["Name"] 29 | package_version = distribution.version 30 | packages[package_name] = package_version 31 | return packages 32 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | import functools 2 | from pathlib import Path 3 | 4 | 5 | @functools.cache 6 | def get_configs_dir() -> Path: 7 | return (Path(__file__).parent.parent / "configs").resolve() 8 | 9 | 10 | @functools.cache 11 | def get_testdata_dir() -> Path: 12 | return (Path(__file__).parent / "testdata").resolve() 13 | 14 | 15 | @functools.cache 16 | def get_notebooks_dir() -> Path: 17 | return (Path(__file__).parent.parent / "notebooks").resolve() 18 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pytest 4 | 5 | from oumi.core.types.conversation import Conversation, Message, Role 6 | from oumi.utils.logging import get_logger 7 | 8 | 9 | @pytest.fixture 10 | def root_testdata_dir() -> Path: 11 | return Path(__file__).parent / "testdata" 12 | 13 | 14 | @pytest.fixture(scope="session", autouse=True) 15 | def setup_logging(): 16 | """Fixture to set up logging for all tests. 17 | 18 | We want to propagate to the root logger so that 19 | pytest caplog can capture logs, and we can test 20 | logging for the default oumi logger. 21 | """ 22 | logger = get_logger("oumi") 23 | logger.propagate = True 24 | return logger 25 | 26 | 27 | @pytest.fixture(autouse=True) 28 | def retain_logging_level(): 29 | """Fixture to preserve the logging level between tests.""" 30 | logger = get_logger("oumi") 31 | # Store the current log level 32 | log_level = logger.level 33 | yield 34 | # Rehydrate the log level 35 | logger.setLevel(log_level) 36 | 37 | 38 | @pytest.fixture 39 | def single_turn_conversation(): 40 | return Conversation( 41 | messages=[ 42 | Message(role=Role.USER, content="Hello"), 43 | Message(role=Role.ASSISTANT, content="Hi there!"), 44 | ] 45 | ) 46 | -------------------------------------------------------------------------------- /tests/e2e/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from datetime import datetime 3 | from pathlib import Path 4 | 5 | 6 | def get_e2e_test_output_dir(test_name: str, tmp_path: Path) -> Path: 7 | timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") 8 | 9 | if os.environ.get("OUMI_E2E_TESTS_OUTPUT_DIR"): 10 | output_base = Path(os.environ["OUMI_E2E_TESTS_OUTPUT_DIR"]) 11 | else: 12 | output_base = tmp_path / "e2e_tests" 13 | 14 | return output_base / ( 15 | f"{timestamp}" # Only timestamp if test_name is in output_base already. 16 | if f"/{test_name}/" in str(output_base) 17 | else f"{timestamp}_{test_name}" 18 | ) 19 | 20 | 21 | def is_file_not_empty(file_path: Path) -> bool: 22 | """Check if a file is not empty.""" 23 | return file_path.stat().st_size > 0 24 | -------------------------------------------------------------------------------- /tests/e2e/sambanova_infer_tutorial.yaml: -------------------------------------------------------------------------------- 1 | 2 | model: 3 | model_name: "Meta-Llama-3.1-405B-Instruct" 4 | model_max_length: 512 5 | torch_dtype_str: "bfloat16" 6 | trust_remote_code: True 7 | 8 | generation: 9 | max_new_tokens: 128 10 | batch_size: 1 11 | -------------------------------------------------------------------------------- /tests/integration/datasets/test_sft_datasets_load_datasets.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from transformers import AutoTokenizer 3 | 4 | from oumi.core.datasets import BaseSftDataset 5 | from oumi.core.registry import REGISTRY, RegistryType 6 | 7 | 8 | def _get_all_sft_datasets_private_key() -> list[str]: 9 | """List all SFT datasets in the registry.""" 10 | _EXCLUDED_DATASETS = set({"coco_captions", "vision_language_jsonl", "vl_sft"}) 11 | 12 | datasets = [] 13 | for key, value in REGISTRY.get_all(RegistryType.DATASET).items(): 14 | if issubclass(value, BaseSftDataset) and key not in _EXCLUDED_DATASETS: 15 | datasets.append(key) 16 | return datasets 17 | 18 | 19 | @pytest.mark.parametrize("dataset_key", _get_all_sft_datasets_private_key()) 20 | @pytest.mark.skip( 21 | reason="This test is very time consuming, and should be run manually." 22 | ) 23 | def test_sft_datasets(dataset_key: str): 24 | dataset_cls = REGISTRY._registry[(dataset_key, RegistryType.DATASET)] 25 | tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct") 26 | idx = 0 27 | 28 | # Dataset can successfully be loaded 29 | dataset = dataset_cls(tokenizer=tokenizer) 30 | assert dataset.raw(idx) is not None 31 | 32 | # Rows can successfully be pre-processed 33 | assert dataset.conversation(idx) is not None 34 | assert dataset.prompt(idx) is not None 35 | 36 | # Rows can successfully be used for training 37 | assert dataset[idx] is not None 38 | -------------------------------------------------------------------------------- /tests/integration/evaluate/test_evaluate_async.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import tempfile 3 | 4 | from oumi import evaluate_async 5 | from oumi.core.configs import ( 6 | AsyncEvaluationConfig, 7 | EvaluationConfig, 8 | EvaluationTaskParams, 9 | ModelParams, 10 | ) 11 | 12 | 13 | def test_evaluate_async_polling_interval(): 14 | with tempfile.TemporaryDirectory() as output_temp_dir: 15 | start_time = datetime.datetime.now() 16 | config: AsyncEvaluationConfig = AsyncEvaluationConfig( 17 | evaluation=EvaluationConfig( 18 | output_dir=output_temp_dir, 19 | tasks=[ 20 | EvaluationTaskParams( 21 | evaluation_backend="lm_harness", 22 | task_name="mmlu", 23 | num_samples=4, 24 | ) 25 | ], 26 | model=ModelParams( 27 | model_name="openai-community/gpt2", 28 | trust_remote_code=True, 29 | ), 30 | ), 31 | polling_interval=0.5, 32 | num_retries=3, 33 | checkpoints_dir=output_temp_dir, 34 | ) 35 | 36 | evaluate_async(config) 37 | end_time = datetime.datetime.now() 38 | # We should take more than 2 seconds (3 retries = 4 tries total) 39 | assert (end_time - start_time).seconds >= 2 40 | assert (end_time - start_time).seconds < 3 41 | -------------------------------------------------------------------------------- /tests/integration/infer/__init__.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | def get_default_device_map_for_inference() -> str: 5 | return "cuda" if torch.cuda.is_available() else "auto" 6 | -------------------------------------------------------------------------------- /tests/scripts/predownload_for_github_gpu_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script to pre-download common models referenced in tests to reduce test time variance. 4 | # Used in ".github/workflows/gpu_tests.yaml" 5 | set -xe 6 | 7 | export HF_HUB_ENABLE_HF_TRANSFER=1 8 | huggingface-cli download "HuggingFaceTB/SmolLM2-135M-Instruct" --exclude "onnx/*" "runs/*" 9 | huggingface-cli download "Qwen/Qwen2-VL-2B-Instruct" 10 | -------------------------------------------------------------------------------- /tests/testdata/adapter_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "alpha_pattern": {}, 3 | "auto_mapping": null, 4 | "base_model_name_or_path": "meta-llama/Llama-3.2-3B-Instruct", 5 | "bias": "none", 6 | "fan_in_fan_out": false, 7 | "inference_mode": true, 8 | "init_lora_weights": true, 9 | "layer_replication": null, 10 | "layers_pattern": null, 11 | "layers_to_transform": null, 12 | "loftq_config": {}, 13 | "lora_alpha": 128, 14 | "lora_dropout": 0.0, 15 | "megatron_config": null, 16 | "megatron_core": "megatron.core", 17 | "modules_to_save": null, 18 | "peft_type": "LORA", 19 | "r": 64, 20 | "rank_pattern": {}, 21 | "revision": null, 22 | "target_modules": [ 23 | "q_proj", 24 | "v_proj", 25 | "up_proj", 26 | "gate_proj", 27 | "o_proj", 28 | "down_proj" 29 | ], 30 | "task_type": "CAUSAL_LM", 31 | "use_dora": false, 32 | "use_rslora": false 33 | } 34 | -------------------------------------------------------------------------------- /tests/testdata/images/oumi_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/images/oumi_logo_dark.png -------------------------------------------------------------------------------- /tests/testdata/images/oumi_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/images/oumi_logo_light.png -------------------------------------------------------------------------------- /tests/testdata/images/the_great_wave_off_kanagawa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/images/the_great_wave_off_kanagawa.jpg -------------------------------------------------------------------------------- /tests/testdata/pdfs/oumi_getting_started_first_1page.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/pdfs/oumi_getting_started_first_1page.pdf -------------------------------------------------------------------------------- /tests/testdata/pdfs/oumi_getting_started_first_2pages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/pdfs/oumi_getting_started_first_2pages.pdf -------------------------------------------------------------------------------- /tests/testdata/pdfs/oumi_getting_started_full_4pages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oumi-ai/oumi/3ad7ee0bfa076265b2126ab281d3e00f32161eba/tests/testdata/pdfs/oumi_getting_started_full_4pages.pdf -------------------------------------------------------------------------------- /tests/unit/cli/test_cli_alias.py: -------------------------------------------------------------------------------- 1 | from oumi.cli.alias import _ALIASES, AliasType, try_get_config_name_for_alias 2 | 3 | 4 | def test_alias_all_entries(): 5 | for alias in _ALIASES: 6 | for alias_type in _ALIASES[alias]: 7 | config_path = try_get_config_name_for_alias(alias, alias_type) 8 | assert config_path == _ALIASES[alias][alias_type], ( 9 | f"Alias '{alias}' with type '{alias_type}' did not resolve correctly." 10 | f" Expected: {config_path}, Actual: {_ALIASES[alias][alias_type]}" 11 | ) 12 | 13 | 14 | def test_alias_not_found(): 15 | alias = "non_existent_alias" 16 | alias_type = AliasType.TRAIN 17 | config_path = try_get_config_name_for_alias(alias, alias_type) 18 | assert config_path == alias, ( 19 | f"Expected the original alias '{alias}' to be returned." 20 | ) 21 | 22 | 23 | def test_alias_type_not_found(): 24 | alias = "llama4-scout" 25 | config_path = try_get_config_name_for_alias(alias, AliasType.EVAL) 26 | assert config_path == alias, ( 27 | f"Expected the original alias '{alias}' to be returned." 28 | ) 29 | -------------------------------------------------------------------------------- /tests/unit/cli/test_cli_env.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import typer 3 | from typer.testing import CliRunner 4 | 5 | from oumi.cli.env import env 6 | 7 | runner = CliRunner() 8 | 9 | 10 | # 11 | # Fixtures 12 | # 13 | @pytest.fixture 14 | def app(): 15 | fake_app = typer.Typer() 16 | fake_app.command()(env) 17 | yield fake_app 18 | 19 | 20 | def test_env_runs_without_exceptions(app): 21 | result = runner.invoke(app, []) 22 | assert result.exit_code == 0 23 | assert "Oumi environment information:" in result.stdout 24 | -------------------------------------------------------------------------------- /tests/unit/cli/test_cli_speed_regression.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, set_start_method 2 | 3 | 4 | def _verify_no_extra_import(extra_module: str): 5 | """Verifies that extra modules are not imported.""" 6 | import sys 7 | 8 | import oumi.cli.main # noqa 9 | 10 | assert extra_module not in sys.modules, f"{extra_module} was imported." 11 | 12 | 13 | def test_cli_speed_regression_no_torch_dependency(): 14 | # Our CLI should have a relatively clean set of imports. 15 | # Importing torch is a sign that we are importing too much. 16 | set_start_method("spawn", force=True) 17 | process = Process(target=_verify_no_extra_import, args=["torch"]) 18 | process.start() 19 | process.join() 20 | assert process.exitcode == 0, "Torch was imported in the CLI. This is a regression." 21 | 22 | 23 | def test_cli_speed_regression_no_core_dependency(): 24 | # Our CLI should have a relatively clean set of imports. 25 | # Importing oumi.core is a sign that we are importing too much. 26 | set_start_method("spawn", force=True) 27 | process = Process(target=_verify_no_extra_import, args=["oumi.core"]) 28 | process.start() 29 | process.join() 30 | assert process.exitcode == 0, ( 31 | "oumi.core was imported in the CLI. This is a regression." 32 | ) 33 | -------------------------------------------------------------------------------- /tests/unit/conftest.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import MagicMock 2 | 3 | import pytest 4 | 5 | from oumi.builders import build_chat_template 6 | from oumi.core.tokenizers.base_tokenizer import BaseTokenizer 7 | 8 | 9 | @pytest.fixture 10 | def mock_tokenizer(): 11 | mock = MagicMock(spec=BaseTokenizer) 12 | mock.chat_template = build_chat_template(template_name="default") 13 | mock.pad_token_id = 32001 14 | mock.model_max_length = 1024 15 | return mock 16 | -------------------------------------------------------------------------------- /tests/unit/core/configs/internal/test_supported_models.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from oumi.core.configs.internal.supported_models import ( 4 | find_internal_model_config, 5 | find_internal_model_config_using_model_name, 6 | find_model_hf_config, 7 | ) 8 | from oumi.core.configs.params.model_params import ModelParams 9 | 10 | 11 | @pytest.mark.parametrize( 12 | "model_name, trust_remote_code", 13 | [ 14 | ("llava-hf/llava-1.5-7b-hf", False), 15 | ("microsoft/Phi-3-vision-128k-instruct", True), 16 | ("Qwen/Qwen2-VL-2B-Instruct", True), 17 | ("Salesforce/blip2-opt-2.7b", False), 18 | # Access is restricted (gated repo): 19 | # ("meta-llama/Llama-3.2-11B-Vision-Instruct", False), 20 | ], 21 | ) 22 | def test_common_vlm_models(model_name: str, trust_remote_code): 23 | debug_tag = f"model_name: {model_name} trust_remote_code:{trust_remote_code}" 24 | assert ( 25 | find_model_hf_config(model_name, trust_remote_code=trust_remote_code) 26 | is not None 27 | ), debug_tag 28 | 29 | assert ( 30 | find_internal_model_config_using_model_name( 31 | model_name, trust_remote_code=trust_remote_code 32 | ) 33 | is not None 34 | ), debug_tag 35 | 36 | assert ( 37 | find_internal_model_config( 38 | ModelParams(model_name=model_name, trust_remote_code=trust_remote_code) 39 | ) 40 | is not None 41 | ), debug_tag 42 | -------------------------------------------------------------------------------- /tests/unit/core/configs/params/test_data_params.py: -------------------------------------------------------------------------------- 1 | import dataclasses 2 | 3 | import pytest 4 | 5 | from oumi.core.configs.params.data_params import DatasetParams 6 | 7 | 8 | def _get_invalid_field_name_lists() -> list[list[str]]: 9 | all_fields: set[str] = {f.name for f in dataclasses.fields(DatasetParams())} 10 | result = [[field_name] for field_name in all_fields] 11 | result.extend([["valid_kwarg", field_name] for field_name in all_fields][:3]) 12 | return result 13 | 14 | 15 | def _get_test_name_for_invalid_field_name_list(x): 16 | assert isinstance(x, list) 17 | return "--".join(x) 18 | 19 | 20 | @pytest.mark.parametrize( 21 | "field_names", 22 | _get_invalid_field_name_lists(), 23 | ids=_get_test_name_for_invalid_field_name_list, 24 | ) 25 | def test_dataset_params_reserved_kwargs(field_names: list[str]): 26 | invalid_names = {f.name for f in dataclasses.fields(DatasetParams())}.intersection( 27 | field_names 28 | ) 29 | with pytest.raises( 30 | ValueError, 31 | match=( 32 | "dataset_kwargs attempts to override the following reserved fields: " 33 | f"{invalid_names}" 34 | ), 35 | ): 36 | DatasetParams( 37 | dataset_name="DUMMY-NON-EXISTENT", 38 | dataset_kwargs={field_name: "foo_value" for field_name in field_names}, 39 | ) 40 | -------------------------------------------------------------------------------- /tests/unit/core/configs/test_guided_params.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from oumi.core.configs.params.guided_decoding_params import GuidedDecodingParams 4 | 5 | 6 | def test_guided_decoding_params_mutually_exclusive(): 7 | """Test that json, regex, and choice parameters are mutually exclusive.""" 8 | # Valid cases - only one or none specified 9 | GuidedDecodingParams(json={"type": "object"}) 10 | GuidedDecodingParams(regex=r"\d+") 11 | GuidedDecodingParams(choice=["option1", "option2"]) 12 | GuidedDecodingParams() # None specified 13 | 14 | # Invalid cases - multiple specified 15 | error_msg = "Only one of 'json', 'regex', or 'choice' can be specified" 16 | 17 | with pytest.raises(ValueError, match=error_msg): 18 | GuidedDecodingParams(json={"type": "object"}, regex=r"\d+") 19 | 20 | with pytest.raises(ValueError, match=error_msg): 21 | GuidedDecodingParams(json={"type": "object"}, choice=["option1"]) 22 | 23 | with pytest.raises(ValueError, match=error_msg): 24 | GuidedDecodingParams(regex=r"\d+", choice=["option1"]) 25 | 26 | with pytest.raises(ValueError, match=error_msg): 27 | GuidedDecodingParams(json={"type": "object"}, regex=r"\d+", choice=["option1"]) 28 | -------------------------------------------------------------------------------- /tests/unit/core/trainers/test_verl_grpo_trainer.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import MagicMock, patch 2 | 3 | import pytest 4 | 5 | from oumi.core.trainers.verl_grpo_trainer import VerlGrpoTrainer 6 | 7 | try: 8 | verl_import_failed = False 9 | import verl # pyright: ignore[reportMissingImports] # noqa: F401 10 | except ModuleNotFoundError: 11 | verl_import_failed = True 12 | 13 | 14 | @pytest.mark.skipif(verl_import_failed, reason="verl not available") 15 | def test_init_without_verl(): 16 | with patch("oumi.core.trainers.verl_grpo_trainer.verl", None): 17 | with pytest.raises(RuntimeError, match="verl is not installed"): 18 | VerlGrpoTrainer( 19 | processing_class=MagicMock(), 20 | config=MagicMock(), 21 | reward_funcs=[MagicMock()], 22 | train_dataset=MagicMock(), 23 | eval_dataset=MagicMock(), 24 | ) 25 | 26 | 27 | @pytest.mark.skipif(verl_import_failed, reason="verl not available") 28 | def test_init_with_multiple_reward_funcs(): 29 | with pytest.raises(ValueError, match="We only support up to one reward function"): 30 | VerlGrpoTrainer( 31 | processing_class=MagicMock(), 32 | config=MagicMock(), 33 | reward_funcs=[MagicMock(), MagicMock()], 34 | train_dataset=MagicMock(), 35 | eval_dataset=MagicMock(), 36 | ) 37 | -------------------------------------------------------------------------------- /tests/unit/datasets/grpo/rewards/test_count_letters_rewards.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from oumi.datasets.grpo.rewards import compute_letter_count_reward 4 | 5 | 6 | @pytest.mark.parametrize( 7 | "s,target_count,reward", 8 | [ 9 | # No valid answer 10 | ("foo bar 1", 1, -3), 11 | # Valid correct answer 12 | (r"\boxed{1}", 1, 0.0), 13 | # Valid correct answer 14 | (r"\boxed{+1}", 1, 0.0), 15 | # Valid incorrect answer 16 | (r"\boxed{4}", 1, -1.71429), 17 | # Valid incorrect answer 18 | (r"\boxed{-1}", 1, -1.6), 19 | # Invalid answer 20 | (r"The answer is \boxed{one}", 0, -3.0), 21 | # Conflicting answers 22 | (r"\boxed{1} \boxed{2}", 1, -3.0), 23 | # Valid incorrect answer 24 | (r"The number of 'r's in strawberry is \boxed{10}.", 3, -1.86667), 25 | ], 26 | ) 27 | def test_compute_soft_target_token_length_reward(s, target_count, reward): 28 | calculated_reward = compute_letter_count_reward(s, target_count=target_count) 29 | assert calculated_reward == pytest.approx(reward, rel=1e-3) 30 | -------------------------------------------------------------------------------- /tests/unit/datasets/grpo/rewards/test_countdown_rewards.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from oumi.datasets.grpo.rewards import countdown_reward 4 | 5 | 6 | @pytest.mark.parametrize( 7 | "s,nums,target,reward", 8 | [ 9 | # No valid answer 10 | ("foo bar 1", [], 1, 0), 11 | # Valid answer format, incorrect numbers 12 | ("1 + 2", [1, 3], 2, 0), 13 | ("1 / 2", [1, 2, 3], 6, 0), 14 | # Invalid equation 15 | ("", [], 1, 0), 16 | ("1 foo 2 bar 3", [1, 2, 3], 1, 0), 17 | ("1.0 * 2.0 * 3.0", [1, 2, 3], 1, 0), 18 | # Incorrect answer 19 | ("1 + 2 + 3", [1, 2, 3], 1, 0), 20 | (" (1 * 2) / 3", [1, 2, 3], 1, 0), 21 | # Correct answer 22 | (" ( 3 - 2 ) * 1 ", [1, 2, 3], 1, 1), 23 | ("(3-2)*1", [1, 2, 3], 1, 1), 24 | ], 25 | ) 26 | def test_compute_soft_target_token_length_reward(s, nums, target, reward): 27 | ground_truth = {"target": target, "numbers": nums} 28 | assert countdown_reward("data_source", s, ground_truth, {}) == reward 29 | -------------------------------------------------------------------------------- /tests/unit/datasets/test_datasets_demo_examples.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | from oumi.datasets import TextSftJsonLinesDataset 4 | 5 | 6 | def test_data_format_loading(): 7 | """Tests demo examples are correctly loaded in both json and jsonl formats.""" 8 | current_dir = Path(__file__).resolve().parent 9 | data_top_dir = current_dir / "../../../data/dataset_examples" 10 | 11 | for format in ["alpaca", "oumi"]: 12 | all_data = [] 13 | for ending in ["json", "jsonl"]: 14 | current = TextSftJsonLinesDataset( 15 | dataset_path=data_top_dir / (format + "_format." + ending) 16 | ) 17 | all_data.append(current) 18 | 19 | json_datum = all_data[0] 20 | jsonl_datum = all_data[1] 21 | for i in range(len(json_datum)): 22 | assert json_datum.conversation(i) == jsonl_datum.conversation(i), ( 23 | "Data from json and jsonl files should be the same by construction." 24 | ) 25 | -------------------------------------------------------------------------------- /tests/unit/launcher/clients/data/sacct.txt: -------------------------------------------------------------------------------- 1 | JobID JobName User State Reason 2 | ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ 3 | 6 test taenin COMPLETED None 4 | 6.batch batch COMPLETED 5 | 7 cluster_test taenin CANCELLED by 243050679 None 6 | 7.batch batch RUNNING 7 | -------------------------------------------------------------------------------- /tests/unit/utils/test_math_utils.py: -------------------------------------------------------------------------------- 1 | from oumi.utils.math_utils import ( 2 | is_power_of_two, 3 | ) 4 | 5 | 6 | def test_is_power_of_two_basic(): 7 | """Test the is_power_of_two function.""" 8 | assert is_power_of_two(1) 9 | assert is_power_of_two(2) 10 | assert is_power_of_two(4) 11 | assert is_power_of_two(8) 12 | assert is_power_of_two(16) 13 | assert is_power_of_two(2147483648) 14 | 15 | assert not is_power_of_two(3) 16 | assert not is_power_of_two(5) 17 | assert not is_power_of_two(6) 18 | assert not is_power_of_two(7) 19 | assert not is_power_of_two(0) 20 | 21 | # Negative powers of two are considered valid 22 | assert is_power_of_two(-1) 23 | assert is_power_of_two(-2) 24 | assert is_power_of_two(-256) 25 | assert is_power_of_two(-2147483648) 26 | -------------------------------------------------------------------------------- /tests/unit/utils/test_peft_utils.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from oumi.utils.io_utils import save_json 4 | from oumi.utils.peft_utils import get_lora_rank 5 | 6 | 7 | def test_get_lora_rank_fail_no_r(tmp_path): 8 | data = {"base_model_name_or_path": "meta-llama/Llama-3.2-3B-Instruct"} 9 | save_json(data, tmp_path / "adapter_config.json") 10 | 11 | with pytest.raises(ValueError, match="LoRA rank not found in adapter config:"): 12 | get_lora_rank(tmp_path) 13 | 14 | 15 | def test_get_lora_rank_fail_r_not_int(tmp_path): 16 | data = {"base_model_name_or_path": "meta-llama/Llama-3.2-3B-Instruct", "r": "foo"} 17 | save_json(data, tmp_path / "adapter_config.json") 18 | 19 | with pytest.raises(ValueError, match="LoRA rank in adapter config not an int:"): 20 | get_lora_rank(tmp_path) 21 | 22 | 23 | def test_get_lora_rank_successful(root_testdata_dir): 24 | adapter_config_path = root_testdata_dir / "adapter_config.json" 25 | adapter_dir = adapter_config_path.parent 26 | assert get_lora_rank(adapter_dir) == 64 27 | -------------------------------------------------------------------------------- /tests/unit/utils/test_version_utils.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | 5 | from oumi.utils.version_utils import is_dev_build 6 | 7 | 8 | @pytest.fixture 9 | def mock_version(): 10 | with patch("oumi.utils.version_utils.version") as version_mock: 11 | yield version_mock 12 | 13 | 14 | def test_is_dev_build_success(mock_version): 15 | mock_version.return_value = "0.1.0.dev0" 16 | assert is_dev_build() 17 | 18 | 19 | def test_is_dev_build_failure(mock_version): 20 | mock_version.return_value = "0.1.0" 21 | assert not is_dev_build() 22 | --------------------------------------------------------------------------------