Skip to content

Commit bbad44f

Browse files
committed
Merge Kimi preparation fixes with the core and CLI reorganization
Kimi preparation must retain its memory and speculation behavior through the core API rename and the split between the Flare library and CLI. Preserving both histories keeps the application changes and reviewed model preparation work available on main. Replace remaining package-module references with core-module references, regenerate the runtime protobuf bindings, and preserve recorded graph owners, mtp-only catalogs, scoped weight conversion, and DFlash2 preparation. Adapt query-gather overlap to capacity-keyed components and make both candidate exchange alternatives consume the joined query dependency. Keep index-history selection before latent-history staging overwrites their shared storage. Update the Cargo CLI alias and pin FlashInfer to its published main revision. The merged preparation paths preserve bounded ownership and serialization compatibility while retaining upstream query overlap and prefill routing. No serving performance improvement is claimed by this merge. CLI and Heliopause release builds passed. The CLI inspected the existing Kimi TP16 core, and the recorded CUDA graph export smoke test passed. Native graph recording, weight-reuse envelope, core-combination, and mtp-only tests passed. Focused Python suites passed except two unchanged collective-ladder fixtures. The TP16 overlap checks pass cache, selection, dependency, and earlier replay cases, but fail an exact eager-versus-compiled serial output comparison at the repeated 17-token context. Both candidate exchanges differ in the same nine bytes. The serial attention implementation from dfea287 reproduces those same bytes under identical inputs and bounds. Track this unresolved numerical issue in docs/TODO.txt. No full-model re-export or serving validation was performed. Design-Signed-Off-By: Codex (GPT-6); design-review=cfcf
2 parents dfea287 + 8c2e782 commit bbad44f

516 files changed

Lines changed: 34318 additions & 7819 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.cargo/config.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[alias]
2-
flare = ["run", "--release", "--manifest-path", "flare/Cargo.toml", "--"]
2+
flare = ["run", "--release", "--manifest-path", "flare-cli/Cargo.toml", "--"]

‎.dockerignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ flare/**
88
!flare/Cargo.lock
99
!flare/src/
1010
!flare/src/**
11+
!flare-cli/
12+
flare-cli/**
13+
!flare-cli/Cargo.toml
14+
!flare-cli/Cargo.lock
15+
!flare-cli/src/
16+
!flare-cli/src/**
1117
!helios/
1218
helios/**
1319
!helios/Cargo.toml

‎.github/workflows/native-serving.yml‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,44 @@ jobs:
4242
'C:\Program Files\NASM' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
4343
- name: Build native serving
4444
id: build
45-
run: cargo build --locked --release --manifest-path flare/Cargo.toml
45+
run: cargo build --locked --release --manifest-path flare-cli/Cargo.toml
4646
- name: Test host OS helpers
47-
run: cargo test --locked --release --manifest-path eos/Cargo.toml --target-dir flare/target
47+
run: cargo test --locked --release --manifest-path eos/Cargo.toml --target-dir flare-cli/target
4848
- name: Test Selene and its manager on Linux
4949
if: runner.os == 'Linux'
5050
run: |
51-
cargo test --locked --release --manifest-path selene/Cargo.toml --features test-support --target-dir flare/target
52-
cargo test --locked --release --manifest-path selene-manager/Cargo.toml --features test-support --target-dir flare/target
51+
cargo test --locked --release --manifest-path selene/Cargo.toml --features test-support --target-dir flare-cli/target
52+
cargo test --locked --release --manifest-path selene-manager/Cargo.toml --features test-support --target-dir flare-cli/target
5353
- name: Test host cache tiers on Windows
5454
if: runner.os == 'Windows'
55-
run: cargo test --locked --release --manifest-path selene/Cargo.toml --target-dir flare/target
55+
run: cargo test --locked --release --manifest-path selene/Cargo.toml --target-dir flare-cli/target
5656
- name: Test native runtime on Linux
5757
if: runner.os == 'Linux'
5858
env:
5959
FLARE_TEST_TEMPLATE_DIR: ${{ runner.temp }}/flare-test-templates
6060
run: |
6161
ulimit -l
6262
sudo prlimit --pid $$ --memlock=67108864:67108864
63-
cargo test --locked --release --manifest-path helios/Cargo.toml --target-dir flare/target --features runtime-package,server
63+
cargo test --locked --release --manifest-path helios/Cargo.toml --target-dir flare-cli/target --features runtime-core,server
6464
- name: Test native runtime on Windows
6565
if: runner.os == 'Windows'
6666
env:
6767
FLARE_TEST_TEMPLATE_DIR: ${{ runner.temp }}/flare-test-templates
68-
run: cargo test --locked --release --manifest-path helios/Cargo.toml --target-dir flare/target --features runtime-package,server
68+
run: cargo test --locked --release --manifest-path helios/Cargo.toml --target-dir flare-cli/target --features runtime-core,server
6969
- name: Test native CLI
7070
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
7171
env:
7272
FLARE_TEST_TEMPLATE_DIR: ${{ runner.temp }}/flare-test-templates
73-
run: cargo test --locked --release --manifest-path flare/Cargo.toml
73+
run: cargo test --locked --release --manifest-path flare-cli/Cargo.toml
74+
- name: Test shared application workflows
75+
env:
76+
FLARE_TEST_TEMPLATE_DIR: ${{ runner.temp }}/flare-test-templates
77+
run: cargo test --locked --release --manifest-path flare/Cargo.toml --target-dir flare-cli/target
7478
- name: Exercise native Windows executable
7579
if: runner.os == 'Windows'
7680
shell: pwsh
7781
run: |
78-
$exe = '.\flare\target\release\flare.exe'
82+
$exe = '.\flare-cli\target\release\flare.exe'
7983
& $exe --help
8084
if ($LASTEXITCODE -ne 0) { throw "$exe --help failed" }
8185
& $exe --version
@@ -87,7 +91,7 @@ jobs:
8791
if: runner.os == 'Windows'
8892
run: |
8993
rustup component add rust-docs
90-
python packaging/archive.py --binary flare/target/release/flare.exe --target ${{ matrix.target }} --output flare-windows-native.zip
94+
python packaging/archive.py --binary flare-cli/target/release/flare.exe --target ${{ matrix.target }} --output flare-windows-native.zip
9195
- uses: actions/upload-artifact@v4
9296
if: runner.os == 'Windows'
9397
with:
@@ -106,4 +110,4 @@ jobs:
106110
run: |
107111
cargo check --locked --manifest-path selene/Cargo.toml --tests --features rdma
108112
cargo check --locked --manifest-path selene-manager/Cargo.toml --tests --features rdma
109-
cargo check --locked --manifest-path flare/Cargo.toml --tests --features roce,rdma
113+
cargo check --locked --manifest-path flare-cli/Cargo.toml --tests --features roce,rdma

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ __pycache__/
22
*.py[cod]
33
.pytest_cache/
44
.venv/
5+
/.local-dev/
6+
/flare-cli/target/
7+
/flare-winui/bridge/target/
8+
/flare-winui/launcher/target/
59
*.egg-info/
610
/build/
711
/dist/

‎AGENTS.md‎

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
Flare is a local inference server for NVIDIA SM103/SM120/SM121 GPUs. Ignition, the
44
Python package in `ignition/`, prepares models with PyTorch, Transformers, and
55
FlashInfer, including b12x. Its `flare_heliopause` extension is built by the
6-
`heliopause/` crate. The Rust CLI in `flare/` links Helios, the runtime library
7-
in `helios/`, to serve requests through prepared CUDA graphs. Both Flare and
8-
Heliopause depend on Helios; Helios has no Python or preparation-tool dependency.
6+
`heliopause/` crate. The Rust CLI in `flare-cli/` uses the application library in
7+
`flare/`, which links the Helios runtime in `helios/` to serve requests through
8+
prepared CUDA graphs. Flare and Heliopause depend on Helios; Helios has no Python
9+
or preparation-tool dependency.
910

1011
## Required setup and commit review
1112

@@ -115,7 +116,7 @@ and a fixed-length template are not.
115116
Flare prepares and serves supported model recipes on NVIDIA GPUs through
116117
FlashInfer/b12x and prepared CUDA graphs. Single-host execution and cross-node
117118
tensor parallelism are both in scope. Orbit manages the hosts, preparation,
118-
packages, and rank processes needed for those serving workflows.
119+
cores, and rank processes needed for those serving workflows.
119120

120121
Every contribution must address an explicit maintainer request, a demonstrated
121122
defect, a measured performance or memory problem, or inaccurate documentation.
@@ -136,7 +137,7 @@ alone do not establish a need for a change.
136137
be used to bypass them.
137138
- **Reject weakened guarantees.** Preserve complete cache and speculative state,
138139
inactive-row behavior, asynchronous resource lifetimes, checkpoint precision,
139-
model semantics, and the declared model package contract. Do not remove
140+
model semantics, and the declared model core contract. Do not remove
140141
validation, suppress errors, silently substitute execution paths, or relax references,
141142
workloads, or numerical bounds to obtain passing checks or favorable metrics.
142143
Numerical bounds must follow the required arithmetic and measured repeatability.
@@ -180,7 +181,7 @@ and hardware sections of the preparation guide.
180181
| Add or change a model recipe or execution component | [Model development](docs/model-development.md), [preparation development](docs/preparation-development.md), and the relevant [core design](docs/core-design.md#2-model-preparation) sections |
181182
| Change tuning, compilation, memory planning, capture, or TP preparation | [Preparation development](docs/preparation-development.md) and [preparation resources](docs/model-preparation.md#preparation-resources) |
182183
| Change Helios runtime, scheduling, caches, transport, or frontend | [Prepared model contract](helios/model-contract.md), [execution manifest](helios/manifest.md), and the relevant [Helios runtime](helios/README.md) and [core design](docs/core-design.md#3-helios-runtime-and-graph-interface) sections |
183-
| Change Protobuf metadata or package loading/export | [Runtime package design](docs/runtime-package-design.md), [prepared model contract](helios/model-contract.md), and [package compatibility](#model-package-compatibility) |
184+
| Change Protobuf metadata or core loading/export | [Runtime core design](docs/runtime-core-design.md), [prepared model contract](helios/model-contract.md), and [core compatibility](#model-core-compatibility) |
184185
| Diagnose or optimize performance | [GPU performance work](docs/performance-work.md), plus model or preparation development guidance for affected code |
185186
| Change CLI, API, or configuration behavior | [CLI design](docs/cli-design.md) and the relevant [API](docs/api.md) sections |
186187

@@ -195,7 +196,7 @@ Run commands from the repository root:
195196

196197
```sh
197198
uv sync --locked --extra prepare --extra test
198-
cargo build --release --manifest-path flare/Cargo.toml
199+
cargo build --release --manifest-path flare-cli/Cargo.toml
199200
```
200201

201202
After changing `heliopause/` or Helios code used by the extension, rebuild the
@@ -209,33 +210,33 @@ The [preparation guide](docs/model-preparation.md) owns dependency updates,
209210
local FlashInfer installation, GPU selection, compiler and tuning resources,
210211
model-specific launch instructions, and hardware setup. The
211212
[CLI design](docs/cli-design.md) defines flags, configuration, signing, and
212-
package selection.
213+
core selection.
213214

214215
Use the preparation guide's [DeepSeek V4.1](docs/model-preparation.md#deepseek-v41-flash)
215216
or [DeepSeek V4](docs/model-preparation.md#deepseek-v4-flash) commands for those
216217
models. For repeated exports with compatible weights, follow
217218
[re-exporting with cached weights](docs/model-preparation.md#re-exporting-with-cached-weights).
218219

219-
For serving-only Rust changes, rebuild Flare and load a compatible package.
220-
To exercise changes to prepared kernels, capacities, or the package format,
221-
export a package containing those changes. Packages must satisfy the declared
222-
[package contract](#model-package-compatibility). Changing prepared kernels or
220+
For serving-only Rust changes, rebuild Flare and load a compatible core.
221+
To exercise changes to prepared kernels, capacities, or the core format,
222+
export a core containing those changes. Cores must satisfy the declared
223+
[core contract](#model-core-compatibility). Changing prepared kernels or
223224
capacities requires re-export; an engine upgrade does not.
224-
Launch an exported package with `flare/target/release/flare run PACKAGE` when
225+
Launch an exported core with `flare-cli/target/release/flare run CORE` when
225226
testing a local build. Stop Flare with Ctrl-C or SIGTERM so native replay drains
226227
before CUDA resources are released.
227228

228229
`ignition debug-serve` is only for diagnosing model and preparation faults.
229230
Do not use it for actual serving or apples-to-apples performance comparisons
230231
against other runtimes, including its native, `--direct`, and `--eager` modes.
231-
Use `ignition export` followed by `flare run PACKAGE` for those workflows.
232+
Use `ignition export` followed by `flare run CORE` for those workflows.
232233
Debug execution retains preparation resources and bounded preparation caches;
233-
its process, memory, and loading paths differ from native package serving.
234+
its process, memory, and loading paths differ from native core serving.
234235

235236
For debugging without export, native `ignition debug-serve` requires Heliopause's
236237
`qualification` Cargo feature. Diagnostic `ignition debug-serve --direct` does not.
237238
Follow the
238-
[development launch instructions](docs/cli-design.md#development-without-package-export).
239+
[development launch instructions](docs/cli-design.md#development-without-core-export).
239240

240241
## Architecture and ownership
241242

@@ -310,8 +311,8 @@ architectural boundary before committing the change.
310311

311312
- Python loads weights, resolves and autotunes kernels, plans storage, warms
312313
execution paths, and captures supported graph variants before serving starts.
313-
`ignition export` writes a runtime package and closes the prepared model.
314-
`flare run PACKAGE` loads that package in a separate Rust serving process.
314+
`ignition export` writes a runtime core and closes the prepared model.
315+
`flare run CORE` loads that core in a separate Rust serving process.
315316
- Helios owns sockets, request processing, tokenization, chat templates,
316317
scheduling, cache operations, graph replay, and output streaming. Serving
317318
must not call back into Python.
@@ -330,20 +331,20 @@ architectural boundary before committing the change.
330331
Prefix reuse, branching, and speculative rollback must preserve all relevant
331332
state, not just token positions and KV pages.
332333

333-
## Model package compatibility
334+
## Model core compatibility
334335

335336
- Every engine version must load models supported by previous engine versions
336337
without re-export, re-signing, or changes to captured graphs. Preserve loading
337-
and serving compatibility when changing package metadata, storage contracts,
338-
and execution code. Retain readers and tests needed by existing packages.
338+
and serving compatibility when changing core metadata, storage contracts,
339+
and execution code. Retain readers and tests needed by existing cores.
339340
- Execution ABI numbers are descriptive metadata, not loading gates. Validate
340341
actual graph operations, buffer layouts, capacities, and dependencies. Protobuf
341-
additions must use defaults that preserve existing package behavior; an absent
342+
additions must use defaults that preserve existing core behavior; an absent
342343
or zero completion token capacity means eight.
343344
- Version semantic changes without abandoning previously supported models.
344345
Reserve removed Protobuf fields and enum values. Preserve signature, resource,
345-
hardware, and structural validation. Test previous package layouts through
346-
loading and serving alongside newly exported packages.
346+
hardware, and structural validation. Test previous core layouts through
347+
loading and serving alongside newly exported cores.
347348

348349
## Configuration
349350

@@ -392,7 +393,7 @@ domain, and TLA+ for protocol states and asynchronous ordering. Add only the
392393
checks the affected behavior needs. A passing model does not establish Rust
393394
conformance or CUDA correctness; validate those boundaries separately.
394395

395-
- Compare other runtimes against an exported package running through `flare run`.
396+
- Compare other runtimes against an exported core running through `flare run`.
396397
Timings from `ignition debug-serve` are diagnostic measurements and cannot
397398
establish comparative serving performance.
398399
- When a potential correctness, memory, or performance deficiency appears in

‎Dockerfile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN apt-get update \
1616

1717
WORKDIR /src
1818
COPY flare/ flare/
19+
COPY flare-cli/ flare-cli/
1920
COPY helios/ helios/
2021
COPY eos/ eos/
2122
COPY selene/ selene/
@@ -26,9 +27,9 @@ COPY ignition/recipes/kimi3/assets/ ignition/recipes/kimi3/assets/
2627

2728
ARG TARGETARCH
2829
RUN --mount=type=cache,target=/usr/local/cargo/registry \
29-
--mount=type=cache,id=flare-target-${TARGETARCH},target=/src/flare/target \
30-
cargo build --locked --release --manifest-path flare/Cargo.toml --bin flare \
31-
&& install -Dm755 flare/target/release/flare /out/flare \
30+
--mount=type=cache,id=flare-target-${TARGETARCH},target=/src/flare-cli/target \
31+
cargo build --locked --release --manifest-path flare-cli/Cargo.toml --bin flare \
32+
&& install -Dm755 flare-cli/target/release/flare /out/flare \
3233
&& strip /out/flare
3334

3435
FROM debian:trixie-slim

‎README.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<p align="center">
2-
<img src="docs/images/flare-wordmark.png" alt="Flare — ASCII wordmark above a solar flare" width="912">
2+
<img src="docs/images/hyperflare.png" alt="Flare — ASCII wordmark above a supermassive solar flare" width="912">
33
</p>
44

55
> **Coding agents:** skip this README and read [AGENTS.md](AGENTS.md) directly.
66
7-
Flare is a local inference server for NVIDIA SM120/SM121 GPUs, built for
7+
Hyperflare is a local inference server for NVIDIA SM120/SM121 GPUs, built for
88
long conversations, coding agents, and repeated tool use. Its goal is to make
99
the memory, bandwidth, and compute in workstations and compact systems such
1010
as DGX Spark go further, while keeping generation responsive.
@@ -16,8 +16,8 @@ The design rests on a few principles:
1616

1717
- **Embrace the standard PyTorch ecosystem at build time; serve from Rust.**
1818
Ignition uses PyTorch, Transformers, and FlashInfer/b12x to load models,
19-
tune kernels, compile forwards, and capture CUDA graphs into a runtime package.
20-
Helios, the Rust runtime, serves that package without Python. Compilation and
19+
tune kernels, compile forwards, and capture CUDA graphs into a runtime core.
20+
Helios, the Rust runtime, serves that core without Python. Compilation and
2121
graph capture finish before serving.
2222

2323
- **Build on the model ecosystem.** Reuse canonical model implementations
@@ -34,20 +34,22 @@ The design rests on a few principles:
3434
hardware and kernel stack keeps those boundaries manageable.
3535

3636
[vLLM](https://docs.vllm.ai/en/latest/) covers a much broader range of models,
37-
hardware, and deployment patterns. Flare trades that breadth for a focused
38-
serving contract around selected models and local workloads. Flare is not, and
37+
hardware, and deployment patterns. Hyperflare trades that breadth for a focused
38+
serving contract around selected models and local workloads. Hyperflare is not, and
3939
will never, be a replacement for production inference englines like vLLM.
4040

41-
Think of Flare as a specialized option when its hardware and model coverage
41+
Think of Hyperflare as a specialized option when its hardware and model coverage
4242
fit your machine.
4343

4444
Start with [model preparation and serving](docs/model-preparation.md).
45+
For native Windows development and serving prebuilt model cores, follow
46+
[Windows serving](docs/windows.md#build-and-test-on-windows).
4547
See the [CLI guide](docs/cli-design.md) for configuration and the
4648
[core design](docs/core-design.md) for the architectural reasoning.
4749

4850
## Licensing and contributions
4951

50-
Flare's project code is licensed under [Apache 2.0](LICENSE). Contributions
52+
Hyperflare's project code is licensed under [Apache 2.0](LICENSE). Contributions
5153
require the sign-off described in [CONTRIBUTING.md](CONTRIBUTING.md).
5254
Third-party attributions are listed in [NOTICE](NOTICE); upstream terms remain
5355
applicable to third-party code and assets.
@@ -62,5 +64,5 @@ Python package distribution.
6264
Upstream chat templates are fetched with the model checkpoints and annotated
6365
locally using bundled insertion patches. Gemma uses pinned Google sources.
6466
The custom Kimi segmented renderer is included as project code. Downloaded
65-
model assets and exported model packages retain their upstream terms; see
67+
model assets and exported model cores retain their upstream terms; see
6668
[frontend preparation](docs/model-development.md#sampling-and-frontend-metadata).

‎SECURITY.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ steps or proof-of-concept code.
1818
See [NVIDIA's PSIRT policies](https://www.nvidia.com/en-us/security/psirt-policies/)
1919
for information about vulnerability handling and disclosure.
2020

21-
## Model package integrity
21+
## Model core integrity
2222

23-
Flare package signatures authenticate metadata and stored executable bytes. Executable
23+
Flare core signatures authenticate metadata and stored executable bytes. Executable
2424
resources use one zstd level-3 frame per resource; compression is not encryption and
2525
provides no confidentiality. The accepted publisher namespace must exactly match the
26-
signed namespace. Treat signed packages as executable input, not sandboxed code.
26+
signed namespace. Treat signed cores as executable input, not sandboxed code.

0 commit comments

Comments
 (0)