, ,

Accelerate Time Warp Edit Distance with cuTWED v2.0.2

Emily Techscribe Avatar

·

Accelerate Time Warp Edit Distance with cuTWED v2.0.2

Made With Python
Made With Python
GitHub release
Open Source Love svg1

Time Warp Edit Distance (TWED) is an important measure used in time series matching. Traditional TWED algorithms have an O(n^2) time and space complexity, which can pose challenges for large-scale problems. However, with the introduction of cuTWED v2.0.2, developed by Garrett Wright, computing TWED has become faster and more efficient than ever before.

cuTWED is a linear memory CUDA algorithm that leverages the power of CUDA cores to achieve great speedups in computing TWED. It is roughly O(n * n/p) in time, where p represents the number of CUDA cores. More importantly, cuTWED provides a linear memory footprint, storing only approximately 6nA + 6nB elements.

One of the key innovations of cuTWED is its improved memory access patterns and ability to parallelize over large problems. It does not require an O(n^2) matrix and instead uses a three diagonal band that moves across the dynamic program matrix in nA+nB-1 steps. This allows for massively parallel computations without compromising accuracy.

Utilizing cuTWED with thousands of CUDA cores can result in speedups of one to two orders of magnitude for common TWED problems. In fact, cuTWED is capable of achieving up to 200x acceleration on P100 GPUs when working with double precision. Additionally, cuTWED’s linear memory footprint enables the computation of previously intractable problems, making it a powerful tool for tackling large systems of inputs.

To get started with cuTWED, simply install it using pip (for Linux) with the following command:

pip install cuTWED

However, if your situation requires maximum performance or if you do not have a CUDA card, you may need to build cuTWED from source. Please refer to the documentation for detailed instructions on building and installing cuTWED.

The cuTWED package includes both the main CUDA C library and Python bindings for easy integration. The Python bindings can be installed using pip once the CUDA C library is built. The Python interface allows for seamless integration with the Python ecosystem, making it convenient for data scientists and developers to incorporate cuTWED into their projects.

With cuTWED, not only can you compute TWED faster and more efficiently, but you can also leverage its compatibility with other technologies. cuTWED works seamlessly with C/C++, allowing you to include “cuTWED.h” and link with the shared library “libcuTWED.so”. In Python, you can import the cuTWED module and start using the twed() function to compute TWED on host-side arrays or the twed_dev() function to utilize GPU memory directly.

Furthermore, cuTWED’s compatibility with other Python libraries such as Numpy, PyCUDA, and CFFI makes it easy to integrate into existing workflows. You can take advantage of cuTWED’s batch processing capabilities with twed_batch() and twed_batch_dev() to efficiently compute TWED for multiple time series.

Looking ahead, the cuTWED team has exciting plans for the future. They are actively working on optimizations and multi-GPU options for large batches. Their goal is to further enhance the performance and scalability of cuTWED, making it even more powerful for time series matching tasks.

In conclusion, cuTWED v2.0.2 is a game-changer in the field of Time Warp Edit Distance computation. With its linear memory CUDA algorithm and massive parallelization capabilities, cuTWED enables faster and more efficient computation of TWED, providing speedups of up to 200x on P100 GPUs. Whether you are a data scientist, researcher, or developer, cuTWED is a powerful tool that can revolutionize your time series matching tasks.

So why wait? Install cuTWED today and experience the incredible speed and efficiency of Time Warp Edit Distance computation!

Leave a Reply

Your email address will not be published. Required fields are marked *