Optimum-neuron

Latest version: v0.0.26

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

Scan your dependencies

Page 1 of 5

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.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

0.0.24

What's Changed

* Use AWS Neuron SDK 2.19.1 by dacorvo in https://github.com/huggingface/optimum-neuron/pull/661

Training
* Initial PEFT support by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/612
* PEFT + TP support by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/620
* Fix MPMD detected error during training with TP by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/648

Inference
* Add Stable Diffusion ControlNet support by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/622
* Add InstructPix2Pix pipeline support. by asntr in https://github.com/huggingface/optimum-neuron/pull/625
* Add ViT export support and image classification by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/616
* Add wav2vec2 support - export and audio tasks modeling by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/645
* Add more audio models: ast, hubert, unispeech, unispeech-sat, wavlm by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/651

TGI
* Extending TGI benchmarking and documentation by jimburtoft in https://github.com/huggingface/optimum-neuron/pull/621
* Add support for TGI truncate parameter by dacorvo in https://github.com/huggingface/optimum-neuron/pull/647

Other changes
* enable unequal height and width by yahavb in https://github.com/huggingface/optimum-neuron/pull/592
* Skip invalid gen config by dacorvo in https://github.com/huggingface/optimum-neuron/pull/618
* Deprecate resume_download by Wauplin in https://github.com/huggingface/optimum-neuron/pull/586
* Remove a line non-intentionally merged by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/628
* Add secrets scanning workflow by mfuntowicz in https://github.com/huggingface/optimum-neuron/pull/631
* fix bad link to distributed-training how-to guide in optimum-neuron docs by aws-amj in https://github.com/huggingface/optimum-neuron/pull/627
* Do not copy local checkpoint by dacorvo in https://github.com/huggingface/optimum-neuron/pull/630
* Make neuron_cc_optlevel `None` by default by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/632
* Remove print by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/633
* Set bf16 to true when needed by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/635
* Fix gradient checkpointing with PEFT by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/634
* Refactor decoder tests by dacorvo in https://github.com/huggingface/optimum-neuron/pull/641
* CI cache builder by dacorvo in https://github.com/huggingface/optimum-neuron/pull/642
* Restore optimized attention score for sd15 & fix the generated images quality issue by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/646
* Add and remove some mark steps by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/644
* Fix consolidation for TP by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/649
* Fix spelling in error message by jimburtoft in https://github.com/huggingface/optimum-neuron/pull/656
* Update docs by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/588
* Fixes NxDPPModel for Neuron SDK 2.19 by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/663
* Various fixes for training by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/654
* migrate ci by XciD in https://github.com/huggingface/optimum-neuron/pull/662
* ci: fix inference cache pipeline by dacorvo in https://github.com/huggingface/optimum-neuron/pull/667
* broken link by pagezyhf in https://github.com/huggingface/optimum-neuron/pull/669
* Bump TGI version and fix bugs by dacorvo in https://github.com/huggingface/optimum-neuron/pull/666

New Contributors
* mfuntowicz made their first contribution in https://github.com/huggingface/optimum-neuron/pull/631
* aws-amj made their first contribution in https://github.com/huggingface/optimum-neuron/pull/627
* asntr made their first contribution in https://github.com/huggingface/optimum-neuron/pull/625
* XciD made their first contribution in https://github.com/huggingface/optimum-neuron/pull/662

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

0.0.23

What's Changed

* bump required packages versions: `transformers==4.41.1`, `accelerate==0.29.2`, `optimum==1.20.*`

Inference

* Fix diffusion caching by oOraph in https://github.com/huggingface/optimum-neuron/pull/594
* Fix inference latency issue when weights/neff are separated by JingyaHuang in 584
* Enable caching for inlined models by JingyaHuang in 604
* Patch attention score far off issue for sd 1.5 by JingyaHuang in 611

TGI

* Fix excessive CPU memory consumption on TGI startup by dacorvo in 595
* Avoid clearing all pending requests on early user cancellations by dacorvo in 609
* Include tokenizer during export and simplify deployment by dacorvo in 610

Training

* Performance improvements and neuron_parallel_compile and gradient checkpointing fixes by michaelbenayoun in 602

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

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.22...v0.0.23

0.0.22

What's Changed

Training
* Integrate new API for saving and loading with `neuronx_distributed` by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/560

Inference

* Add support for Mixtral by dacorvo in https://github.com/huggingface/optimum-neuron/pull/569
* Improve Llama models performance by dacorvo in https://github.com/huggingface/optimum-neuron/pull/587
* Make Stable Diffusion pipelines compatible with compel by JingyaHuang and neo in https://github.com/huggingface/optimum-neuron/pull/581 (with tests inspired by the snippets sent from Suprhimp)
* Add `SentenceTransformers` support to `pipeline` for `feature-extration` by philschmid in https://github.com/huggingface/optimum-neuron/pull/583
* Allow download subfolder for caching models with subfolder by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/566
* Do not split decoder checkpoint files by dacorvo in https://github.com/huggingface/optimum-neuron/pull/567

TGI

* Set up TGI environment values with the ones used to build the model by oOraph in https://github.com/huggingface/optimum-neuron/pull/529
* TGI benchmark with llmperf by dacorvo in https://github.com/huggingface/optimum-neuron/pull/564
* Improve tgi env wrapper for neuron by oOraph in https://github.com/huggingface/optimum-neuron/pull/589

Caveat

Currently traced models with `inline_weights_to_neff=False` have higher than expected latency during the inference. This is due to the weights are not automatically moved to Neuron devices. The issue will be fixed in 584, please avoid setting `inline_weights_to_neff=False` in this release.

Other changes
* Improve installation guide by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/559
* upgrade optimum and then install optimum-neuron by shub-kris in https://github.com/huggingface/optimum-neuron/pull/533
* Cleanup obsolete code by michaelbenayoun in https://github.com/huggingface/optimum-neuron/pull/555
* Extend TGI integration tests by dacorvo in https://github.com/huggingface/optimum-neuron/pull/561
* Modify benchmarks by dacorvo in https://github.com/huggingface/optimum-neuron/pull/563
* Bump PyTorch to 2.1 by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/502
* fix(decoder): specify libraryname to suppress warning by dacorvo in https://github.com/huggingface/optimum-neuron/pull/570
* missing \ in quickstart inference guide by yahavb in https://github.com/huggingface/optimum-neuron/pull/574
* Use AWS 2.18.0 AMI as base by dacorvo in https://github.com/huggingface/optimum-neuron/pull/572
* Update TGI router version to 2.0.1 by dacorvo in https://github.com/huggingface/optimum-neuron/pull/577
* Add guide for LoRA adapters by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/582
* eos_token_id can be a list in configs by dacorvo in https://github.com/huggingface/optimum-neuron/pull/580
* Ease the tests when there is no hf token by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/585
* Change inline weights to Neff default value to True by JingyaHuang in https://github.com/huggingface/optimum-neuron/pull/590

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

**Full Changelog**: https://github.com/huggingface/optimum-neuron/compare/v0.0.21...v0.0.22

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.