support added for HF SmolLM3-3B#1715
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Pull request overview
Adds OpenVINO export support for the HuggingFace Transformers smollm3 architecture (SmolLM3-3B), wiring it into the OpenVINO TasksManager configs, test matrices, and the supported-models documentation.
Changes:
- Register a new
SmolLM3OpenVINOConfig(Llama-based) for multiple tasks with a minimumtransformersversion of4.53.0. - Extend OpenVINO exporter and GenAI/decoder/CLI test coverage to include
smollm3, and add a tiny internal test model id. - Update OpenVINO supported-architectures documentation to list SmolLM3, and remove
smollm3from the “ONNX supported but untested” warning set.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
optimum/exporters/openvino/model_configs.py |
Registers smollm3 in the OpenVINO TasksManager with an OpenVINO config class and version gate. |
optimum/exporters/openvino/utils.py |
Removes smollm3 from ONNX_SUPPORTED_ARCHITECTURES so it’s no longer treated as “untested / export at your own risk”. |
tests/openvino/utils_tests.py |
Adds an internal tiny test model mapping for smollm3. |
tests/openvino/test_genai.py |
Includes smollm3 in the GenAI LLM pipeline supported-architecture matrix for transformers>=4.53.0. |
tests/openvino/test_exporters_cli.py |
Adds CLI export test coverage and expected tokenizer artifact counts for smollm3. |
tests/openvino/test_export.py |
Adds smollm3 to the export integration test architecture mapping. |
tests/openvino/test_decoder.py |
Adds smollm3 to the decoder integration supported-architecture matrix for transformers>=4.53.0. |
docs/source/openvino/models.mdx |
Documents SmolLM3 as a supported architecture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
LGTM. |
|
@IlyasMoutawwakil Could you please provide me access to https://huggingface.co/optimum-intel-internal-testing for uploading the tiny-random-smollm3 ? I ran it locally and tests are passing. |
|
@popovaan, please take a look:
|
|
The WWB similarity score is 1.0 (using CPU, fp16, and the default number of samples, which was 27). |
|
Below is the script for creating tiny-model (I do not have the access to publish yet): from transformers import (
AutoTokenizer,
SmolLM3Config,
SmolLM3ForCausalLM,
)
def create_tiny_random_smollm3():
config = SmolLM3Config(
vocab_size=128256,
hidden_size=32,
intermediate_size=64,
num_hidden_layers=2,
num_attention_heads=4,
num_key_value_heads=2,
max_position_embeddings=256,
hidden_act="silu",
rms_norm_eps=1e-6,
tie_word_embeddings=True,
use_cache=True,
attention_bias=False,
mlp_bias=False,
use_sliding_window=False,
pad_token_id=128004,
bos_token_id=128000,
eos_token_id=128012,
)
model = SmolLM3ForCausalLM(config)
print(f"Model parameters: {sum(p.numel() for p in model.parameters()):,}")
# Use SmolLM3-3B tokenizer
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM3-3B")
output_dir = "./tiny-random-smollm3"
model.save_pretrained(output_dir)
tokenizer.save_pretrained(output_dir)
print(f"Saved to {output_dir}")
if __name__ == "__main__":
create_tiny_random_smollm3() |
|
Please add quantization tests. |
|
There was a warning during conversion of the model "The OpenVINO export of smollm3 models is not officially supported by optimum-intel, export at your own risks.", was it fixed? |
With the dedicated config added by this PR, the warning does not appear. |
added, kindly check. |
|
@rkazants @echarlaix @regisss please review this PR. |
What does this PR do?
OpenVINO export:
optimum-cli export openvino -m HuggingFaceTB/SmolLM3-3B ./SmolLM3-3B --task text-generation-with-pastInference Script:
Fixes # CVS-183437
Before submitting