Skip to content
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

[Web] [Feature Request] Ability to abort #23703

Open
sroussey opened this issue Feb 14, 2025 · 2 comments
Open

[Web] [Feature Request] Ability to abort #23703

sroussey opened this issue Feb 14, 2025 · 2 comments
Labels
ep:WebGPU ort-web webgpu provider platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@sroussey
Copy link
Contributor

Describe the issue

I am working on a PR for huggingface/transformers.js that adds the ability to abort an operation. Right now, it works for model downloads, but it does not work for generation that happens via ORT.

To reproduce

On the JS side of things, an AbortController as used by fetch() would be great.

Urgency

No response

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.20.1 and 1.21.0-dev.20250206-d981b153d3

Execution Provider

'wasm'/'cpu' (WebAssembly CPU), 'webgpu' (WebGPU)

@sroussey sroussey added the platform:web issues related to ONNX Runtime web; typically submitted using template label Feb 14, 2025
@sroussey
Copy link
Contributor Author

@github-actions github-actions bot added the ep:WebGPU ort-web webgpu provider label Feb 14, 2025
@fs-eire
Copy link
Contributor

fs-eire commented Feb 20, 2025

In my understanding, the only thing abortable is the fetch that happens in ort.InferenceSession.create(). No other operation is really abortable, including the inference session initialization and run.

If you are running a transformer model, each iteration (or, token generation) is a call to OrtRun. It's reasonable to abort between the iterations (which is discussed in huggingface/transformers.js#1182), but there is no way to "abort" inside the OrtRun function call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:WebGPU ort-web webgpu provider platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants