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

Possible webgpu bug in AutoModelForSequenceClassification #1181

Open
2 of 5 tasks
brianpetro opened this issue Feb 4, 2025 · 1 comment
Open
2 of 5 tasks

Possible webgpu bug in AutoModelForSequenceClassification #1181

brianpetro opened this issue Feb 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@brianpetro
Copy link

System Info

Windows
Electron/Chromium

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

I'm using the example for re-ranking, almost verbatim, as seen #632 (comment)

Weirdly, when device=webgpu, I see the same output for every inputted document (screenshot below).

Not setting device seems to work, but CPU performance makes it unusable even with the smallest quantized models (can't have the computer freeze for 10+ seconds for every ranking).

It might be notable that I'm successfully using webgpu in a feature-extraction pipeline in the same environment.

I'm a big fan of the transformers.js project and I'm looking forward to getting this working. I see a lot of opportunity for implementing the ranking models for various features. Thanks for your work on this valuable open-source contribution! 🌴

Reproduction

Using device=webgpu

Image

When device is unset

Image

@brianpetro brianpetro added the bug Something isn't working label Feb 4, 2025
@brianpetro
Copy link
Author

In case it helps, here is a link to the actual code https://github.com/brianpetro/jsbrains/blob/main/smart-rank-model/adapters/transformers.js

And also, a link to the embedding code that uses webgpu and works https://github.com/brianpetro/jsbrains/blob/main/smart-embed-model/adapters/transformers.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant