MCPcopy Create free account

hub / github.com/FareedKhan-dev/train-llm-from-scratch / functions

Functions604 in github.com/FareedKhan-dev/train-llm-from-scratch

Functiontest_dpo_matches_the_formula_and_label_smoothing_hedges
()
tests/test_post_training_losses.py:22
Functiontest_encode_pair_moves_trailing_spaces_and_scores_boundary_merges
()
tests/test_benchmarks.py:45
Functiontest_ent_coef_subtracts_the_mean_policy_entropy
()
tests/test_ppo_entropy.py:36
Functiontest_environment_variables_are_expanded
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/test_config.py:95
Functiontest_every_shipped_config_loads
(folder: str, name: str)
tests/test_config.py:33
Functiontest_every_stage_trains_and_hands_over_its_checkpoint
(arch: str, data: Path, tmp_path: Path)
tests/test_pipeline_e2e.py:76
Functiontest_extract_answer
(text: str, expected: float | None)
tests/test_answer_parsing.py:36
Functiontest_fast_training_learns_the_same_merges_as_the_textbook_algorithm
()
tests/test_tokenizer.py:69
Functiontest_flops_match_the_model_formula
(extra: dict)
tests/test_model_report.py:20
Functiontest_forward_embedding_works_with_several_blocks
Regression: it used to feed 4x-wide MLP activations into the next block and crash.
tests/test_classic_model.py:26
Functiontest_forward_shapes_and_loss
(name: str)
tests/test_modern_model.py:47
Functiontest_forward_shapes_loss_and_causality
()
tests/test_classic_model.py:15
Functiontest_generate_options
()
tests/test_classic_model.py:42
Functiontest_generation_can_run_past_the_context_window
()
tests/test_modern_model.py:252
Functiontest_gqa_equals_mha_with_shared_heads
GQA with 2 KV heads == MHA whose 4 KV heads are copies (heads 0,1 share KV 0; 2,3 share KV 1).
tests/test_modern_model.py:143
Functiontest_gradient_checkpointing_gives_the_same_gradients
(name: str)
tests/test_modern_model.py:230
Functiontest_greedy_speculative_decoding_equals_greedy_target_decoding
()
tests/test_inference.py:30
Functiontest_group_advantages_std_and_dr_grpo
()
tests/test_post_training_losses.py:55
Functiontest_grpo_default_is_unchanged_and_clip_higher_widens_the_range
()
tests/test_post_training_losses.py:94
Functiontest_gspo_uses_one_ratio_per_answer
()
tests/test_post_training_losses.py:111
Functiontest_indistinguishable_pairs_do_not_crash
()
tests/test_preference_truncation.py:61
Functiontest_int8_linear_is_accurate_and_four_times_smaller
()
tests/test_inference.py:84
Functiontest_ipo_is_zero_at_its_target_gap
()
tests/test_post_training_losses.py:35
Functiontest_kv_cache_matches_full_forward
Prefill 7 tokens, then decode one token at a time: logits must equal a full pass.
tests/test_modern_model.py:75
Functiontest_lambada_scores_greedy_accuracy_and_perplexity
()
tests/test_benchmarks.py:100
Functiontest_late_difference_is_kept_by_shortening_the_prompt
()
tests/test_preference_truncation.py:54
Functiontest_legacy_checkpoint_dims_are_read_from_config
Checkpoints from scripts/train_transformer.py store their sizes under ``config``.
tests/test_checkpoint_io.py:107
Functiontest_legacy_trainer_resumes_from_prefixed_checkpoint
(tmp_path: str)
tests/test_checkpoint_io.py:136
Functiontest_loglik_is_the_sum_over_the_continuation_tokens
()
tests/test_benchmarks.py:53
Functiontest_long_inputs_keep_their_last_tokens
()
tests/test_benchmarks.py:74
Functiontest_long_prompt_and_long_answers_split_the_window
()
tests/test_preference_truncation.py:43
Functiontest_long_prompt_keeps_both_full_answers
()
tests/test_preference_truncation.py:31
Functiontest_lora_learns_and_keeps_the_base_frozen
()
tests/test_lora.py:52
Functiontest_lora_starts_as_the_identity_and_trains_few_params
(make)
tests/test_lora.py:24
Functiontest_loss_aggregation_modes
()
tests/test_post_training_losses.py:63
Functiontest_max_tokens_is_exact
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch, max_tokens: int)
tests/test_data_tools.py:33
Functiontest_merge_gives_the_same_outputs
(make)
tests/test_lora.py:37
Functiontest_min_p_scales_with_the_top_probability
()
tests/test_sampling.py:26
Functiontest_missing_backend_falls_back_to_cpu_with_a_warning
(monkeypatch: pytest.MonkeyPatch)
tests/test_device.py:19
Functiontest_missing_data_explains_how_to_make_it
(monkeypatch: pytest.MonkeyPatch, tmp_path: Path)
tests/test_student_track.py:78
Functiontest_missing_parameters_fail_loudly
(cfg: SFTConfig)
tests/test_checkpoint_io.py:129
Functiontest_mla_caches_much_less_than_mha
()
tests/test_modern_model.py:161
Functiontest_modern_checkpoints_round_trip
(tmp_path: str)
tests/test_factory.py:38
Functiontest_moe_loss_includes_aux_in_training_only_and_active_params_are_smaller
()
tests/test_modern_model.py:180
Functiontest_moe_routes_tokens_and_balancing_loss_trains_the_router
()
tests/test_modern_model.py:168
Functiontest_muon_adamw_groups_match_torch_adamw
()
tests/test_optim.py:44
Functiontest_muon_groups_keep_embeddings_and_head_on_adamw
()
tests/test_optim.py:58
Functiontest_muon_matches_pytorch_reference
()
tests/test_optim.py:25
Functiontest_newton_schulz_flattens_the_singular_values
()
tests/test_optim.py:13
Functiontest_no_budget_keeps_every_token_and_a_bad_budget_is_an_error
(tmp_path: Path, monkeypatch: pytest.MonkeyPa
tests/test_data_tools.py:43
Functiontest_num_tokens_divides_the_summed_loss
()
tests/test_sft_accumulation.py:53
Functiontest_old_prefixed_checkpoints_still_load
Files written before the fix carry ``module._orig_mod.`` keys; they must load as-is.
tests/test_checkpoint_io.py:82
Functiontest_parameter_count_of_the_readme_13m_model
()
tests/test_model_report.py:15
Functiontest_post_training_adds_the_moe_balancing_loss
()
tests/test_modern_model.py:204
Functiontest_post_training_wrappers_accept_the_modern_model
()
tests/test_modern_model.py:266
Functiontest_presets_are_consistent
()
tests/test_student_track.py:84
Functiontest_pretrain_base_resume_continues_and_extends
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/test_resume_data_order.py:131
Functiontest_quantized_models_give_nearly_the_same_logits
(arch: str)
tests/test_inference.py:97
Functiontest_random_pairs_always_fit_and_share_the_prompt
()
tests/test_preference_truncation.py:68
Functiontest_ranks_read_disjoint_slices_of_one_shuffle
(tmp_path: Path)
tests/test_resume_data_order.py:62
Functiontest_reward_checkpoint_loads_for_chat_and_as_reward_model
(cfg: SFTConfig, tmp_path: str)
tests/test_checkpoint_io.py:93
Functiontest_rl_rollouts_use_the_kv_cache_and_sample_the_same_tokens
()
tests/test_modern_model.py:283
Functiontest_rmsnorm_matches_torch
()
tests/test_modern_model.py:134
Functiontest_rope_is_a_rotation_of_each_pair
Pair (x[i], x[i + d/2]) at position m is rotated by the angle m * theta_i.
tests/test_modern_model.py:118
Functiontest_rope_scores_depend_only_on_relative_position
()
tests/test_modern_model.py:104
Functiontest_round_trip_is_lossless
(tok: BPETokenizer, text: str)
tests/test_tokenizer.py:26
Functiontest_round_up_pads_to_64
()
tests/test_student_track.py:92
Functiontest_sampling_keeps_the_target_distribution_whatever_the_draft
()
tests/test_inference.py:68
Functiontest_schedules_hit_their_anchor_points
()
tests/test_optim.py:85
Functiontest_set_overrides_any_config_value
(monkeypatch: pytest.MonkeyPatch, tiny_data: dict[str, str])
tests/test_student_track.py:64
Functiontest_short_pairs_are_encoded_exactly_like_a_full_conversation
()
tests/test_preference_truncation.py:22
Functiontest_simpo_is_reference_free_and_length_normalized
()
tests/test_post_training_losses.py:45
Functiontest_skipped_groups_do_not_shrink_the_update
--filter_groups masks whole answers; every averaging mode must ignore them, not count zeros.
tests/test_post_training_losses.py:71
Functiontest_skipping_continues_the_order_across_epochs
(tmp_path: Path)
tests/test_resume_data_order.py:54
Functiontest_sliding_window_limits_what_a_token_sees
With one block and window w, position t only depends on tokens t-w+1 .. t.
tests/test_modern_model.py:90
Functiontest_smoke_configs_never_overwrite_real_checkpoints
()
tests/test_config.py:40
Functiontest_smoke_shrinks_every_stage
()
tests/test_config.py:101
Functiontest_special_tokens
(tok: BPETokenizer)
tests/test_tokenizer.py:75
Functiontest_specs_round_trip_and_safe_decode
(tok: BPETokenizer, tmp_path)
tests/test_tokenizer.py:82
Functiontest_speculative_decoding_respects_the_trained_window
Each model only sees its last `window` tokens; inside the window the result is exact.
tests/test_inference.py:38
Functiontest_strip_wrapper_prefixes_handles_any_nesting
()
tests/test_checkpoint_io.py:42
Functiontest_temperature_and_greedy
()
tests/test_sampling.py:32
Functiontest_the_entropy_bonus_reaches_the_gradient
()
tests/test_ppo_entropy.py:49
Functiontest_the_meta_device_builds_big_models_without_memory
()
tests/test_model_report.py:28
Functiontest_the_router_learns_from_the_language_modeling_loss
(top_k: int)
tests/test_modern_model.py:194
Functiontest_the_tasks_are_pinned_and_hellaswag_is_not_downloaded
()
tests/test_benchmarks.py:108
Functiontest_tied_embeddings_share_one_matrix
()
tests/test_modern_model.py:223
Functiontest_top_k_keeps_the_k_most_likely
()
tests/test_sampling.py:17
Functiontest_top_p_keeps_the_smallest_set_reaching_p
()
tests/test_sampling.py:21
Functiontest_train_then_generate
(monkeypatch: pytest.MonkeyPatch, tiny_data: dict[str, str], arch: list[str])
tests/test_student_track.py:52
Functiontest_train_transformer_resume_continues_the_data
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/test_resume_data_order.py:99
Functiontest_training_is_deterministic
()
tests/test_tokenizer.py:43
Functiontest_training_learns_frequent_pieces_first
(tok: BPETokenizer)
tests/test_tokenizer.py:30
Functiontest_unknown_keys_fail_with_a_suggestion
(tmp_path: Path)
tests/test_config.py:51
Functiontest_unwrap_model_removes_compile_and_data_parallel
(cfg: SFTConfig)
tests/test_checkpoint_io.py:62
Functiontest_vocab_must_hold_the_bytes
()
tests/test_tokenizer.py:94
Functiontest_wrong_answers_are_not_marked_correct
()
tests/test_answer_parsing.py:40
Functiontest_wrong_values_name_the_field_and_the_file
(tmp_path: Path)
tests/test_config.py:56
Functiontiny_data
(tmp_path_factory: pytest.TempPathFactory)
tests/test_student_track.py:28
Methodto_dict
(self)
src/models/modern/config.py:114
← previousnext →501–600 of 604, ranked by callers