GPU-accelerated Range-dependent Acoustic Model (RAM) using CuPy
Project description
CuPyRAM
GPU-accelerated Range-dependent Acoustic Model (RAM)
Overview
CuPyRAM is a high-performance GPU implementation of the Range-dependent Acoustic Model (RAM).
This project is a GPU port of PyRAM, which itself is a Python adaptation of the original RAM model created by Dr. Michael D. Collins at the US Naval Research Laboratory. RAM is available from the Ocean Acoustics Library.
Features
- GPU Acceleration: Leverages Numba CUDA and CuPy for GPU acceleration
- Compatible API: Maintains similar interface to PyRAM for easy migration
- Validated: Extensive test suite comparing results against reference implementations
Requirements
- Python >= 3.8
- NVIDIA GPU with CUDA support
- CUDA Toolkit 11.x, 12.x, or 13.x
- CuPy (matching your CUDA version)
Installation
CuPyRAM requires CuPy, which must match your CUDA version. Install based on your CUDA toolkit version:
# For CUDA 11.x
pip install cupyram[cuda11]
# For CUDA 12.x
pip install cupyram[cuda12]
# For CUDA 13.x
pip install cupyram[cuda13]
# Or install CuPy separately first, then cupyram
pip install cupy-cuda12x # or cupy-cuda11x, cupy-cuda13x
pip install cupyram
Check your CUDA version: Run nvcc --version or nvidia-smi to determine your CUDA version.
Optional Dependencies
For running tests (includes PyRAM for validation):
pip install cupyram[test]
Note: The test suite compares CuPyRAM results against the original PyRAM implementation to ensure accuracy.
Quick Start
from cupyram import CuPyRAM
# Initialize the model
model = CuPyRAM(
freq=100.0, # Frequency in Hz
zs=10.0, # Source depth in meters
zr=50.0, # Receiver depth in meters
rmax=10000.0, # Maximum range in meters
dr=10.0, # Range step in meters
# ... other parameters
)
# Run the model
tl = model.run() # Returns transmission loss array
Performance
Performance testing is ongoing. Initial tests suggest that one data-center class GPU runs about 30x faster than 1 CPU core.
To leverage GPUs, it is important to maximize your batch size. The only limit is the system's VRAM. Typically, data-center class GPUs can handle 50,000 concurrent acoustic rays (the equivalent of one PyRAM class implementation) in parallel before saturating VRAM.
Testing
Tests require a CUDA-capable GPU and include validation against the original PyRAM implementation:
# Install with test dependencies (includes PyRAM for validation)
pip install cupyram[test]
# Run tests
pytest tests/
On first run, tests will automatically generate baseline data from PyRAM for comparison. This ensures CuPyRAM results match the ground truth CPU implementation.
Note: GitHub Actions and standard CI services do not provide GPU support. If you encounter issues, please include your GPU model and CUDA version when reporting.
Differences from PyRAM
CuPyRAM maintains API compatibility where possible, but includes several optimizations:
- Most heavy computations performed on GPU
- Some CPU computations parallelized (Padé coefficients)
- Memory-efficient implementations to maximize batch size
Citation
If you use CuPyRAM in your research, please cite both this implementation and the original PyRAM:
- PyRAM: https://github.com/marcuskd/pyram
- Original RAM: Collins, M. D. (1993). A split-step Padé solution for the parabolic equation method. Journal of the Acoustical Society of America, 93(4), 1736-1742.
License
BSD 3-Clause License. See LICENSE file for details.
This project is based on PyRAM by Marcus Donnelly, which adapted the original RAM code by Dr. Michael D. Collins.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Acknowledgments
- Dr. Michael D. Collins for the original RAM implementation
- Marcus Donnelly for the PyRAM Python adaptation
- The Numba CUDA and CuPy development teams for the excellent GPU array library
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cupyram-0.3.0.tar.gz.
File metadata
- Download URL: cupyram-0.3.0.tar.gz
- Upload date:
- Size: 64.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13476003fada52b13dacea5c2444d14a03b4c5285ec957fd784bee0bf3a5cff
|
|
| MD5 |
3e81331b9da0a300de4e6c1fcde0c63f
|
|
| BLAKE2b-256 |
1a088441c0e6243bb857b1ed2384e2d0931813ca8a2e69a63be9bb386714f182
|
Provenance
The following attestation bundles were made for cupyram-0.3.0.tar.gz:
Publisher:
publish.yml on clapeyre/cupyram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cupyram-0.3.0.tar.gz -
Subject digest:
f13476003fada52b13dacea5c2444d14a03b4c5285ec957fd784bee0bf3a5cff - Sigstore transparency entry: 819394810
- Sigstore integration time:
-
Permalink:
clapeyre/cupyram@07297d651e643c453124be3275b7739a7ef1fbed -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/clapeyre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07297d651e643c453124be3275b7739a7ef1fbed -
Trigger Event:
push
-
Statement type:
File details
Details for the file cupyram-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cupyram-0.3.0-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca09f57ae179b44e7da8b2b431e7ee92d6f016cbe45a426cb0f07473d47e43a
|
|
| MD5 |
60ad7a9cba6a1322774cf28efc347e0c
|
|
| BLAKE2b-256 |
47af5ddf2ca2b37e89fa59fa25f089b2cb8a8b4692968f6224664a4fbcc47227
|
Provenance
The following attestation bundles were made for cupyram-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on clapeyre/cupyram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cupyram-0.3.0-py3-none-any.whl -
Subject digest:
2ca09f57ae179b44e7da8b2b431e7ee92d6f016cbe45a426cb0f07473d47e43a - Sigstore transparency entry: 819394828
- Sigstore integration time:
-
Permalink:
clapeyre/cupyram@07297d651e643c453124be3275b7739a7ef1fbed -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/clapeyre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07297d651e643c453124be3275b7739a7ef1fbed -
Trigger Event:
push
-
Statement type: