Skip to content

ONNX Runtime improvements #1306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Jul 30, 2025
Merged

ONNX Runtime improvements #1306

merged 49 commits into from
Jul 30, 2025

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented May 2, 2025

Add support for native webgpu EP

fs-eire and others added 2 commits April 25, 2025 18:45
* customize the wasm paths

* update implementation

* allow using 'webgpu' in nodejs binding

* update version of onnxruntime-node

* Upgrade onnxruntime-web to same version as onnxruntime-node

* Update list of supported devices

---------

Co-authored-by: Joshua Lochner <[email protected]>
* customize the wasm paths

* update implementation
@xenova xenova changed the base branch from main to v4 July 10, 2025 19:19
xenova and others added 18 commits July 10, 2025 17:22
* Bump jinja version to support new features

* [version] Update to 3.6.3
…1370)

* Add special tokens in text-generation pipeline if tokenizer requires

* Fix logits processors tests

* Update bundles.test.js

* Update comment

* Formatting
* Optimize tensor.slice()

The performance of executing `tensor.slice()` is super poor, especially for
the 'logits' tensor with large dimensions.

```
const logits = outputs.logits.slice(null, -1, null);`
```

This is because currently implementation of the `slice` method manually iterates
through each element and calculate indices which is a big time consuming if
the tensor shape is large.

For cases like `slice(null, -1, null)`, where the slicing operation is
contiguous along certain dimensions, which can be optimized by bulk copy
by using `TypeArray.subarray()` and `TypeArray.set()`.

* nit

* Add a few more tensor slice unit tests

---------

Co-authored-by: Joshua Lochner <[email protected]>
@xenova xenova marked this pull request as ready for review July 30, 2025 21:49
@xenova
Copy link
Collaborator Author

xenova commented Jul 30, 2025

Merging into v4 branch 🔥

@xenova xenova merged commit c6b7edf into v4 Jul 30, 2025
1 check failed
@xenova xenova deleted the ort-improvements branch July 30, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants