0hq / WebGPT

Run GPT model on the browser with WebGPU. An implementation of GPT inference in less than ~1500 lines of vanilla Javascript.
https://kmeans.org
Other
3.61k stars 206 forks source link

Strange behavior #4

Open sanchezcarlosjr opened 1 year ago

sanchezcarlosjr commented 1 year ago

Hello @0hq, I think the below results are not the expected behavior. Shakespeare Model.

GPT2 Model.

Environment

Arch Linux Chrome Canary Version 114.0.5720.4 (Official Build) dev (64-bit) Vulkan google-chrome-unstable --enable-features=Vulkan

Heath123 commented 1 year ago

I get that too

0hq commented 1 year ago

Strange, I'll investigate.

Any chance you can retry on the latest version + note any errors that occur in the console?

felladrin commented 1 year ago

I get that too

@Heath123, please also share your OS and Chrome Version used. The problem may be only on Chrome for Linux.

sanchezcarlosjr commented 1 year ago

The error that I got is not related to your model.

image The Chrome log was image

I tried to use the local version but it doesn't work either with the last version. image

felladrin commented 1 year ago

I tried to use the local version but it doesn't work either with the last version.

About running locally, this is a different issue, related to Git LFS. To get it running, please check this answer on #7.

After you get it running locally and start tweaking the values in index.html, it will for sure help finding the issue.

Heath123 commented 1 year ago

I get that too

@Heath123, please also share your OS and Chrome Version used. The problem may be only on Chrome for Linux.

Arch Linux and Chromium 112.0.5615.121

sanchezcarlosjr commented 1 year ago

I got the same locally. image image

I've tested them with the last commit (50d5487).

0hq commented 1 year ago

I think this might be a problem with the Linux version of Chrome Canary. Do you mind testing on the newest version just for confirmation?

sanchezcarlosjr commented 1 year ago

Different behavior, but it keeps strange. I've updated the Chrome Canary before.

image

image

*I've run the models on Windows and they work.

0hq commented 1 year ago

Oh interesting seems like a Linux implementation bug.

dcerisano commented 1 year ago

Same problem. I run the following command line and then open the index.html file.

$ google-chrome --allow-file-access-from-files --enable-features=Vulkan,UseSkiaRenderer --enable-unsafe-webgpu &

The following errors are reported to the shell when I select a model: Warning: remove_all_non_valid_override_layers: Failed to get executable path and name Warning: loader_get_json: Failed to open JSON file lvp_icd.x86_64.json Error: VK_SUCCESS Error: eglChooseConfig returned zero configs at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:53)

In the javascript console, there is one warning:

Warning: Buffer size calc result exceeds GPU limit, are you using this value for a tensor size? 50257 768 1 154389504

Looks like an error in Dawn. Is it possible that Chrome on Linux needs a custom config?