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

chore: encapsulate sparse API #352

Merged
merged 1 commit into from
Mar 12, 2024
Merged

chore: encapsulate sparse API #352

merged 1 commit into from
Mar 12, 2024

Conversation

winston-h-zhang
Copy link
Member

Small PR to clean up the sparse matrix API, so that manipulating the rows is clear.

.map(|ptrs| RowData::ref_cast(ptrs.try_into().unwrap()))
}

/// Retrieves the data for row slice [i..j] from `row`.
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to document that ths returned usize is a column index.

/// Wrapper type for encode rows of [`SparseMatrix`]
#[derive(Debug, Clone, RefCast)]
#[repr(transparent)]
pub struct RowData([usize; 2]);
Copy link
Member

Choose a reason for hiding this comment

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

This isn't really RowData, is it, rather RowIndexes, right?

Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Forgot to approve, the comments are non-blocking.

@huitseeker
Copy link
Member

!benchmark --bench recursive-snark --features cuda

Copy link
Contributor

github-actions bot commented Mar 7, 2024

!gpu-benchmark action failed ❌

https://github.com/lurk-lab/arecibo/actions/runs/8195838628

@samuelburnham
Copy link
Member

!benchmark --bench recursive-snark --features cuda

Copy link
Contributor

github-actions bot commented Mar 7, 2024

Benchmark for 07f571e

Click to view benchmark
Test Base PR %
RecursiveSNARK/Prove/StepCircuitSize-0 35.4±0.29ms 36.1±0.39ms +1.98%
RecursiveSNARK/Prove/StepCircuitSize-1038751 319.9±1.82ms 317.7±1.42ms -0.69%
RecursiveSNARK/Prove/StepCircuitSize-121247 64.9±0.51ms 65.2±0.20ms +0.46%
RecursiveSNARK/Prove/StepCircuitSize-22943 65.2±0.31ms 65.7±0.21ms +0.77%
RecursiveSNARK/Prove/StepCircuitSize-252319 122.6±0.46ms 127.4±0.48ms +3.92%
RecursiveSNARK/Prove/StepCircuitSize-514463 198.1±1.29ms 187.7±0.60ms -5.25%
RecursiveSNARK/Prove/StepCircuitSize-55711 53.3±0.46ms 53.7±0.35ms +0.75%
RecursiveSNARK/Prove/StepCircuitSize-6559 44.2±0.21ms 44.7±0.22ms +1.13%
RecursiveSNARK/Verify/StepCircuitSize-0 24.2±0.42ms 24.1±0.46ms -0.41%
RecursiveSNARK/Verify/StepCircuitSize-1038751 100.4±1.50ms 98.1±2.45ms -2.29%
RecursiveSNARK/Verify/StepCircuitSize-121247 33.4±2.69ms 33.8±1.08ms +1.20%
RecursiveSNARK/Verify/StepCircuitSize-22943 48.1±1.05ms 47.7±1.38ms -0.83%
RecursiveSNARK/Verify/StepCircuitSize-252319 44.9±1.13ms 44.0±1.38ms -2.00%
RecursiveSNARK/Verify/StepCircuitSize-514463 55.5±2.05ms 53.5±2.26ms -3.60%
RecursiveSNARK/Verify/StepCircuitSize-55711 28.0±1.45ms 28.4±1.28ms +1.43%
RecursiveSNARK/Verify/StepCircuitSize-6559 30.8±0.80ms 30.8±0.38ms 0.00%

Copy link
Contributor

github-actions bot commented Mar 7, 2024

!gpu-benchmark action succeeded! 🚀

https://github.com/lurk-lab/arecibo/actions/runs/8195995137

@winston-h-zhang winston-h-zhang added this pull request to the merge queue Mar 12, 2024
Merged via the queue into dev with commit ef677bf Mar 12, 2024
9 checks passed
@winston-h-zhang winston-h-zhang deleted the encapsulate-sparse branch March 12, 2024 18:05
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.

3 participants