Skip to main content

MYELION CSF Core RT — inference and training runtime for .csf model files

Project description

CSF Core RT — Python SDK

v1.0 · Stable

Inference runtime for .csf model files produced by the CSF Core training framework.
Device-locked · Hardware-optimised · Precision-configurable.


Requirements

Requirement Minimum version
Python 3.9
Linux x86-64 or ARM64
CUDA (GPU) 11.8
ROCm (AMD GPU) 5.6
numpy 1.22

GPU inference additionally requires torch>=2.0.


Installation

CSF Core RT is distributed via the MYELION private package registry.
A valid licence key is required to authenticate.

# Configure the MYELION registry
pip config set global.index-url https://pkg.myelion.com/simple/
pip config set global.extra-index-url https://pypi.org/simple/

# Install the SDK
pip install csfrt csfrt_ops

# Verify
python -c "import csfrt; print(csfrt.__version__)"

Licence Activation

Each device must be activated before the SDK will load models.

# Online activation
python -m csfrt.activate MYELION-XXXX-XXXX-XXXX

# Check status (no network required)
python -m csfrt.status

Air-gap environments:

# 1. Extract fingerprint on the isolated device
python -m csfrt.fingerprint
# → Copy the base64 string and send to zulal.tannur@myelion.com

# 2. After receiving license.mkey, deploy it:
sudo cp license.mkey /etc/csfrt/license.mkey
sudo chmod 644 /etc/csfrt/license.mkey
python -m csfrt.status

Quick Start

import csfrt
import numpy as np

# Load model — licence verified automatically
model = csfrt.load("model.csf")

# Synchronous inference
input_data = np.random.rand(1, 3, 512, 512).astype(np.float32)
result = model.infer(input_data)
print(result.shape)   # → (1, num_classes)

API Reference

csfrt.load()

csfrt.load(
    path: str,
    device: str = "cuda",
    precision: str = "fp16",
    license: str | None = None,
    num_threads: int = 4,
) -> CSFModel
Parameter Type Description
path str Path to the .csf model file.
device str "cuda", "cpu", "cuda:N", or "rocm".
precision str "fp16" (default) or "int8".
license str | None Custom path to .mkey file.
num_threads int CPU threads for preprocessing. Default 4.

CSFModel.infer()

model.infer(
    inputs: np.ndarray | torch.Tensor,
    return_numpy: bool = True,
) -> np.ndarray | torch.Tensor

Synchronous inference. Blocks until the result is available.


CSFModel.infer_async()

future = model.infer_async(input_data)
do_other_work()
result = future.get(timeout=5.0)

Non-blocking inference. Returns a CSFInferenceFuture.


CSFStream

Real-time streaming with automatic micro-batching and callbacks.

from csfrt import CSFStream

def on_result(result, metadata):
    print(f"Frame {metadata['frame_id']}: {result.shape}")

stream = CSFStream(
    model_path="model.csf",
    callback=on_result,
    batch_size=4,
    precision="fp16",
)

stream.start()
for frame in data_source:
    stream.push(frame, metadata={"frame_id": frame.id})
stream.stop()

Precision Modes

Mode Flag Notes
FP16 "fp16" Default. Half-precision float. Recommended for GPU.
INT8 "int8" ~2× throughput. Requires calibration data in .csf file.

Note: INT8 mode requires quantisation calibration data bundled into the .csf file at training time. Models compiled without it will raise CSFPrecisionError.


Exceptions

Exception When raised
CSFLicenceError No valid token, or fingerprint mismatch.
CSFLicenceExpiredError Token validity period elapsed.
CSFModelError Corrupt/incompatible .csf file.
CSFPrecisionError INT8 requested but model has no calibration data.
CSFDeviceError Requested device not available.
CSFShapeError Input shape does not match model specification.

Docker

# CUDA (NVIDIA)
docker pull pkg.myelion.com/csfrt:1.0-cuda11.8

# ROCm (AMD)
docker pull pkg.myelion.com/csfrt:1.0-rocm5.6

# CPU only
docker pull pkg.myelion.com/csfrt:1.0-cpu

docker run --gpus all \
  -v /etc/csfrt:/etc/csfrt:ro \
  -v /path/to/model.csf:/model.csf:ro \
  pkg.myelion.com/csfrt:1.0-cuda11.8 \
  python inference.py

Benchmarking

python -m csfrt.bench model.csf --iterations 100 --batch 1
python -m csfrt.bench model.csf --precision fp16 int8 --compare
python -m csfrt.bench model.csf --output benchmark.json

Support

Documentation: myelion.com/docs
Licensing: zulal.tannur@myelion.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myelion_csf-1.0.0-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file myelion_csf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: myelion_csf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 66.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for myelion_csf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5eb92ac0fc24713e1692417fdc31bbe7ad45bf9e291aa42e3ce043f0c979522d
MD5 64dddfcf0e053a4fc217915a05676d4b
BLAKE2b-256 3abeb6573c2a5650429dcb1fd093b42ac5f9bc34f72bf405ebb3629c45d7e30b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page