surgecore
EasyDeL's native host library for the eSurge inference engine: a Rust crate (PyO3 + maturin) whose extension module
surgecore._native holds eSurge's host-side state and per-step host computation.
It holds:
HostPayloadBuilder, which fills a batch preparer's preallocated staging arrays with one forward window's step inputs, with the GIL released: token and position packing, query start locations and sequence lengths, rank-major DP packing, page-table rows, the DP-local page check, the v2 KV slot mapping, the positional request distribution and the packed sampling vectors.Detokenizer, in-process batched incremental detokenization over a HuggingFace tokenizer. Rust owns request token history, context windows, incomplete UTF-8 buffering, bounded FIFO state and terminal suffix reconciliation; normal results carry only new text, with a full snapshot at finish or resynchronization.KvCore, eSurge's KV-cache core: the page pool with its LRU free list and null page 0, the chained page keys and the prefix map, the full, sliding-window and chunked-local group rules, transactional allocation with rollback, and publication of pages once their KV is computed. eSurge'sCacheManageris its binding.SnapshotIndex, the slots of recurrent-state snapshots taken at prefix-cache page boundaries, which let linear-attention and SSM models reuse prefix-cache hits.EngineCore, eSurge's host state machine: the request table, every data-parallel rank's queues, token budget, KV core and snapshot index, and the scheduler over them (FCFS or priority, chunked prefill, the long-prefill cap, preemption, whole-prompt admission, image-span alignment, snapshot boundaries, async output placeholders, request buckets) with synchronous speculative drafts (draft trimming, EAGLE lookahead, acceptance rollback) and the stop checks.schedule()returns aPlan;commit()takes the runner's sampled lists, accepted counts and new drafts and returnsEvents. Every call releases the GIL.- The verification budget of synchronous speculative steps (
EngineCore.set_verify_budget): from a step-time table per compiled token bucket (measured by the runner after compile, corrected online from measured step times) and per-request acceptance estimates per draft position, each schedule verifies 0..k drafts per request, the count that maximises expected emitted tokens per millisecond, and setsPlan.num_draft_tokens_next. - Async speculative steps: a verify window of
1 + kmay be scheduled while the request's previous window is in flight. The core advancescomputedas if every draft were accepted (Plan.spec_slotsper entry), each commit rolls back only its own rejected drafts, and the device corrects the later step's start. Windowed groups drop pages only below the lowest position the request may really be at.
Only eSurge imports it; import easydel and training do not need it.
Build
cd libs/surgecore
maturin build --release # wheel with surgecore/_native.abi3.so (abi3: one wheel covers CPython 3.11-3.13)
Install the wheel, or extract its surgecore/_native.abi3.so into libs/surgecore/surgecore/ and put
libs/surgecore on PYTHONPATH. pyproject.toml enables pyo3/extension-module through [tool.maturin] features,
so plain cargo builds link against libpython.
Test
cd libs/surgecore
export PYO3_PYTHON=$(which python) # a Python 3.11-3.13 interpreter: clippy and the tests link libpython
# (if the test binary cannot find libpython at run time, add that interpreter's LIBDIR to LD_LIBRARY_PATH)
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked # Rust unit tests (with the Python bindings compiled)
cargo test --locked --no-default-features # the pure-Rust core alone, no Python needed
python -m pytest tests # parity against the goldens in tests/data plus invariant tests (CPU)
Workspace CI (.github/workflows/workspace-ci.yaml, job surgecore) runs these and a wheel build whenever
libs/surgecore changes. Releases go through scripts/release.sh surgecore <version> and
scripts/publish.sh surgecore (see the workspace's WORKSPACE.md); a surgecore-v* tag builds and publishes the
wheels and the sdist.
The pytest files carry pytest.mark.cpu_ok: they do no JAX computation. The fixtures in tests/data hold inputs and
outputs captured from the Python code each piece replaced, and each header names its source commit:
host_payload_goldens.npz comes from eSurge's former step-input builder, kv_goldens.npz from its former KV core,
engine_goldens.npz and engine_goldens_ext.npz from its former scheduler (the second with speculative drafts,
runner-output gaps, multimodal page keys, request buckets, the finished set and the structured-output flag).
test_engine_behaviour.py states the former scheduler's behaviour tests against EngineCore.
The parity tests compare the native code with them bitwise.
Metadata
Release files for surgecore 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| surgecore-0.0.1.tar.gz | 729.8 kB | Without provenance | Details for surgecore-0.0.1.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| surgecore-0.0.1-cp311-abi3-manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ x86-64 | Details for surgecore-0.0.1-cp311-abi3-manylinux_2_28_x86_64.whl |
| surgecore-0.0.1-cp311-abi3-manylinux_2_28_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ ARM64 | Details for surgecore-0.0.1-cp311-abi3-manylinux_2_28_aarch64.whl |
| surgecore-0.0.1-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for surgecore-0.0.1-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 2.5 MB
Release files / surgecore-0.0.1.tar.gz
| Download URL | surgecore-0.0.1.tar.gz |
|---|---|
| Size | 729.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86fd9a8644983878be1dc3b06e1dd9c8643f2a22b90df9e5f0153e867fb3c2c0
|
|
BLAKE2b-256 checksum How to use checksums |
dde8f9ceb5e6e260cd2b687c84b3270325d644c8d07bb01e323ee772214492f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / surgecore-0.0.1-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | surgecore-0.0.1-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 615.6 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9e0dfb0b18c7bf3cc43643fbec84ed387b9da2c5fd56f5e3dd4bff944ded96cb
|
|
BLAKE2b-256 checksum How to use checksums |
99f3ffb2f0fda5b3f2d554e34a448c99552c2b0bd592b281403299eb96c01740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / surgecore-0.0.1-cp311-abi3-manylinux_2_28_aarch64.whl
| Download URL | surgecore-0.0.1-cp311-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 591.3 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
30d70eba27ad5759045045cffc4846a3f75561f419dd480a8b806b0032c8f69b
|
|
BLAKE2b-256 checksum How to use checksums |
4fa9f353c836711501c137bc301a78da3be59a5068f4b1ef3f4a59e90ccd25ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / surgecore-0.0.1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | surgecore-0.0.1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 551.2 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e3dc506d184d91593fc864c78f09602f82ee6f2aa080192bc8ea9b190f935ea3
|
|
BLAKE2b-256 checksum How to use checksums |
a38cbcbc9ee5b801aa36880f7b4af2111056590173599b134f7dfa4c1374cd72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for surgecore 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.