|
AQIT 0.1.0
|
Functions | |
| int | _layer_from_key (str key) |
| str | _matrix_label_from_key (str key) |
| Path | ensure_smoke_lora_checkpoint () |
| bool | _has_lora_keys (dict[str, Any] state) |
| dict[str, Any] | _matrix_entry (*, int layer, str matrix, str module, torch.Tensor delta, float|None base_norm=None) |
| list[dict[str, Any]] | _layer_profile (list[dict[str, Any]] matrices) |
| dict[str, Any] | _finalize_payload (*, str model_id, str mode, str checkpoint_name, str checkpoint_path, str delta_mode, list[dict[str, Any]] matrices, int|None step=None) |
| list[tuple[int, str, str, torch.Tensor, torch.Tensor]] | _iter_tl_matrix_pairs (Any tl_base, Any tl_ft) |
| dict[str, Any] | run_llm_hf_weight_diff (str model_id, str|Path checkpoint_path, *, str checkpoint_name="checkpoint") |
| dict[str, Any] | run_llm_lora_weight_diff (str model_id, dict[str, Any] state_dict, *, str checkpoint_name="checkpoint", str checkpoint_path="", int|None step=None, int lora_r=_DEFAULT_LORA_R, float lora_alpha=_DEFAULT_LORA_ALPHA) |
| dict[str, Any] | run_weight_diff (str model_id, str|Path checkpoint_path, *, str|None checkpoint_name=None) |
| dict[str, Any] | run_weight_diff_from_args (dict[str, Any] args) |
Variables | |
| _LAYER_RE = re.compile(r"(?:^|\.)(?:layers?|layer|block)\.?(\d+)(?:\.|$)", re.I) | |
| int | _DEFAULT_LORA_R = 8 |
| float | _DEFAULT_LORA_ALPHA = 16.0 |
| str | _SMOKE_LORA_PATH = Path.home() / ".aquin" / "smoke" / "weight-diff-lora.pt" |
|
protected |
Definition at line 111 of file weight_diff.py.
References _layer_profile().
Referenced by run_llm_hf_weight_diff(), and run_llm_lora_weight_diff().
|
protected |
Definition at line 66 of file weight_diff.py.
Referenced by run_llm_hf_weight_diff().
|
protected |
Definition at line 147 of file weight_diff.py.
|
protected |
Definition at line 27 of file weight_diff.py.
Referenced by run_llm_hf_weight_diff(), and run_llm_lora_weight_diff().
|
protected |
Definition at line 92 of file weight_diff.py.
Referenced by _finalize_payload().
|
protected |
Definition at line 70 of file weight_diff.py.
Referenced by run_llm_hf_weight_diff(), and run_llm_lora_weight_diff().
|
protected |
Definition at line 32 of file weight_diff.py.
Referenced by run_llm_hf_weight_diff(), and run_llm_lora_weight_diff().
| Path ensure_smoke_lora_checkpoint | ( | ) |
Tiny LoRA state_dict so desktop smoke can run without a real fine-tune.
Definition at line 49 of file weight_diff.py.
Referenced by run_weight_diff_from_args().
| dict[str, Any] run_llm_hf_weight_diff | ( | str | model_id, |
| str | Path | checkpoint_path, | ||
| * | , | ||
| str | checkpoint_name = "checkpoint" ) |
Definition at line 172 of file weight_diff.py.
References _finalize_payload(), _has_lora_keys(), _layer_from_key(), _matrix_entry(), _matrix_label_from_key(), and run_llm_lora_weight_diff().
Referenced by run_weight_diff().
| dict[str, Any] run_llm_lora_weight_diff | ( | str | model_id, |
| dict[str, Any] | state_dict, | ||
| * | , | ||
| str | checkpoint_name = "checkpoint", | ||
| str | checkpoint_path = "", | ||
| int | None | step = None, | ||
| int | lora_r = _DEFAULT_LORA_R, | ||
| float | lora_alpha = _DEFAULT_LORA_ALPHA ) |
Definition at line 239 of file weight_diff.py.
References _finalize_payload(), _layer_from_key(), _matrix_entry(), and _matrix_label_from_key().
Referenced by run_llm_hf_weight_diff().
| dict[str, Any] run_weight_diff | ( | str | model_id, |
| str | Path | checkpoint_path, | ||
| * | , | ||
| str | None | checkpoint_name = None ) |
Definition at line 293 of file weight_diff.py.
References run_llm_hf_weight_diff().
Referenced by run_weight_diff_from_args().
| dict[str, Any] run_weight_diff_from_args | ( | dict[str, Any] | args | ) |
Definition at line 310 of file weight_diff.py.
References ensure_smoke_lora_checkpoint(), and run_weight_diff().
|
protected |
Definition at line 23 of file weight_diff.py.
|
protected |
Definition at line 22 of file weight_diff.py.
|
protected |
Definition at line 21 of file weight_diff.py.
|
protected |
Definition at line 24 of file weight_diff.py.