agentleFS
Hugging FaceKnown publisherhuggingface/optimum-neuron/optimum/neuron/models/inference/smollm3/AGENTS.md

optimum-neuron / smollm3

AGENTS.md270 starsChanged 10 months agoApache-2.0View on GitHub

This directory contains the Neuron-optimized SmolLM3 inference implementation. It follows HF Transformers architecture with Neuron-specific changes from NxDI. Reference: NxDI SmolLM3 implementation SmolLM3 follows Llama architecture with shared removals: Why removed: Requires neuronxcc.nki private APIs. Optimum relies on compiler auto-optimization. Why removed: Production serving features handled by vLLM integration. Why removed: Optimum uses HF Transformers config with neuron_config.json extensions. Optimum Neuron prioritizes stability and HF compatibility for SmolLM3 models.

The file

Files
AGENTS.md

SmolLM3 Inference Model Guide

This directory contains the Neuron-optimized SmolLM3 inference implementation. It follows HF Transformers architecture with Neuron-specific changes from NxDI.

HF reference

What differs vs HF

  • Parallel layers: TP-aware linear/embedding layers replace HF modules.
  • Attention base: NeuronAttentionBase for TP-aware heads and static shapes.
  • KV cache/static shapes: Uses KVCacheManager and fixed shapes.

What was removed from NxDI

Reference: NxDI SmolLM3 implementation

SmolLM3 follows Llama architecture with shared removals:

Removed NKI Kernel Implementations

  • MLP TKG kernel - Small batch optimization (particularly relevant for small models)
  • Quantized MLP kernels - INT8 quantization with fused operations
  • NKI-based MLP - Hand-tuned kernel implementations

Why removed: Requires neuronxcc.nki private APIs. Optimum relies on compiler auto-optimization.

Removed Serving/Speculative Features

  • EAGLE draft models - Speculative decoding (SmolLM3 often used as draft model itself)
  • Medusa heads - Multi-head speculative sampling
  • Flash Decoding - Multi-query parallelism
  • LoRA serving - Dynamic adapter switching
  • Context parallelism - MLP splitting for long contexts

Why removed: Production serving features handled by vLLM integration.

Removed Configuration/Infrastructure

  • NxDI config classes - Replaced by Optimum's NxDNeuronConfig
  • Module registration system - Plugin architecture
  • Preshard hooks - Weight sharding orchestration
  • Custom RMSNorm variants - CPU/NXD mode switching

Why removed: Optimum uses HF Transformers config with neuron_config.json extensions.

What Optimum Neuron Keeps

  • Parallel layers with TP-aware sharding
  • NeuronAttentionBase with GQA and flash attention
  • Rotary embeddings
  • State dict conversion (QKV fusion)
  • Decoder layer structure

Optimum Neuron prioritizes stability and HF compatibility for SmolLM3 models.

Key files

  • optimum/neuron/models/inference/smollm3/modeling_smollm3.py
  • optimum/neuron/models/inference/backend/modules/attention/attention_base.py

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.