Optimum-neuron

Latest version: v0.1.0

Safety actively analyzes 715081 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

0.9998538494110107

clf = pipeline("question-answering")
clf({"context": "This is a sample context", "question": "What is the context here?"})
{'score': 0.4972594678401947, 'start': 8, 'end': 16, 'answer': 'a sample'}



Or with precompiled models as follows:

python
from transformers import AutoTokenizer
from optimum.neuron import NeuronModelForQuestionAnswering, pipeline

tokenizer = AutoTokenizer.from_pretrained("deepset/roberta-base-squad2")

Loading the PyTorch checkpoint and converting to the neuron format by providing export=True
model = NeuronModelForQuestionAnswering.from_pretrained(
"deepset/roberta-base-squad2",
export=True
)

neuron_qa = pipeline("question-answering", model=model, tokenizer=tokenizer)
question = "What's my name?"
context = "My name is Philipp and I live in Nuremberg."

pred = neuron_qa(question=question, context=context)


*Relevant PR: 107*

Cache repo fix

The cache repo system was broken starting from Neuron 2.11.
*This release fixes that, the relevant PR is 119.*

0.1.0

What's Changed

Dependencies
* Use AWS Neuron sdk 2.21 by dacorvo in https://github.com/huggingface/optimum-neuron/pull/754
* Bump diffusers dependency by dacorvo in https://github.com/huggingface/optimum-neuron/pull/786

New features
* Add a method to get the list of cached models by dacorvo in https://github.com/huggingface/optimum-neuron/pull/784
* Add IP-adapter support for stable diffusion by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/766
* Add support for phi3 model architecture by dacorvo in https://github.com/huggingface/optimum-neuron/pull/802

Documentation & Examples
* Docs: Fixed All Typos in /docs by ruidazeng in https://github.com/huggingface/optimum-neuron/pull/780
* Improves the doc for NeuronTrainingArguments by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/794
* Bert training update by tengomucho in https://github.com/huggingface/optimum-neuron/pull/781
* remove XLA_USE_BF16 from SFT tutorial by tengomucho in https://github.com/huggingface/optimum-neuron/pull/800

Bug fixes
* Fix training by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/774

New Contributors
* ruidazeng made their first contribution in https://github.com/huggingface/optimum-neuron/pull/780

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.28...v0.1.0

0.0.28

What's Changed

General
* Bump transformers version to 4.48.1 by dacorvo in https://github.com/huggingface/optimum-neuron/pull/771
* HF DLAMI: set env variable to enable hf transfer by tengomucho in https://github.com/huggingface/optimum-neuron/pull/777

Inference
* Add PixArt support by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/731
* Add Pixart sigma by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/762
* Add support for granite models by dacorvo in https://github.com/huggingface/optimum-neuron/pull/753
* Add an HLO backend for LLM models by dacorvo in https://github.com/huggingface/optimum-neuron/pull/775

Documentation
* SFT Training update tutorials by tengomucho in https://github.com/huggingface/optimum-neuron/pull/769
* Changes in Spelling and notes by Paulie631 in https://github.com/huggingface/optimum-neuron/pull/760

Bug fixes
* Fix emb model export and load with trfrs by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/756
* fix(peft): adapt to latest internal API by dacorvo in https://github.com/huggingface/optimum-neuron/pull/757

New Contributors
* Paulie631 made their first contribution in https://github.com/huggingface/optimum-neuron/pull/760
* tengomucho made their first contribution in https://github.com/huggingface/optimum-neuron/pull/770

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.27...v0.0.28

0.0.27

What's Changed

- Add support for Qwen2 models (746)
- bump Neuron SDK to 2.20.2 (743)
- NeuronX TGI: bump router version to 3.0.0 (748)

Bug fixes

- training: Fixes consolidation issue when TP is enabled (739)
- inference: Fix t5 decoder compilation error since Neuron sdk 2.20 (732)

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.26...v0.0.27

0.0.26

What's Changed

Inference

- refactoring Diffusers pipelines (711)
- Add tensor parallel support to T5 via NxD (697)

Training

- support resizing embeddings (670)
- NeuronORPOTrainer (719)

Bug fixes

- update TGI error message (659)
- fix errors in vision/audio models docstring (714)
- fix wrong inputs/model placement when using a single core (725)
- fix model checkpoint saving issue when using PEFT (727)
- fix non contiguous tensors in consolidation (736)

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.25...v0.0.26

0.0.25

What's Changed

* Use AWS Neuron SDK 2.20 (696) by dacorvo
* Bump `optimum` to 1.22 (686) by JingyaHuang
* Bump `transformers` to 4.43.2 (665) by dacorvo

Inference

* Add support for multiple ControlNet (691) by JingyaHuang
* Add ControlNet support for SDXL (675) by JingyaHuang


Training

* Support SFTTrainer (682) by michaelbenayoun
* LoRA finetuning tutorial (671) by michaelbenayoun

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.24...v0.0.25

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.