Optimize server-setup, by offloading large matrix multiplication to GPU#11
Merged
itzmeanjan merged 29 commits intomainfrom Apr 6, 2025
Merged
Optimize server-setup, by offloading large matrix multiplication to GPU#11itzmeanjan merged 29 commits intomainfrom
itzmeanjan merged 29 commits intomainfrom
Conversation
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Shader is taken from https://gist.github.com/itzmeanjan/84613bc7595372c5e6b6c22481d42f9a Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
… it finishes Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
…queue Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
… buffer creation Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
…tion Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
… function Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
…spond` Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Owner
Author
|
Without $ cargo bench --features mutate_internal_client_state --profile optimized --bench offline_phase -q server_setup
Timer precision: 10 ns
offline_phase fastest │ slowest │ median │ mean │ samples │ iters
╰─ server_setup │ │ │ │ │
├─ 3 │ │ │ │ │
│ ╰─ DBConfig { db_entry_count: 65536, key_byte_len: 32, value_byte_len: 1024 } 2.522 m │ 2.648 m │ 2.585 m │ 2.585 m │ 2 │ 2
╰─ 4 │ │ │ │ │
╰─ DBConfig { db_entry_count: 65536, key_byte_len: 32, value_byte_len: 1024 } 2.535 m │ 2.552 m │ 2.543 m │ 2.543 m │ 2 │ 2When enabled the $ cargo bench --features mutate_internal_client_state,gpu --profile optimized --bench offline_phase -q server_setup
Timer precision: 10 ns
offline_phase fastest │ slowest │ median │ mean │ samples │ iters
╰─ server_setup │ │ │ │ │
├─ 3 │ │ │ │ │
│ ╰─ DBConfig { db_entry_count: 65536, key_byte_len: 32, value_byte_len: 1024 } 12.18 s │ 12.69 s │ 12.45 s │ 12.46 s │ 25 │ 25
╰─ 4 │ │ │ │ │
╰─ DBConfig { db_entry_count: 65536, key_byte_len: 32, value_byte_len: 1024 } 11.73 s │ 12.24 s │ 11.86 s │ 11.87 s │ 26 │ 26 |
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
Owner
Author
|
I benchmarked server-setup on AWS EC2 instance Server-setup on CPUServer-setup, partially offloaded to GPUNote Server-setup can be offloaded to GPU, by enabling feature |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Use
vulkancompute shaders to offload large matrix multiplication and matrix transposition to GPU(feature-gated by non-default
gpufeature), for speeding upserver-setupphase of ChalametPIR.