├── IMPLEMENTATION_ANALYSIS.md ├── LICENSE ├── README.md ├── custom_gradient_checkpointing.py ├── data_loading_compatibility.py ├── device_utils.py ├── energy_inference_schedule.py ├── energy_rl.py ├── energy_rl_train.py ├── energy_utils.py ├── evaluation.py ├── grpo.py ├── grpo_data.py ├── grpo_train.py ├── h_bitlinear.py ├── inference.py ├── intrinsic_baseline.py ├── llama_model.py ├── model_utils.py ├── new-model-architecture-creation.py ├── quantization_utils.py ├── quantized_model_io.py ├── requirements.txt ├── reward_model.py ├── reward_train.py ├── reward_utils.py ├── scripts ├── ce_training.sh ├── evaluate.py ├── grpo_training.sh ├── grpo_two_rewards.sh ├── mgrpo_gsm8k.sh ├── mgrpo_math.sh ├── mgrpo_minerva.sh ├── mgrpo_olympiadbench.sh ├── paper_config.json ├── run_mgrpo_reasoning.py └── two_reward_config.json ├── simple_reward_model.py ├── tests ├── __init__.py ├── data │ ├── contrastive_pairs.jsonl │ └── reasoning_dataset.json ├── reward_config.json ├── test_bitlinear.py ├── test_checkpoint.py ├── test_cli_scripts.py ├── test_config.py ├── test_dataset_loading.py ├── test_energy_inference_schedule.py ├── test_energy_rl.py ├── test_energy_train_script.py ├── test_energy_utils.py ├── test_evaluation.py ├── test_grpo_data.py ├── test_grpo_integration.py ├── test_h_bitlinear.py ├── test_inference_integration.py ├── test_lowbit_kernel.py ├── test_mgrpo.py ├── test_model_utils.py ├── test_pack_utils.py ├── test_prompt_templates.py ├── test_quantization.py ├── test_quantized_model_io.py ├── test_reasoning_dataset.py ├── test_resume.py ├── test_reward_model.py ├── test_reward_train.py ├── test_reward_utils.py ├── test_simple_reward_model.py ├── test_size_reporting.py └── test_trainingv2_script.py ├── training_utils.py └── trainingv2.py /IMPLEMENTATION_ANALYSIS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/IMPLEMENTATION_ANALYSIS.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/README.md -------------------------------------------------------------------------------- /custom_gradient_checkpointing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/custom_gradient_checkpointing.py -------------------------------------------------------------------------------- /data_loading_compatibility.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/data_loading_compatibility.py -------------------------------------------------------------------------------- /device_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/device_utils.py -------------------------------------------------------------------------------- /energy_inference_schedule.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/energy_inference_schedule.py -------------------------------------------------------------------------------- /energy_rl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/energy_rl.py -------------------------------------------------------------------------------- /energy_rl_train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/energy_rl_train.py -------------------------------------------------------------------------------- /energy_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/energy_utils.py -------------------------------------------------------------------------------- /evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/evaluation.py -------------------------------------------------------------------------------- /grpo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/grpo.py -------------------------------------------------------------------------------- /grpo_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/grpo_data.py -------------------------------------------------------------------------------- /grpo_train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/grpo_train.py -------------------------------------------------------------------------------- /h_bitlinear.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/h_bitlinear.py -------------------------------------------------------------------------------- /inference.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/inference.py -------------------------------------------------------------------------------- /intrinsic_baseline.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/intrinsic_baseline.py -------------------------------------------------------------------------------- /llama_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/llama_model.py -------------------------------------------------------------------------------- /model_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/model_utils.py -------------------------------------------------------------------------------- /new-model-architecture-creation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/new-model-architecture-creation.py -------------------------------------------------------------------------------- /quantization_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/quantization_utils.py -------------------------------------------------------------------------------- /quantized_model_io.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/quantized_model_io.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/requirements.txt -------------------------------------------------------------------------------- /reward_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/reward_model.py -------------------------------------------------------------------------------- /reward_train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/reward_train.py -------------------------------------------------------------------------------- /reward_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/reward_utils.py -------------------------------------------------------------------------------- /scripts/ce_training.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/ce_training.sh -------------------------------------------------------------------------------- /scripts/evaluate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/evaluate.py -------------------------------------------------------------------------------- /scripts/grpo_training.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/grpo_training.sh -------------------------------------------------------------------------------- /scripts/grpo_two_rewards.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/grpo_two_rewards.sh -------------------------------------------------------------------------------- /scripts/mgrpo_gsm8k.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/mgrpo_gsm8k.sh -------------------------------------------------------------------------------- /scripts/mgrpo_math.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/mgrpo_math.sh -------------------------------------------------------------------------------- /scripts/mgrpo_minerva.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/mgrpo_minerva.sh -------------------------------------------------------------------------------- /scripts/mgrpo_olympiadbench.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/mgrpo_olympiadbench.sh -------------------------------------------------------------------------------- /scripts/paper_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/paper_config.json -------------------------------------------------------------------------------- /scripts/run_mgrpo_reasoning.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/run_mgrpo_reasoning.py -------------------------------------------------------------------------------- /scripts/two_reward_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/scripts/two_reward_config.json -------------------------------------------------------------------------------- /simple_reward_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/simple_reward_model.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/contrastive_pairs.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/data/contrastive_pairs.jsonl -------------------------------------------------------------------------------- /tests/data/reasoning_dataset.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/data/reasoning_dataset.json -------------------------------------------------------------------------------- /tests/reward_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/reward_config.json -------------------------------------------------------------------------------- /tests/test_bitlinear.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_bitlinear.py -------------------------------------------------------------------------------- /tests/test_checkpoint.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_checkpoint.py -------------------------------------------------------------------------------- /tests/test_cli_scripts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_cli_scripts.py -------------------------------------------------------------------------------- /tests/test_config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_config.py -------------------------------------------------------------------------------- /tests/test_dataset_loading.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_dataset_loading.py -------------------------------------------------------------------------------- /tests/test_energy_inference_schedule.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_energy_inference_schedule.py -------------------------------------------------------------------------------- /tests/test_energy_rl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_energy_rl.py -------------------------------------------------------------------------------- /tests/test_energy_train_script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_energy_train_script.py -------------------------------------------------------------------------------- /tests/test_energy_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_energy_utils.py -------------------------------------------------------------------------------- /tests/test_evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_evaluation.py -------------------------------------------------------------------------------- /tests/test_grpo_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_grpo_data.py -------------------------------------------------------------------------------- /tests/test_grpo_integration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_grpo_integration.py -------------------------------------------------------------------------------- /tests/test_h_bitlinear.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_h_bitlinear.py -------------------------------------------------------------------------------- /tests/test_inference_integration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_inference_integration.py -------------------------------------------------------------------------------- /tests/test_lowbit_kernel.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_lowbit_kernel.py -------------------------------------------------------------------------------- /tests/test_mgrpo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_mgrpo.py -------------------------------------------------------------------------------- /tests/test_model_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_model_utils.py -------------------------------------------------------------------------------- /tests/test_pack_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_pack_utils.py -------------------------------------------------------------------------------- /tests/test_prompt_templates.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_prompt_templates.py -------------------------------------------------------------------------------- /tests/test_quantization.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_quantization.py -------------------------------------------------------------------------------- /tests/test_quantized_model_io.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_quantized_model_io.py -------------------------------------------------------------------------------- /tests/test_reasoning_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_reasoning_dataset.py -------------------------------------------------------------------------------- /tests/test_resume.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_resume.py -------------------------------------------------------------------------------- /tests/test_reward_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_reward_model.py -------------------------------------------------------------------------------- /tests/test_reward_train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_reward_train.py -------------------------------------------------------------------------------- /tests/test_reward_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_reward_utils.py -------------------------------------------------------------------------------- /tests/test_simple_reward_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_simple_reward_model.py -------------------------------------------------------------------------------- /tests/test_size_reporting.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_size_reporting.py -------------------------------------------------------------------------------- /tests/test_trainingv2_script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/tests/test_trainingv2_script.py -------------------------------------------------------------------------------- /training_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/training_utils.py -------------------------------------------------------------------------------- /trainingv2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kotak-ai/1.58BitNet/HEAD/trainingv2.py --------------------------------------------------------------------------------