Skip to main content

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

Metadata

Release files for cupyram 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cupyram 0.3.0
File Size Uploaded Provenance Actions
cupyram-0.3.0.tar.gz 64.9 kB With provenance Details for cupyram-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cupyram 0.3.0
File Interpreter ABI Platform Actions
cupyram-0.3.0-py3-none-any.whl Python 3 none any Details for cupyram-0.3.0-py3-none-any.whl

Total release size: 106.2 kB

Release files / cupyram-0.3.0.tar.gz

Download URL cupyram-0.3.0.tar.gz
Size 64.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f13476003fada52b13dacea5c2444d14a03b4c5285ec957fd784bee0bf3a5cff
BLAKE2b-256 checksum
How to use checksums
1a088441c0e6243bb857b1ed2384e2d0931813ca8a2e69a63be9bb386714f182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 13, 2026.

Transparency log

Release files / cupyram-0.3.0-py3-none-any.whl

Download URL cupyram-0.3.0-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ca09f57ae179b44e7da8b2b431e7ee92d6f016cbe45a426cb0f07473d47e43a
BLAKE2b-256 checksum
How to use checksums
47af5ddf2ca2b37e89fa59fa25f089b2cb8a8b4692968f6224664a4fbcc47227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 13, 2026.

Transparency log

Security for cupyram 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cupyram-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page