提交

301 次代码提交

作者 SHA1 备注 提交日期
lyogavin 3cdabd5309 chore: refresh star history chart 2026-07-21 08:28:12 +00:00
Gavin Li 60c5a69b4b Merge pull request #307 from lyogavin/fix/star-history-pat
fix(ci): use collaborator PAT for star history refresh
2026-07-20 11:37:24 -05:00
lyogavin bd78cac634 chore: refresh star history chart 2026-07-20 16:35:27 +00:00
Yu Li e57c381652 fix(ci): use collaborator PAT for star history stargazers fetch
GitHub now restricts /stargazers to admins/collaborators, so the Actions
GITHUB_TOKEN 403s. Read STAR_HISTORY_TOKEN instead and surface a clearer error.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 11:27:35 -05:00
Yu Li 33d4e2e39f docs: update Bloome sponsor links to new tracked URL
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 15:32:43 -05:00
lyogavin 4b589bbb67 chore: refresh star history chart 2026-07-12 08:15:59 +00:00
lyogavin 7cfc7c787e chore: refresh star history chart 2026-07-11 07:54:48 +00:00
lyogavin dd5936e51b chore: refresh star history chart 2026-07-10 09:34:31 +00:00
lyogavin d80a7ecb55 chore: refresh star history chart 2026-07-09 09:38:08 +00:00
lyogavin b9e4337f03 chore: refresh star history chart 2026-07-08 08:27:14 +00:00
lyogavin 696aba8f7b chore: refresh star history chart 2026-07-07 09:40:20 +00:00
lyogavin 84c4f0f1ce chore: refresh star history chart 2026-07-06 10:19:22 +00:00
lyogavin 473643d2de chore: refresh star history chart 2026-07-05 08:52:15 +00:00
lyogavin c7801c6204 chore: refresh star history chart 2026-07-04 08:36:36 +00:00
Yu Li 7479b98cff Add dark-mode star history chart with theme auto-switch
Generate light and dark variants and use a <picture> element so the README chart follows the viewer's GitHub theme. The daily workflow now regenerates both.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 21:20:38 -05:00
lyogavin c1cd4f01bf chore: refresh star history chart 2026-07-04 02:11:14 +00:00
Yu Li 3576132de4 Generate real star history chart from authenticated GitHub API
The anonymous star-history.com API is rate-limited and returned an empty chart for this repo, so the embedded image showed no data. Render the chart ourselves (scripts/gen_star_history.py) by sampling stargazer timestamps with a token, output a PNG, and have the daily workflow regenerate it. Replaces the empty SVG.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 21:10:00 -05:00
Yu Li bf8f8a93f1 Serve Star History chart from a committed image + daily refresh
The README embedded the live star-history.com SVG API, which is rate-limited and intermittently fails to render (GitHub Camo caches the error). Commit a static assets/star-history.svg and point the README at it, plus a daily workflow that regenerates the image, with a guard so a rate-limited response never overwrites a good chart.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 21:04:46 -05:00
Yu Li 6436dce154 Fix import airllm failing on clean installs (3.0.1)
- Declare sentencepiece as a dependency: the eagerly-imported Baichuan
  tokenizer needs it, so a fresh `pip install airllm` + `import airllm`
  crashed with ModuleNotFoundError on 3.0.0.
- Make per-model-family imports in __init__ defensive so a missing
  optional dependency for one niche family only warns instead of breaking
  the whole package; the core AutoModel/AirLLMBaseModel path always loads.
- Bump version to 3.0.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
v3.0.1
2026-06-30 18:00:40 -05:00
Yu Li 65c013ad82 Split release workflow into build + publish jobs
Keep the build (and the build-only dry-run) out of the protected `pypi`
environment so dispatching from main no longer fails environment branch
rules. Only the separate, environment-gated publish job runs on real
releases and uploads via OIDC.

Co-authored-by: Cursor <cursoragent@cursor.com>
v3.0.0
2026-06-30 16:55:16 -05:00
Yu Li 07f45114c9 Add PyPI release workflow and make root README the single source of truth
- Add .github/workflows/release.yml: build + publish to PyPI on GitHub
  Release via Trusted Publishing (OIDC), with a tag/version guard, twine
  check, and a build-only dry-run option.
- setup.py reads the top-level README.md (with fallback) so the package
  always ships the current README; refresh the short description.
- Remove the stale air_llm/README.md duplicate and gitignore it (now a
  build-time artifact synced from the root README).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 16:52:19 -05:00
Yu Li 87e8035ab5 Update README: highlight FP8/latest-model support and add Supported Models section
- Refresh hero line and Updates with DeepSeek-V3 (671B, ~12GB) and v3.0.
- Add the (previously missing) Supported Models section: model families plus a
  "tiny GPU, huge models" VRAM table.
- Modernize the Quickstart example to Qwen3-32B with bigger one-line swaps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 22:38:16 -05:00
Yu Li 7a426ebb2b Default runtime dtype to the model's config dtype instead of forcing fp16
AirLLM hardcoded float16 for streaming. On very deep models (e.g. Qwen3-235B-A22B's
94 layers) fp16's narrow range overflows to inf/NaN and silently corrupts the
output (repeated "!"), while shallower models happened to stay in range. Most
modern checkpoints are natively bfloat16, whose wider range avoids this.

dtype now defaults to None and is resolved from config.torch_dtype (handling both
torch.dtype and string forms), falling back to float16 only if unavailable. Users
can still override with dtype=.

Validated: Qwen3-235B-A22B-FP8 produced garbage in fp16 and correct output once
running in its native bf16 (peak ~2.5GB via fp8 streaming).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 21:48:43 -05:00
Yu Li 0a884649d8 Fix split_and_save_layers dropping tensors for layers spanning multiple shards
split_and_save_layers advanced the source shard by only one per layer
("if max(shards) > shard: shard += 1"), so a layer whose tensors span a jump of
more than one shard was persisted missing some tensors. For fp8 checkpoints this
silently dropped the companion weight_scale_inv block scales, producing garbage
output (e.g. Qwen3-235B-A22B-FP8 / Qwen3-30B-A3B-FP8). Single-file checkpoints
(Qwen3-0.6B-FP8) and the on-demand path were unaffected, which masked the bug.

Load every shard up to the highest one a layer references (while-loop) so each
saved layer shard is complete.

Validated on Qwen3-30B-A3B-FP8 (sharded fp8 MoE): correct output, ~0.65GB peak.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 18:32:46 -05:00
Yu Li de984a1276 Support pre-quantized fp8 (block fp8) checkpoints in layer streaming
Pre-quantized fp8 weights (FineGrainedFP8, e.g. DeepSeek-V3, Qwen3 *-FP8) flow
through the normal load path because the quantizer reports param_needs_quantization
== False for them. The old streaming code force-cast every loaded tensor to the
runtime dtype and folded "*weight_scale_inv" into "*weight", which dropped both the
fp8 quantization and the per-block scales and produced garbage output.

- move_layer_to_device now places fp8 weights and their weight_scale_inv scales
  verbatim (no dtype cast), and only casts ordinary high-precision tensors.
- only call create_quantized_param when the quantizer actually needs it; add a
  param_needs_quantization/check_quantized_param compatibility shim.
- _param_names_from_state_dict only collapses bitsandbytes companion tensors
  (.4bit.*/.8bit.*), keeping fp8 weight + weight_scale_inv as distinct params.

Validated on Qwen3-0.6B-FP8 / Qwen3-8B-FP8 (same block-fp8 scheme as DeepSeek-V3):
correct output at ~0.3-1.3GB peak VRAM.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 10:12:59 -05:00
Yu Li 63053d6050 Prefer native transformers impl; fix shard naming and attn fallback
- Load config/model with trust_remote_code=False first, falling back to the
  model's bundled remote code only when transformers doesn't know the arch.
  Vendored remote code (e.g. DeepSeek-V2's modeling_deepseek.py) is often
  pinned to an old transformers and breaks on removed cache APIs like
  DynamicCache.seen_tokens. This makes DeepSeek-V2 (native deepseek_v2) work.
- When sdpa is unavailable, request attn_implementation="eager" explicitly so
  transformers doesn't silently re-select sdpa and error again.
- Read real shard filenames from the index instead of reconstructing them;
  repos vary in zero-padding width (DeepSeek: model-00001-of-000004.safetensors)
  and extension.
- test harness: thread through --delete-original for large-model runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 08:19:38 -05:00
Yu Li 8f62eeca24 Support tied embeddings and route all standard archs through generic model
- Splitter now drops layers with no weights in the checkpoint (tied lm_head),
  fixing both the empty-shard save crash and split-completion detection.
- AirLLMBaseModel detects tied input/output embeddings: it keeps the embedding
  resident on GPU, re-ties lm_head to it, and streams only the decoder layers
  and final norm. Prefetch skips non-streamed indices.
- auto_model now routes any standard *ForCausalLM to the generic
  AirLLMBaseModel and keeps an override table only for legacy custom-code archs
  (ChatGLM, legacy QWen, Baichuan, InternLM). New architectures work with no
  code changes.

Validated bit-exact vs full-load on the GPU box:
- TinyLlama-1.1B (Llama, non-tied): MATCH, 141MB peak.
- Qwen2.5-0.5B (Qwen2, tied): MATCH, 314MB peak.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 18:24:43 -05:00
Yu Li e42a0fecee Rearchitect core to hook-based layer streaming (Phase 2)
Replace the hand-rolled GenerationMixin forward loop with a thin wrapper that
lets transformers own forward/generate and only streams each big module's
weights disk->GPU->meta via forward hooks (with prefetch). This decouples
AirLLM from per-architecture attention/rotary/cache internals, which had broken
against modern transformers (e.g. missing _is_stateful, position_embeddings,
bare-tensor layer outputs).

Validated on the GPU box (RTX 4090, transformers 4.57.3):
- TinyLlama-1.1B: bit-exact vs full-load reference, 141MB peak.
- Qwen2.5-7B (4 shards) capped to 4GB VRAM: correct output, 1.1GB peak.

Also adds a reusable test harness (tests/test_streaming_gpu.py) with a
--max-vram-gb cap and an optional full-load correctness comparison.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 18:18:49 -05:00
Yu Li 9478b3f2fe Fix airllm install/import and single-file model splitting
- Drop optimum BetterTransformer dependency (removed upstream; crashed on
  import with transformers>=4.49). Use built-in attn_implementation="sdpa".
- Remove post-install transformers auto-upgrade and pin a tested dependency
  range (transformers>=4.49,<5.13) so a plain pip install is reproducible.
- Handle single-file checkpoints (model.safetensors / pytorch_model.bin with
  no index.json) in the splitter, and download the single weight file on
  demand instead of skipping it.
- Bump version to 3.0.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 18:02:18 -05:00
Yu Li 75436d16b4 adjust layout 2026-06-18 09:15:51 -05:00
Yu Li 006c7f5d27 add Bloome recommendation 2026-06-18 09:10:51 -05:00
Yu Li aa2a6f6936 Add funding.json for open source funding transparency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 06:42:26 -05:00
Gavin Li 90d7eb6b2d Fix formatting of AI agents recommendation list 2025-09-03 08:50:08 -05:00
Gavin Li d2273124a5 Update README.md 2025-09-03 08:49:45 -05:00
Gavin Li 587d8ec743 Update README.md 2025-05-06 08:11:40 -05:00
Gavin Li 2b49756c2f Merge pull request #195 from moresearch/patch-1
Update README.md
2024-11-24 17:32:28 -06:00
Mo 7da0121e6b Update README.md
Fixes a typo!
2024-10-27 12:58:38 -03:00
Gavin Li 54475e3c1d Merge pull request #184 from eltociear/patch-2
docs: update README.md
2024-09-25 13:01:30 -05:00
Ikko Eltociear Ashimine 84775762ee docs: update README.md
probabaly -> probably
2024-09-26 02:10:45 +09:00
Yu Li b8c69d7175 Merge branch 'main' of github.com:lyogavin/airllm 2024-09-20 22:19:40 -05:00
Yu Li 40c15e61e2 support qwen2.5 2024-09-20 22:19:36 -05:00
Gavin Li 6195bb4fc1 Update README.md 2024-09-05 09:05:24 -05:00
Gavin Li b0ed8bb9ab Merge pull request #176 from chinkan/main
Fix pip not found when install in Jupyter
2024-08-28 11:13:09 -05:00
Kan Cheung 9bb61fa600 updated to english warning 2024-08-26 17:05:59 +08:00
Kan Cheung 122b5c182d try fix pip not found in jupyter 2024-08-26 16:46:28 +08:00
Yu Li 1c1eafdd64 Merge branch 'main' of github.com:lyogavin/airllm 2024-08-23 09:38:52 -05:00
Yu Li 527effa731 #174 fix mlx model load 2024-08-23 09:38:46 -05:00
Gavin Li bf9a07059d Merge pull request #174 from Razikus/fix/mlx_model_str
Fixing mlx model load
2024-08-21 20:30:17 -05:00
Adam Raźniewski dcaf68574e Fixing mlx model load 2024-08-19 13:07:06 +02:00
Yu Li e64b76ac78 2.10.1 2024-08-18 11:48:26 -05:00