Skip to content

Commit 2e60489

Browse files
author
Atome LM Team
committed
License flip to Apache 2.0 + 4-report council review fixes
License: replace proprietary 3-tier with Apache 2.0 across LICENSE, NOTICE, CITATION.cff, pyproject.toml (license=Apache-2.0 + OSI classifier), atome_llm/__init__.py, c_engine/upstream/atome.{c,h} SPDX. README rewritten (Gumroad CTA removed; commercial offer reframed as integration + Secure Boot Pack at atomelm.com). LICENSE-APACHE-2.0-V1-PRIOR-RELEASE.txt removed as redundant. Council fixes (4 independent reports in /workspace/Atome LM Research/): - torch.load(weights_only=True) in 6 scripts: demo, evaluate, export_to_atome, export_to_atome_packed, export_to_atome_p3, run_qemu_tinystories - ATOME_TOP_K read from checkpoint config (stats dict) instead of hard-coded default; regression test added in tests/test_export_format.py - C engine bounds checks: atome_predict_next rejects n_tokens<1 + NULL; atome_generate rejects prompt_len<1 / max_tokens<1 + NULL pointers - PAPER.md "600 K default" -> "60 K default" (typo) - atome.c:317 misleading "SSM state persists" comment rewritten to match reset-each-call reality - HONEST_RESULTS.md Bug A marked fixed in both Python and C (cites test_parity_multitoken.py; fix was already in atome.c:296-300) Add .github/workflows/test.yml, CODE_OF_CONDUCT.md, CONTRIBUTING.md, PROJECT_CONTENT.md for the public-repo posture. Tests: 146 passed, 0 skipped (QEMU ARM parity included).
1 parent dfb04dd commit 2e60489

23 files changed

Lines changed: 502 additions & 415 deletions

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
pytest:
12+
name: pytest (Python ${{ matrix.python-version }})
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.10", "3.11", "3.12"]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: pip
28+
29+
- name: Install build essentials + qemu-system-arm
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y --no-install-recommends \
33+
build-essential gcc-arm-none-eabi qemu-system-arm
34+
35+
- name: Install CPU-only PyTorch
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install --index-url https://download.pytorch.org/whl/cpu \
39+
"torch>=2.0"
40+
41+
- name: Install atome-llm + test deps
42+
run: pip install -e ".[dev]"
43+
44+
- name: Environment check
45+
run: python check_env.py
46+
47+
- name: pytest
48+
run: pytest -q

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ c_engine/targets/*/firmware.elf
2323
c_engine/targets/*/firmware.map
2424
c_engine/targets/*/*.o
2525

26-
# Distribution kit zips and source tarballs (ship via Gumroad, not git)
27-
atome-research-kit-v*.zip
26+
# Distribution kit zips and source tarballs
27+
atome-research-kit-*.zip
2828
atomelm-site.zip
2929
dist/*.tar.gz
3030
dist/*.zip

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors:
77
url: "https://atomelm.com"
88
version: "0.3.0"
99
date-released: 2026-05-21
10-
license: LicenseRef-Atome-LM-Proprietary
10+
license: Apache-2.0
1111
keywords:
1212
- "language model"
1313
- "ternary"

CODE_OF_CONDUCT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Code of Conduct
2+
3+
This project follows the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4+
5+
In short: be respectful, assume good faith, and focus discussion on the work. Everyone is welcome to contribute regardless of background or identity. Reports of unacceptable behavior can be sent privately to **hello@atomelm.com** and will be reviewed promptly and confidentially.
6+
7+
The full text of the Contributor Covenant — including the complete enforcement guidelines — is at the link above and applies to this project in full.

CONTRIBUTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Contributing to Atome LM
2+
3+
Thanks for considering a contribution. This is a small, focused project — a tiny ternary language model + a C99 inference engine that talks to it bit-exactly. Read `PROJECT_CONTENT.md` first; it covers what you must not break.
4+
5+
## Quick start
6+
7+
```bash
8+
git clone https://github.com/atome-lm/atome-llm-kit
9+
cd atome-llm-kit
10+
./install.sh
11+
. .venv/bin/activate
12+
pytest -q # expect: 146 passed (or 145 + 1 skipped without qemu-system-arm)
13+
```
14+
15+
## Reporting bugs
16+
17+
Open an issue on GitHub with:
18+
19+
- what you ran (exact command)
20+
- what you expected
21+
- what happened (full error, not paraphrased)
22+
- your platform: OS, Python version, and `python -c "import torch; print(torch.__version__)"`
23+
24+
If you hit a parity failure (Python forward ≠ C forward), please attach the failing seed and any checkpoint you trained — these are the highest-priority bugs.
25+
26+
## Submitting a pull request
27+
28+
1. Fork the repo and create a branch off `main`.
29+
2. Make your change.
30+
3. Run the full test suite — every PR must keep `pytest -q` green.
31+
4. If your change touches `atome_llm/core/`, `c_engine/upstream/`, or the export format, **specifically confirm** these tests still pass:
32+
- `tests/test_parity_with_c.py` — single-forward Python ↔ C parity
33+
- `tests/test_parity_multitoken.py` — multi-token Python ↔ C parity
34+
- `tests/test_export_format.py` — binary format + header generation
35+
5. Open the PR. CI will rerun the suite on Python 3.10 / 3.11 / 3.12.
36+
37+
## Scope of acceptable changes
38+
39+
Welcome:
40+
41+
- Bug fixes
42+
- New test coverage (especially fuzz cases on the C parser and edge inputs to `atome_predict_next` / `atome_generate`)
43+
- Performance improvements that preserve bit-exact parity
44+
- Documentation fixes and clarifications
45+
- New MCU target boards under `c_engine/targets/`, *as long as they don't change the upstream engine*
46+
- New baselines under `atome_llm/baselines/` for honest A/B comparison
47+
48+
Out of scope, please don't open PRs for these:
49+
50+
- Adding heap allocation, dynamic memory, or libc dependencies to `c_engine/upstream/`
51+
- Adding "shouldn't happen" fallbacks to deterministic code paths
52+
- Bundling new tokenizers (BPE / sentencepiece) — the byte tokenizer is a load-bearing design choice for MCU flash budget
53+
- Changes that break Python ↔ C parity, even if they improve a benchmark
54+
- New features that promote code from `c_engine/experiments/` into `c_engine/upstream/` without full parity + bounds-check coverage
55+
56+
## Coding standards
57+
58+
- Python: keep it simple, no helper layers, no decorators-for-style. Match the existing voice — small functions, no premature abstraction, comments only when the *why* is non-obvious.
59+
- C: C99 only, no GNU extensions, no libc beyond `<string.h>` / `<math.h>` / `<stdint.h>`. Static buffers sized by compile-time `ATOME_*` macros. Bounds-check all public API inputs.
60+
61+
## Security
62+
63+
If you find a security issue (anything that lets a malicious checkpoint or `.atome` blob compromise a host running the engine), please email **hello@atomelm.com** instead of filing a public issue. We'll coordinate disclosure.
64+
65+
## License
66+
67+
By submitting a contribution you agree it will be released under the Apache License 2.0 (the project license — see `LICENSE`).

HONEST_RESULTS.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ row (negligible % overhead at 944K).
7979
**Load-bearing but thin:**
8080

8181
- All headline numbers are single-seed.
82-
- Multi-token C generation has a known SSM-state divergence bug
83-
(Bug A) — fixed in Python; the C engine path needs a re-derive of
84-
`atome_generate` to match. Single-forward Python↔C parity is
85-
unaffected and remains bit-exact (`tests/test_parity_with_c.py`).
82+
- Multi-token C generation previously had an SSM-state divergence bug
83+
(Bug A). Fixed in both Python and the C engine: `atome_predict_next`
84+
resets the SSM hidden state and re-derives it from the full token
85+
prefix on every call (`c_engine/upstream/atome.c`). Multi-token
86+
Python↔C parity is covered by `tests/test_parity_multitoken.py`;
87+
single-forward parity remains bit-exact via `tests/test_parity_with_c.py`.
8688
- RP2040 demo currently exceeds 264 KB SRAM at 944K — the MCU claim
8789
is regime-dependent and the launcher in this kit is testing whether
8890
power3 narrows the param budget enough to bring 944K back into scope

0 commit comments

Comments
 (0)