CoolFace
Modelpublic

simaai/LFM2-350M-a16w4_return_logits

sourceHugging Faceotherupdated 2mo agoView on Hugging Face
0likes
Model Card

LFM2-350M-a16w4returnlogits: Optimized for SiMa.ai Modalix Accuracy Benchmarking

Overview

This repository contains the LFM2-350M-a16w4_return_logits model, optimized and compiled for the SiMa.ai Modalix platform.

This model is compiled with --return_logits so that it can be used for Modalix accuracy benchmarking without recompiling the source model.

  • Model Architecture: LFM2 (350M parameters)
  • Quantization: Hybrid
  • Prompt Processing: A16W8 (16-bit activations, 8-bit weights)
  • Token Generation: A16W4 (16-bit activations, 4-bit weights)
  • Maximum context length: 2048
  • Source Model: LiquidAI/LFM2-350M
  • Return logits: Enabled

Accuracy Benchmark Results

The table below compares accuracy results produced by SiMa.ai on the Modalix backend against Hugging Face backend reference results.

TaskVersionFiltern-shotMetricDirectionHF Backend ValueHF StderrModalix Backend ValueModalix StderrAbs. Diff
hellaswag1.0none0acchigher0.38520.00490.3691500.0048160.016050
hellaswag1.0none0acc_normhigher0.48920.00500.4763990.0049840.012801
piqa1.0none0acchigher0.69100.01080.6746460.0109310.016354
piqa1.0none0acc_normhigher0.69860.01070.6751900.0109260.023410
triviaqa3.0remove_whitespace0exact_matchhigher0.12200.00240.1065540.0023030.015446
wikitext2.0none0bitsperbytelower1.1750N/A1.304415N/A0.129415
wikitext2.0none0byte_perplexitylower2.2579N/A2.469835N/A0.211935
wikitext2.0none0word_perplexitylower77.8836N/A125.826566N/A47.942966
winogrande1.0none0acchigher0.56270.01390.5548540.0139680.007846

Evaluation Sample Counts

Tasksample_len
hellaswag10042
piqa1838
triviaqa17944
wikitext62
winogrande1267

Prerequisites

To benchmark accuracy with this model, you need:

  1. 1.SiMa.ai Modalix Device
  2. 2.SiMa.ai CLI: Installed on your Modalix device.
  3. 3.SiMa.ai Neat Runtime: Install or update the Neat Library on Modalix. The LLiMa runtime is installed as part of the Neat runtime.
  4. 4.LLiMa benchmark CLI: Installed on the host machine used to launch accuracy benchmarking.
  5. 5.Hugging Face CLI: Optional, for downloading the model on a host before copying it to Modalix.

Installation & Deployment

Follow these steps to deploy the model to your Modalix device.

1. Install or Update Neat Runtime

Note: This is a one-time setup. If the Neat Library is already installed on your Modalix device, you can skip this step and continue with model download.

Follow the SiMa.ai Neat getting started guide to install or update the Neat Library on your Modalix device.

The llima CLI is available on Modalix after the Neat runtime is installed. It manages precompiled GenAI models under /media/nvme/llima/models by default. Set LLIMA_MODELS_PATH to use a different model directory.

2. Download the Model

Download the compiled model assets from this repository directly to your device.

bash
# Download the model to a local directory
llima pull LFM2-350M-a16w4_return_logits

Alternatively, you can download the compiled model to a Host and copy it to the Modalix device:

bash
hf download simaai/LFM2-350M-a16w4_return_logits --local-dir LFM2-350M-a16w4_return_logits
scp -r LFM2-350M-a16w4_return_logits sima@<modalix-ip>:/media/nvme/llima/models/

Replace \<modalix-ip\> with the IP address of your Modalix device.

Expected Directory Structure:

text
/media/nvme/llima/
`-- models/
    `-- LFM2-350M-a16w4_return_logits/   # The compiled model

Usage

Modalix Backend Accuracy

Run the benchmark from a host machine. The positional model_id must be the source Hugging Face model because MOLE uses its tokenizer and configuration; --board_model selects this compiled artifact on Modalix.

bash
MODALIX_IP="<modalix-ip>"
llima-benchmark accuracy LiquidAI/LFM2-350M \
    --backend modalix \
    --output ./results/modalix \
    --board_ip "$MODALIX_IP" \
    --board_model LFM2-350M-a16w4_return_logits \
    --task hellaswag piqa triviaqa wikitext winogrande

The compiled --board_model must already exist on Modalix and contain both devkit/ and elf_files/. The CLI starts the benchmark server by default. Add --board_venv_path /path/to/venv when llima is installed in a non-default virtual environment, or --no-board_start_server when connecting to a server that is already running.

Hugging Face Backend Accuracy

Run the same task suite against the source model on the host:

bash
llima-benchmark accuracy LiquidAI/LFM2-350M \
    --backend hf \
    --output ./results/hf \
    --task hellaswag piqa triviaqa wikitext winogrande

See MOLE accuracy benchmarking for the full accuracy benchmarking workflow.

Limitations

  • Quantization: This model is quantized (A16W4/A16W8) for Modalix execution. Minor deviations from the full-precision source model may occur.
  • Return logits: This model is compiled with --return_logits for accuracy benchmarking workflows. For standard text generation deployments, use the corresponding SiMa.ai model from the Large Language Models collection.

Troubleshooting

  • `sima-cli` not found: Ensure that sima-cli is installed on your Modalix device.
  • `llima-benchmark` not found: Ensure that the LLiMa benchmark CLI is installed on the host machine.
  • `llima` not found: Install or update the Neat Library. See Getting Started.
  • Modalix accuracy benchmark fails: Verify that the model was compiled with --return_logits and that the model directory contains both devkit/ and elf_files/.
  • Model can't be found on Modalix: Verify the model directory is exactly inside /media/nvme/llima/models/ and not nested (e.g., /media/nvme/llima/models/LFM2-350M-a16w4_return_logits/LFM2-350M-a16w4_return_logits).
  • Permission Denied: Ensure you have read/write permissions for the /media/nvme directory.

Resources