-
Notifications
You must be signed in to change notification settings - Fork 17.4k
ggml-webgpu: address quantization precision and backend lifecycle managment #21521
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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e391405
ggml(webgpu): fix the busy-polls in Emscripten in the waitAny after …
Constannnnnt eb62cae
Merge branch 'master' of github.com:ggml-org/llama.cpp into constant/…
jjhartmann d24af3b
Merge branch 'master' of github.com:ggml-org/llama.cpp into constant/…
jjhartmann 43dfbdf
Merge with upstream
jjhartmann 09c49b3
Fix GET_ROWS packed integer NaN when using f16 as memory buffer in sh…
jjhartmann 4cc515f
Update Unary wgsl EXP and EXPM1 for f16 stability
jjhartmann b86e765
Fix GET_ROWS IQ4_XS strcut for NaN f16 canonicalization
jjhartmann ae9dac6
Fix numerical percision for unary sqrt when working with f16
jjhartmann 518e315
Fix NaN canonicalization for packed integers using f16
jjhartmann 956d910
Update err threshold for binary div ops when using f16
jjhartmann 2747c8f
backend: Keep one Dawn/WebGPU instance alive for the lifetime of the …
Constannnnnt e4a97ce
merge: quant fix + static backend
Constannnnnt 34e9216
merge: merge with upstream master
Constannnnnt f272f06
merge: merge with upstream master and uncomment webgpu logs
Constannnnnt 7a8d382
clean: uncomment existing code logs
Constannnnnt f599675
clean: clean the unncessary debug info
Constannnnnt f501dc7
Refactor and generalize dequant helpers
jjhartmann 018d470
Remove deprecated quant structs
jjhartmann bc8b42e
Refactor shader defines to reduce repetition
jjhartmann b149e92
Remove error override for F16 type
jjhartmann e364006
Merge pull request #1 from noumena-labs/jeremy/dev/llama.cpp-pr-21521…
jjhartmann 71dee38
merge with upstream
Constannnnnt f1ba334
fix: fix the accidential removal of the proper initialization of ctx
Constannnnnt 41e0a26
clean: clean legacy and format code
Constannnnnt 7b09fbf
fix: did not modify tests ops
Constannnnnt fa0f181
merge: fix the test change and merge with upstream
Constannnnnt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change generally seems reasonable, but is it actually a real problem? My understanding is that normally, the reg function is only called once by llama.cpp, and I haven't seen any errors related to this running in different contexts or in the browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added this was that in the inference system we built around llama.cpp and wasm, we tested a scenario where a new model was loaded to replace the model already in the system, and the system crashed. My understanding of this issue at that time was that resources like the buffer and pipelines are tied to the
wgpu::deviceandwgpu::instancethat created them. When I switched the model,llama.cppcreated a newdeviceand the system tried to use an old buffer with the newdeviceor clean up old resources using the new context. Therefore, to prevent this, I think it would be safer to forcesllama.cppto reuse the existinginstanceanddeviceetc for the entire lifetime of the system.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks for the context, this makes sense!