VERSION: Ninfer (130-160 t/s) by gorbatjovy

#48
by gorbatjovy - opened

I converted my version of this into Ninfer for a speed of 130-160 TPS
Read more about Ninfer here, specialized c++ inference for 5090 and Qwen3.6 27B / 35B here:
https://github.com/Neroued/ninfer
gorbatjovy/Qwen3.6-27B-Architect-Polaris2-Fable-B-F451-heretic-ninfer

Excellent work.

DavidAU changed discussion title from Ninfer version to VERSION: Ninfer (130-160 t/s) by gorbatjovy

I converted my version of this into Ninfer for a speed of 130-160 TPS
Read more about Ninfer here, specialized c++ inference for 5090 and Qwen3.6 27B / 35B here:
https://github.com/Neroued/ninfer
gorbatjovy/Qwen3.6-27B-Architect-Polaris2-Fable-B-F451-heretic-ninfer

will it work on m1 mac 64bg ram?

will it work on m1 mac 64bg ram?

To my knowledge Ninfer is a 5090 specialized framework

I converted my version of this into Ninfer for a speed of 130-160 TPS
Read more about Ninfer here, specialized c++ inference for 5090 and Qwen3.6 27B / 35B here:
https://github.com/Neroued/ninfer
gorbatjovy/Qwen3.6-27B-Architect-Polaris2-Fable-B-F451-heretic-ninfer

How does one convert to the ninfer format? I would like to try an nvf4 version of this model.

How does one convert to the ninfer format? I would like to try an nvf4 version of this model.

I used the conversion script provided by the Ninfer GitHub repository.
I haven't looked into exactly how the weights are quantized under Ninfer at all.
Here is a quick summary I had Gemini draft up on exactly the steps I took to convert this model into Ninfer, keep in mind it's for Qwen3.6 only right now as I understand it.

The NInfer Bypass: Converting Custom Qwen3.6-27B Heretics
This guide details the workflow for converting uncensored/abliterated ("heretic") Qwen3.6-27B models into .ninfer artifacts, bypassing the engine's strict file validation checks.

  1. The Core Issue
    ninfer is a highly-optimized, strict C++ inference engine designed specifically for the RTX 5090. To guarantee runtime stability, it hardcodes SHA-256 hash checks to ensure it is loading the exact official Qwen3.6-27B configuration files.
    Custom heretic models often feature stripped-down configuration files (missing critical blocks like added_tokens_decoder or chat_template), which causes the ninfer conversion script to crash.

  2. Fetching the Official Assets
    To ensure the C++ engine gets the exact structure it demands, you must replace the heretic model's broken configuration files with the pristine, official versions.
    Navigate to the official Qwen/Qwen3.6-27B repository on Hugging Face.
    Download the following original files and place them directly into your local heretic model directory (overwriting the existing ones):
    tokenizer.json
    tokenizer_config.json
    chat_template.jinja
    generation_config.json
    preprocessor_config.json
    video_preprocessor_config.json

  3. Calculating the New Hashes
    Run this command inside your model directory:
    Bash
    sha256sum tokenizer.json tokenizer_config.json chat_template.jinja generation_config.json preprocessor_config.json video_preprocessor_config.json
    Copy the resulting SHA-256 strings.

  4. Patching the Python Bouncer
    Now, inject those new hashes into the converter script so it grants your custom files VIP access.
    In the ninfer repository, open tools/convert/qwen3_6/common/official_resources.py.
    Locate the OFFICIAL_RESOURCE_SHA256 dictionary.
    Carefully replace the official hash strings with the exact hashes you generated in Step 3. Save the file.

  5. Running the CPU Conversion
    Converting a massive 27B model on the GPU can trigger CUDA out-of-memory fragmentation, even on a 32GB RTX 5090. To bypass this, temporarily hide the GPU from PyTorch and force the conversion into system RAM.
    Execute the conversion script from the ninfer root directory:

CUDA_VISIBLE_DEVICES="" python -m tools.convert.qwen3_6_27b.convert
--input-dir ./INPUT_MODEL
--output-path ../qwen3.6-27b-heretic.ninfer

Once the script finishes, your fully uncensored, MTP-preserved .ninfer artifact is ready to be served!

How does one convert to the ninfer format? I would like to try an nvf4 version of this model.

I used the conversion script provided by the Ninfer GitHub repository.
I haven't looked into exactly how the weights are quantized under Ninfer at all.
Here is a quick summary I had Gemini draft up on exactly the steps I took to convert this model into Ninfer, keep in mind it's for Qwen3.6 only right now as I understand it.

...

Once the script finishes, your fully uncensored, MTP-preserved .ninfer artifact is ready to be served!

Thanks for the detailed response. I just realized that I was viewing the repo on mobile and it was cutting off everything under tests directory and I never saw tools.

Sign up or log in to comment