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

Keep CUDA context alive #528

Merged
merged 2 commits into from
Apr 24, 2023
Merged

Keep CUDA context alive #528

merged 2 commits into from
Apr 24, 2023

Conversation

flaub
Copy link
Member

@flaub flaub commented Apr 24, 2023

No description provided.

@flaub flaub requested review from jbruestle and mothran April 24, 2023 21:32
@flaub flaub self-assigned this Apr 24, 2023
@@ -42,6 +43,15 @@ use crate::{

const KERNELS_FATBIN: &[u8] = include_bytes!(env!("ZKP_CUDA_PATH"));

lazy_static! {
static ref CONTEXT: Context = {
let device = Device::get_device(0).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have a ENV var with a default of 0 could be useful for future multi-GPU hosts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I plan to do that in the future

@flaub flaub enabled auto-merge (squash) April 24, 2023 22:51
@github-actions
Copy link

Benchmark for Linux-cuda 91b0ba7

Click to hide benchmark
Test Base PR %
fib/100/proof 1774.3±120.47ms 1676.9±101.19ms -5.49%
fib/100/run 403.6±4.83ms 324.9±3.86ms -19.50%
fib/200/proof 1810.9±87.35ms 1737.3±108.91ms -4.06%
fib/200/run 414.4±7.25ms 406.3±4.36ms -1.95%

Benchmark for Linux-default 91b0ba7

Click to hide benchmark
Test Base PR %
fib/100/proof 6.3±0.06s 6.3±0.07s 0.00%
fib/100/run 1453.1±2.73ms 1443.6±17.95ms -0.65%
fib/200/proof 6.3±0.07s 6.3±0.06s 0.00%
fib/200/run 1460.9±4.35ms 1445.0±3.21ms -1.09%

Benchmark for macOS-default 91b0ba7

Click to hide benchmark
Test Base PR %
fib/100/proof 3.9±0.05s 3.9±0.05s 0.00%
fib/100/run 692.5±1.80ms 691.8±1.18ms -0.10%
fib/200/proof 3.9±0.03s 3.9±0.04s 0.00%
fib/200/run 694.4±1.75ms 694.1±0.98ms -0.04%

Benchmark for macOS-metal 91b0ba7

Click to hide benchmark
Test Base PR %
fib/100/proof 1488.0±3.86ms 1483.4±6.37ms -0.31%
fib/100/run 692.4±1.44ms 692.3±2.85ms -0.01%
fib/200/proof 1496.9±8.00ms 1492.6±6.21ms -0.29%
fib/200/run 694.4±1.77ms 694.3±1.07ms -0.01%

@flaub flaub merged commit 11eb0f9 into main Apr 24, 2023
12 checks passed
@flaub flaub deleted the flaub/fix-cuda branch April 24, 2023 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants