Skip to content
chainreactorsPublic

About

Fuel for inference.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

JevInfer

Mixed-precision inference for SGLang, vLLM and PyTorch on NVIDIA GB10 (DGX Spark).

JevInfer runs an NVFP4/FP8 mixed-precision recipe inside existing inference engines. Models, precision recipes, kernel providers and engine adapters are separate components; the engines keep their own scheduling, attention and state kernels.

Performance

One NVIDIA GB10, dense Qwen3.5-9B-derived model, final-token candidate scoring, batch size 1. Full evaluation suite: 27,438 requests, 29,182 questions.

Engine Execution Accuracy Mean latency Speedup
SGLang BF16 76.38% 137.11 ms 1.00×
SGLang JevInfer gb10-mixed-v2, candidate readout 75.18% 56.43 ms 2.43×
SGLang JevInfer gb10-mixed-v2, candidate readout, static activation scales¹ 75.01% 52.62 ms 2.56×
vLLM BF16 76.42% 155.34 ms 1.00×
vLLM JevInfer gb10-mixed-v2 74.69% 79.73 ms 1.95×
PyTorch BF16 76.31% 235.00 ms 1.00×
PyTorch JevInfer 74.72% 66.07 ms 3.56×

¹ Opt-in. Speedup against BF16 timed in the same session on one GB10, in which BF16 took 134.73 ms and gb10-mixed-v2 56.41 ms (details).

Benchmarks, method and data

Features

  • Mixed-precision recipe: NVFP4 W4A4 projections, FP8 full-attention K/V and an NVFP4 W4A16 output head.
  • Fused GLU: one paired gate/up NVFP4 GEMM with a BF16 SiLU lookup epilogue.
  • Grouped projections: same-input projections share one activation pack and write directly into one output buffer.
  • Pinned CUTLASS NVFP4 GEMM (gb10-mixed-v2): one SM121 kernel for every W4A4 projection, bitwise equal to the cuBLAS path.
  • Candidate-only readout (sglang-candidates): the output head computes only the requested candidate tokens.
  • Prefill CUDA graph (SGLang, opt-in): replays the transformer body for inputs up to 4,096 tokens.
  • Static activation scales (SGLang, opt-in): calibrated per-site NVFP4 activation scales replace per-forward amax reductions; the paired GLU writes the packed hidden activation from its epilogue.
  • Engine adapters: SGLang and vLLM model adapters and a reversible PyTorch overlay share one runtime and scoring API.
  • Artifact integrity: manifests with effective-weight hashes, packed-file hashes and shape checks; build receipts for native libraries.
  • Weight preparation: fissile quantize calibrates a BF16 model and prepares every projection pack (input-moment-weighted block scales, GPTQ).

Supported configurations

Component Supported
Hardware NVIDIA GB10 (SM121); RTX 5090 D (SM120, SGLang)
Platform Linux aarch64 or x86_64, Python 3.12, CUDA 13
Model Dense Qwen3.5-9B
Engines SGLang 0.5.23 and 0.5.21, vLLM 0.29.0 (validated stacks); PyTorch 2.13
Workload Complete-prompt, final-token candidate scoring
Backend model argument token_logprobs
sglang Model directory Full-vocabulary log probabilities
sglang-candidates Model directory Log probabilities normalized over the candidates
vllm Model directory Full-vocabulary log probabilities
torch Loaded, merged, frozen model Full-vocabulary log probabilities
Kernel provider Description
gb10-mixed-v1 GB10 default; cuBLAS NVFP4 GEMM
gb10-mixed-v2 GB10; pinned CUTLASS NVFP4 GEMM
gb10-mixed-v2-static gb10-mixed-v2 with static activation scales (activation_scales)
gb10-mixed-v2-calibration gb10-mixed-v2 recording activation scales for calibration
sm120-mixed-v1 SM120

Install

python -m pip install .
fissile --version
fissile backends

The base package has no GPU dependencies. Engine environment: Torch 2.14.1+cu130, SGLang 0.5.23, Transformers 5.19.0, Triton 3.8.0 and CuTe DSL 4.8.0 (setup); vLLM 0.29.0 uses its own environment (setup). JevInfer refuses engine stacks it has not been validated with (engine upgrades).

Quick start

Build the native resources (CPU compilation) and the SiLU table:

fissile build-tensorfold --output artifacts/libfissile_tensorfold.so
fissile build-fp4-gemm --output artifacts/libfissile_fp4_gemm.so --cutlass-dir /path/to/cutlass
python scripts/build_silu_table.py --output artifacts/silu.safetensors

Prepare the projection packs from a merged BF16 model and calibration inputs (GPU):

fissile quantize --model /path/to/merged-model --calibration calibration.jsonl \
  --packs-dir artifacts/packs --output artifacts/manifest.json

Each calibration line contains the input_ids of one representative, unlabeled input (details).

Copy examples/config-v2-gb10-cutlass.json, set the paths and the SiLU table hash, then validate and score:

fissile validate --config config.json
python examples/score_sglang.py --config config.json \
  --model /path/to/merged-model --inputs inputs.jsonl --output results.jsonl

Each input line contains id, input_ids and candidate_token_ids.

Optional static activation scales: calibrate once, then pass the scale file at startup:

python scripts/calibrate_activation_scales.py --config config.json \
  --model /path/to/merged-model --inputs inputs.jsonl --output scales.json
python examples/score_sglang.py --config config.json --activation-scales scales.json \
  --model /path/to/merged-model --inputs inputs.jsonl --output results.jsonl

Python API

from fissile.backends.registry import open_backend

with open_backend("sglang", "config.json", model_dir) as session:
    result = session.score(input_ids, candidate_token_ids)
    print(result.token_logprobs, result.prompt_tokens)

Batched scoring (static activation scales required): the items of one call run together and share a long common prefix; scores are bitwise equal to scoring each item alone (details).

with open_backend("sglang-candidates", "config.json", model_dir,
                  batch=True, activation_scales="scales.json") as session:
    results = session.score_batch([(ids_a, candidates_a), (ids_b, candidates_b)])

Documentation

Acknowledgements

JevInfer builds on SGLang, PyTorch, TensorFold (W4A16 head kernels), FlashInfer and NVIDIA CUTLASS (SM12x GEMM and scale layouts), NVIDIA Model Optimizer (FP4 scale search), Triton and Transformers. Weight preparation follows GPTQ and MR-GPTQ. Licenses and pinned sources: third-party notices.

About

Fuel for inference.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages