https://developer.nvidia.com/how-to-cuda-Python

python is one of the fastest growing and most popular programming languages available. However, as an interpreted language, it has been considered too slow for high-performance computing.  That has now changed with the release of the NumbaPro Python compiler from Continuum Analytics.

CUDA Python – Using the NumbaPro Python compiler, which is part of the Anaconda Accelerate package from Continuum Analytics, you get the best of both worlds: rapid iterative development and all other benefits of Python combined with the speed of a compiled language targeting both CPUs and NVIDIA GPUs.

Getting Started

  1. If you are new to Python, the python.org website is an excellent source for getting started material.
  2. Read this blog post if you are unsure what CUDA or GPU Computing is all about.
  3. Try CUDA by taking a self-paced lab on nvidia.qwiklab.com. These labs only require a supported web browser and a network that allows Web Sockets. Click here to verify that your network & system support Web Sockets in section "Web Sockets (Port 80)", all check marks should be green.
  4. Watch the first CUDA Python CUDACast:
  5. Install Anaconda Accelerate
  6. First install the free Anaconda package from this location.
  7. Once Anaconda is installed, you can install a trial-version of the Accelerate package by using Anaconda’s package manager and running conda install accelerate.  See here for more detailed information.  Please note that the Anaconda Accelerate package is free for Academic use.

Learning CUDA

  1. For documentation, see the Continuum website for these various topics:

    • Learn more about libraries
    • See how to use vectorize to automatically accelerate functions
    • Writing CUDA directly in Python code
  2. Browse through the following code examples:
  3. Browse and ask questions on NVIDIA’s DevTalk forums, or ask at stackoverflow.com.

So, now you’re ready to deploy your application?
You can register today to have FREE access to NVIDIA TESLA K40 GPUs.
Develop your codes on the fastest accelerator in the world. Try a Tesla K40 GPU and accelerate your development.

Performance/Results

  • It’s possible to get enormous speed-up, 20x-2000x, when moving from a pure Python application to accelerating the critical functions on the GPUs.  In many cases, with little changes required in the code.  Some simple examples demonstrating this can be found here:
    1. A MandelBrot example accelerated with CUDA Python.  19x speed-up over the CPU-only accelerated version using GPUs and a 2000x speed-up over pure interpreted Python code.
    2. A Monte Carlo Option Pricer example accelerated with CUDA Python.  Achieved a 30x speed-up over interpreted Python code after accelerating on the GPU.

Alternative Solution - PyCUDA

Another option for accelerating Python code on a GPU is PyCUDA.  This library allows you to call the CUDA Runtime API or kernels written in CUDA C from Python and execute them on the GPU.  One use case for this is using Python as a wrapper to your CUDA C kernels for rapid development and testing.

GPU Accelerated Computing with Python的更多相关文章

  1. Chromium Graphics : GPU Accelerated Compositing in Chrome

    GPU Accelerated Compositing in Chrome Tom Wiltzius, Vangelis Kokkevis & the Chrome Graphics team ...

  2. INTERSPEECH 2015 | Scalable Distributed DNN Training Using Commodity GPU Cloud Computing

    一般来说,全连接层的前向和后向传递所需的计算量与权重的数量成正比.此外,数据并行训练中所需的带宽与可训练权重的数量成比例.因此,随着每个节点计算速度的提高,所需的网络带宽也随之增加.这篇文章主要是根据 ...

  3. Python的GPU编程实例——近邻表计算

    技术背景 GPU加速是现代工业各种场景中非常常用的一种技术,这得益于GPU计算的高度并行化.在Python中存在有多种GPU并行优化的解决方案,包括之前的博客中提到的cupy.pycuda和numba ...

  4. 常用python机器学习库总结

    开始学习Python,之后渐渐成为我学习工作中的第一辅助脚本语言,虽然开发语言是Java,但平时的很多文本数据处理任务都交给了Python.这些年来,接触和使用了很多Python工具包,特别是在文本处 ...

  5. 大数据分析与机器学习领域Python兵器谱

    http://www.thebigdata.cn/JieJueFangAn/13317.html 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然开发语言是C/ ...

  6. Python 网页爬虫 & 文本处理 & 科学计算 & 机器学习 & 数据挖掘兵器谱(转)

    原文:http://www.52nlp.cn/python-网页爬虫-文本处理-科学计算-机器学习-数据挖掘 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然开 ...

  7. [转载]Python兵器谱

    转载自:http://www.52nlp.cn/python-网页爬虫-文本处理-科学计算-机器学习-数据挖掘 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然 ...

  8. Python相关机器学习‘武器库’

    开始学习Python,之后渐渐成为我学习工作中的第一辅助脚本语言,虽然开发语言是Java,但平时的很多文本数据处理任务都交给了Python.这些年来,接触和使用了很多Python工具包,特别是在文本处 ...

  9. Python Tools for Machine Learning

    Python Tools for Machine Learning Python is one of the best programming languages out there, with an ...

随机推荐

  1. Android的资源类型和存储方式简介-android学习之旅(五十二)

    android资源的类型 android资源的存储方式

  2. 【一天一道LeetCode】#110. Balanced Binary Tree

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given a ...

  3. EBS DBA指南笔记(二)

    第三章 监控和诊断   本章涵盖以下几个主题:监测的方法,数据库的监测,apache的监测,forms的监测,并发管理器的监测,服务器的监测,网络的监测,其它的一些监测和诊断方法. 1.监测的方法:主 ...

  4. 从JDK源码角度看java并发线程的中断

    线程的定义给我们提供了并发执行多个任务的方式,大多数情况下我们会让每个任务都自行执行结束,这样能保证事务的一致性,但是有时我们希望在任务执行中取消任务,使线程停止.在java中要让线程安全.快速.可靠 ...

  5. 72【leetcode】经典算法- Lowest Common Ancestor of a Binary Search Tree(lct of bst)

    题目描述: 一个二叉搜索树,给定两个节点a,b,求最小的公共祖先 _______6______ / \ ___2__ ___8__ / \ / \ 0 _4 7 9 / \ 3 5 例如: 2,8 - ...

  6. Android启动过程分析

    Android系统启动过程 首先看一张Android框架结构图 Linux内核启动之后就到Android Init进程,进而启动Android相关的服务和应用. 启动的过程如下图所示:(图片来自网上, ...

  7. XBMC源代码分析 7:视频播放器(dvdplayer)-输入流(以libRTMP为例)

    前文分析了XBMC的基本结构: XBMC源代码分析 1:整体结构以及编译方法 XBMC源代码分析 2:Addons(皮肤Skin) XBMC源代码分析 3:核心部分(core)-综述 XBMC源代码分 ...

  8. (NO.00001)iOS游戏SpeedBoy Lite成形记(二十一)

    现在游戏中如果钱用光了赌场也是不管的,所以我们要加上Game Over的逻辑. 出现游戏结束条件很简单,就是GameState的totalMoney <= 0.而在游戏结束时我们要做些什么呢?有 ...

  9. APPCORE Routine APIs

    Introduction to APPCORE Routine APIs This chapter provides you with specifications for calling many ...

  10. 【Android 系统开发】下载 编译 Android源代码 和 Android kernel源代码

    下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...