对 C、CUDA 和 & 的建议 安新人?

发布于 2024-07-15 10:17:59 字数 1433 浏览 8 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

请你别敷衍 2024-07-22 10:17:59

我不建议先尝试学习 CUDA,因为它是一项新技术,而且你没有太多编程背景。

由于您在 C(或 C++)方面没有太多经验,因此 CUDA 学习起来会很痛苦,因为它缺乏成熟度、库、漂亮的错误消息等。CUDA

适合熟悉 C 的人(C++ 经验也有帮助) )并且有一个问题需要通过重新编码或重新思考众所周知问题的解决方案来提高性能。

如果您正在尝试解决“ANN/贝叶斯”问题,我建议您使用 C++ 或 C 创建解决方案,您可以选择。 不必担心创建线程或多线程。 然后,在评估串行解决方案的响应时间后,尝试使用 OpenMP、Boost 线程等使其并行。 之后,如果您仍然需要更高的性能,那么我建议学习 CUDA。

我认为这些都是有效的观点,因为 CUDA 有一些相当神秘的错误、难以调试、完全不同的架构等。

如果您仍然感兴趣,这些是学习 CUDA 的一些链接:

在线课程:

论坛(最好的信息来源):

工具:

CUDA 中解决的问题:

I don't recommend trying to learn CUDA first since it's a new technology and you don't have much background in programming.

Since you don't have much experience in C (or C++), CUDA will be a pain to learn since it lacks maturity, libs, nice error messages, etc.

CUDA is meant for people who are familiar with C (C++ experience helps too) and have a problem which needs performance improvement by recoding or rethinking the solution of a well known problem.

If you're trying to solve "ANN/Bayesian" problems I would recommend creating your solution in C++ or C, your choice. Don't bother about creating threads or multithreading. Then, after evaluation the response times of your serial solution try to make it parallel by using OpenMP, Boost threads, w/e. After this, if you still need more performance, then I would recommend learning CUDA.

I think these are valid points because CUDA has some pretty cryptic errors, hard to debug, totally different architecture, etc.

If you're still interested, these are some links to learn CUDA:

Online courses:

Forum (the best source of information):

Tools:

Problems solved in CUDA:

久随 2024-07-22 10:17:59

您表达了 3 个不同的目标:

  • 学习用 C 语言编程
  • 学习为 CUDA 平台编写代码
  • 学习使用贝叶斯网络和/或神经网络进行数据分析

首先:对于已经拥有多个学位的人来说,这些事情并不容易场。 如果您只做一项,请务必了解贝叶斯推理。 它是迄今为止可用于数据推理的最强大的框架,您需要了解它。 查看麦凯的书(在底部提到)。 您确实为自己设定了一项具有挑战性的任务 - 祝您一切顺利!

你们的目标都是截然不同的。 学习用 C 语言编程并不是太困难。 如果可能的话,我会在你们的大学选修“算法和数据结构入门”(通常是计算机科学专业的第一门课程)(可能是用 Java 授课的)。 这对您来说非常有用,并且 C 语言的基本编码将只是学习语法的问题。

学习为 CUDA 平台编写代码更具挑战性。 根据上面的建议,请先查看 OpenMPI。 一般来说,阅读一些有关计算机体系结构的内容(Patterson & Hennessy 很好)以及一本有关并行算法的书会很有帮助。 如果您从未见过并发(即,如果您没有听说过信号量),那么查找它会很有用(操作系统课程的讲义可能会涵盖它 - 请参阅麻省理工学院开放课件)。 最后,如前所述,GPU 编程几乎没有什么好的参考资料,因为它是一个新领域。 因此,最好的选择是阅读示例源代码以了解它是如何完成的。

最后是贝叶斯网络和神经网络。 首先,请注意它们是完全不同的。 贝叶斯网络是表示大量(通常是大量)变量的联合概率分布的图形(节点和边)方式。 “神经网络”一词有些模糊,但通常指使用简单的处理元素来学习非线性函数以对数据点进行分类。 David JC MacKay 的《信息论、推理和学习算法》对贝叶斯网络和神经网络进行了非常精彩的介绍。 该书可在 http://www.inference.phy 在线免费获取.cam.ac.uk/mackay/itila/。 这本书是迄今为止我在这个主题上最喜欢的书。 讲解非常清晰,练习也很有启发性(大多数都有解决方案)。

You've expressed 3 different goals:

  • Learning to program in C
  • Learning to write code for the CUDA platform
  • Learning to use Bayes' Nets and/or Neural nets for data analysis

Firstly: these things are not easy for people who already have several degrees in the field. If you only do one, make sure to learn about Bayesian inference. It's by far the most powerful framework available for reasoning about data, and you need to know it. Check out MacKay's book (mentioned at the bottom). You certainly have set yourself a challenging task - I wish you all the best!

Your goals are all fairly different kettles of fish. Learning to program in C is not too difficult. I would if at all possible to take the "Intro to Algorithms & Data Structures" (usually the first course for CS majors) at your university (it's probably taught in Java). This will be extremely useful for you, and basic coding in C will then simply be a matter of learning syntax.

Learning to write code for the CUDA platform is substantially more challenging. As recommended above, please check out OpenMPI first. In general, you will be well-served to read something about computer architecture (Patterson & Hennessy is nice), as well as a book on parallel algorithms. If you've never seen concurrency (i.e. if you haven't heard of a semaphore), it would be useful to look it up (lectures notes from an operating systems course will probably cover it - see MIT Open Courseware). Finally, as mentioned, there are few good references available for GPU programming since it's a new field. So your best bet will be to read example source code to learn how it's done.

Finally, Bayesian nets and Neural nets. First, please be aware that these are quite different. Bayesian networks are a graphical (nodes & edges) way of representing a joint probability distribution over a (usually large) number of variables. The term "neural network" is somewhat vaguer, but generally refers to using simple processing elements to learn a nonlinear function for classifying data points. A book that gives a really nice introduction to both Bayes' nets and Neural nets is David J.C. MacKay's Information Theory, Inference and Learning algorithms. The book is available for free online at http://www.inference.phy.cam.ac.uk/mackay/itila/. This book is by far my favorite on the topic. The exposition is extremely clear, and the exercises are illuminating (most have solutions).

征棹 2024-07-22 10:17:59

如果您正在寻找有关并行编程的友好介绍,请考虑 Open MPI 或 Posix Threading一个CPU集群。 开始使用此功能所需的只是一个多核处理器。

普遍的共识是,这些新架构(gpu、cell 等)上的多编程在其编程模型和 API 的成熟度方面还有很长的路要走。 相反,Open MPI 和 PThreads 已经存在很长一段时间了,并且有很多资源可以学习它们。 一旦您熟悉了这些,就可以考虑尝试更新的技术。

虽然许多其他语言肯定有编程接口,但 C 可能是高性能计算中使用的最常见的现代语言(Fortran 和 Pascal 仍在该领域活跃)。 C++ 也相当流行,有几个生物信息学软件包使用它。 无论如何,C 无疑是一个很好的起点,如果您想要更多的语言功能或库,您可以升级到 C++(不过可能会以性能为代价)。

If you're looking for a friendly introduction to parallel programming, instead consider Open MPI or Posix Threading on a CPU cluster. All you need to get started on this is a single multi-core processor.

The general consensus is that multi-programming on these new architectures (gpu, cell, etc) have a way to go in terms of the maturity of their programming models and api's. Conversely, Open MPI and PThreads have been around for quite a while and there are lots of resources around for learning them. Once you have gotten comfortable with these, then consider trying out the newer technologies.

While there's certainly programming interfaces for many other languages, C is probably the most common modern language (Fortran and Pascal are still kicking around in this area) in use in high performance computing. C++ is also fairly popular though, several Bioinformatics packages use this. In any case, C is certainly a good starting place, and you can bump up to C++ if you want more language features or libraries (will probably be at the cost of performance though).

束缚m 2024-07-22 10:17:59

如果您对数据挖掘感兴趣,您可能还想看看名为 Orange 的开源系统。 它是用 C++ 实现的,但也支持最终用户用 Python 或可视化链接和节点语言进行编程。

我不知道它是否支持神经网络,但我知道人们用它来学习数据挖掘技术。 它支持聚类和关联规则等内容。

(此外,如果您不了解这一点,您可能想找到商学院中从事运营管理的人员。如果您对计算机科学和数据挖掘感兴趣,您可能会在那里找到志同道合的人。)

If you are interested in data mining, you might also want to look at the open source system called Orange. It is implemented in C++ but it also supports end-user programming in Python or in a visual link-and-node language.

I don't know if it supports NNs but I do know people use it for learning datamining techniques. It supports stuff like clustering and association rules.

(Also, in case you didn't know about it, you might want to track down somebody in your B-school who does operations management. If you're interested in CS and datamining, you might find likeminded people there.)

终难愈 2024-07-22 10:17:59

链接:gpgpu.org 有一些有趣的讨论

Link: gpgpu.org Has some interesting discussion

财迷小姐 2024-07-22 10:17:59

最新的 CUDA 版本(3.1、3.2)具有称为 CuBLAS 的全套功能,可在单卡设置上为您处理多核矩阵运算。 并行反向传播将是一个更大的挑战,但我正在努力。

The latest CUDA releases (3.1, 3.2) have a full featured set of functions called CuBLAS that will handle multi-coring matrix operations for you on single card setups. Paralleling the backproagation will be a bit more of a challenge, but I'm working on it.

半边脸i 2024-07-22 10:17:59

上找到了斯坦福大学免费的一些很棒的视频课程

我在 iTunesU编程方法 (CS106A)
编程抽象 (CS106B)
编程范式(CS107)
机器学习(CS229)
使用 CUDA 编程大规模并行处理器

这些课程中的每一门课程大约有 20 个左右的讲座,因此观看所有课程是一项投资,但非常值得。

I was able to find some great video courses free from Stanford on iTunesU

Programming Methodology (CS106A)
Programming Abstractions (CS106B)
Programming Paradigms (CS107)
Machine Learning (CS229)
Programming Massively Parallel Processors with CUDA

Each one of these courses has around 20 or so lectures so it's a investment to watch them all but well worth it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文