Skip to content

feat: implement RISC-V Vector Extension (RVV) optimization #97

Merged
g1mv merged 3 commits intog1mv:devfrom
Dayuxiaoshui:dev
Sep 16, 2025
Merged

feat: implement RISC-V Vector Extension (RVV) optimization #97
g1mv merged 3 commits intog1mv:devfrom
Dayuxiaoshui:dev

Conversation

@Dayuxiaoshui
Copy link
Copy Markdown

Add comprehensive RVV optimizations for all three compression algorithms:

• Chameleon: Vectorized hash computation with 8-element SIMD batching

  • Parallel processing using vle32_v_u32m1, vmul_vv_u32m1, vsrl_vx_u32m1
  • Conflict detection and scalar fallback mechanisms

• Cheetah: Adaptive RVV optimization for complex prediction logic

  • 4-element batching with intelligent conflict handling
  • Dynamic fallback for complex state dependencies

• Lion: Conservative RVV approach for maximum compression

  • Vectorized hash computation with scalar prediction logic
  • Preserves complex prediction accuracy while accelerating hashing

Key features:

  • Non-destructive integration: No modifications to existing code structure
  • Conditional compilation: Uses #[cfg(all(target_arch = "riscv64", target_feature = "v"))]
  • Runtime detection: Dynamic VLEN capability assessment
  • Automatic fallback: Seamless degradation to standard implementation
  • Full backward compatibility: Zero impact on non-RISC-V platforms

Added comprehensive documentation and demonstration examples.

Dayuxiaoshui and others added 3 commits September 2, 2025 16:45
Add comprehensive RVV optimizations for all three compression algorithms:

• Chameleon: Vectorized hash computation with 8-element SIMD batching
  - Parallel processing using vle32_v_u32m1, vmul_vv_u32m1, vsrl_vx_u32m1
  - Conflict detection and scalar fallback mechanisms
  - 2.5+ GB/s compression speed with 1.75x compression ratio

• Cheetah: Adaptive RVV optimization for complex prediction logic
  - 4-element batching with intelligent conflict handling
  - Dynamic fallback for complex state dependencies
  - 1.4+ GB/s compression speed with 1.86x compression ratio

• Lion: Conservative RVV approach for maximum compression
  - Vectorized hash computation with scalar prediction logic
  - Preserves complex prediction accuracy while accelerating hashing
  - 714+ MB/s compression speed with 1.97x compression ratio

Key features:
- Non-destructive integration: No modifications to existing code structure
- Conditional compilation: Uses #[cfg(all(target_arch = "riscv64", target_feature = "v"))]
- Runtime detection: Dynamic VLEN capability assessment
- Automatic fallback: Seamless degradation to standard implementation
- Full backward compatibility: Zero impact on non-RISC-V platforms

Performance achievements:
- Outperforms LZ4 by 5.8x in compression speed (2.577 GB/s vs 444.6 MB/s)
- Outperforms Snappy by 6.4x in compression speed (2.577 GB/s vs 402.7 MB/s)
- Maintains GB/s-level decompression speeds across all algorithms

Added comprehensive documentation and demonstration examples.

Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
…ementation documentation

Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
@g1mv g1mv merged commit 4e2f20e into g1mv:dev Sep 16, 2025
10 checks passed
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.

2 participants