深度学习计算机预算_如何在预算有限的情况下为深度学习电脑挑选零件

深度学习计算机预算

介绍(Introduction)

I think I don’t need to mention the fact that like most people, we researchers, or more precisely PhD students are on a budget when considering computer equipment. I can’t speak for other countries, but here in Croatia, as a teaching assistant at a faculty you can expect a decent midrange laptop. For most people that’s great, because most of the PhD students I know, work a lot in the laboratory or do field experiments, and for them, a decent laptop capable of running excel, basic statistical scripts in R and/or Python, some GIS software or AutoCAD is enough.

我想我不需要提一个事实,就是像大多数人一样,我们的研究人员,或更确切地说,博士学位学生在考虑计算机设备时都处于预算之内。 我无法代表其他国家/地区发言,但是在克罗地亚,作为一名教师的助教,您可以期待一台像样的中端笔记本电脑。 对于大多数人来说,这是非常棒的,因为我认识的大多数博士生都在实验室工作或从事现场实验,而对于他们来说,是一台像样的笔记本电脑,能够在R和/或Python中运行excel,基本统计脚本,一些GIS软件或AutoCAD就足够了。

For quite a time I thought a decent laptop would be great for my research related to Hydrology and Hydrological models. And it was really great, everything worked fast and nice (thanks to an SSD and 16 gigs of RAM). As I started to work with a lot of data, and especially often not really well-formatted (find out how to address this in my other article). At the suggestion of my Mentor and a friend who also worked at a similar position, I more and more started to think that I need to learn programming to shorten boring tasks related to data formatting, copying, etc. I decided to give Python a shot.

在相当长的一段时间里,我认为一台像样的笔记本电脑对我与水文学和水文模型有关的研究将非常有用。 真的很棒,一切都运行得很好,速度很好(这要归功于SSD和16 GB的RAM)。 当我开始处理大量数据时,尤其是经常没有真正格式化的数据时(请在另一篇文章中找到如何解决此问题的方法)。 在我的导师和一个在相似位置工作过的朋友的建议下,我越来越多地认为我需要学习编程以缩短与数据格式化,复制等相关的无聊任务。我决定试一试Python 。

Instantly, I got thrilled what a great programming language it is, how easy it makes to do some tasks, on which I usually would waste 3–4 hours in excel. Don’t get me wrong, this is not a blame on excel, by all means it’s GREAT for some fast visualisations, data management or as a simple database. But more and more often I have tasks where a well written and well thought Python script just wins the game and makes life easier.

立刻,我为它是一种伟大的编程语言而感到兴奋,它使执行某些任务变得如此容易,而我通常会在excel上浪费3-4个小时。 别误会,这并不是Excel的责任,对于某些快速的可视化,数据管理或作为简单的数据库,这绝对是很棒的。 但是我越来越多地执行一些任务,在这些任务中,精心编写且经过深思熟虑的Python脚本才能赢得比赛,并使生活更轻松。

Let’s get back to the point of this story. When you consume Python and Data Sconce related content online, sooner or later you will stumble across the term “Machine Learning” due to Pythons popularity for such tasks. This is exactly what happened in my case. Pretty fast I got hooked, and started researching more about the topic.

让我们回到这个故事的重点。 当您在线使用Python和Data Sconce相关内容时,由于Python在此类任务中的流行,迟早您会偶然发现“机器学习”这个术语。 这正是我的情况。 很快,我就迷上了,开始研究有关该主题的更多信息。

In no time I found myself enrolling the Udacity course “AI Programming with Python Nanodegree”, using the 30 days free access to certain Udacity courses during the lockdown. The final goal of the course is to create an image classifier for flowers. In short, you’ve got an input image, and the code classifies it into one of the defined labels. It took me about one and a half months to pass the course.

我很快就发现自己注册了Udacity课程“使用Python Nanodegree进行AI编程”,并在锁定期间免费使用了30天的某些Udacity课程。 该课程的最终目标是为花朵创建图像分类器。 简而言之,您已经获得了输入图像,并且代码将其分类为已定义的标签之一。 我花了大约一个半月的时间才通过了这门课程。

When you start with Machine Learning tasks, and Deep Learning in particular, you often find out that some of the “green juice” (NVIDIA GPU ????) could make your decent midrange laptop or PC a lot faster. Why is that so? The answer is, CUDA cores. Why are they so important, read here in this great article! So, on a budget I started to check the computer enthusiast forums and sites with used parts for second-hand hardware.

当您开始执行机器学习任务,尤其是深度学习时,通常会发现一些“绿色果汁”(NVIDIA GPU????)可以使您的中端笔记本电脑或PC更快。 为什么? 答案是CUDA内核。 他们为什么如此重要,请在这篇伟大的文章中阅读! 因此,我开始预算来检查计算机爱好者论坛和站点,以及二手硬件的二手零件。

I will not provide any test results, this is more an advice type of article, from my perspective and years of experience of buying second hand parts over forums and different sites. I will try to explain what parts can be bought second hand, to save some cash, or get better performance for same money, without taking unnecessary risk.

我不会提供任何测试结果,从我的角度以及多年在论坛和不同站点上购买二手零件的经验来看,这只是文章的建议类型。 我将尝试说明可以二手购买哪些零件,以节省一些现金,或用相同的钱获得更好的性能,而无需承担不必要的风险。

*处理器 (CPU)

深度学习计算机预算_如何在预算有限的情况下为深度学习电脑挑选零件
Photo by Luan Gjokaj on Unsplash
Luan GjokajUnsplash上的 照片

Many consider the “Central Processing Unit” or shorter CPU as the heart of a computer. The most common question when you search together the terms “CPU” and “deep learning” is “Does the CPU matter for deep learning?”. This is a tricky question, probably the best answer I found is by Colin Cassady on Quora, “It does matter so much as for gaming”. Since the CPU does the job of data preparing for the GPU, it had to be fast enough to not bottleneck the selected GPU. The CPU can be considered as a fast car, it can fetch data from main memory very fast but it has low bandwidth, so it cannot process a lot of data at a time.

许多人将“*处理器”或更短的CPU视为计算机的心脏。 当一起搜索术语“ CPU”和“深度学习”时,最常见的问题是“ CPU对深度学习有意义吗?”。 这是一个棘手的问题,可能我找到的最佳答案是Colin Cassady在Quora上发表的文章,“对游戏而言,这确实很重要”。 由于CPU完成了为GPU准备数据的工作,因此它必须足够快才能不阻塞所选GPU。 CPU可以看作是一辆快车,它可以非常快地从主内存中获取数据,但带宽很低,因此无法一次处理大量数据。

Things I found that had to be considered were: a) number of core (and clock speed) and b) price (important when you are on a tight budget).

我发现必须考虑的事情是:a)内核数量(和时钟速度)和b)价格(在预算紧张的情况下很重要)

Since Ryzen came out in 2017, many consider it better value for many then Intel. And probably that’s true. Especially, for workload, Ryzen beats Intel by far. The only thing where Intel could shine was gaming.

自Ryzen于2017年问世以来,许多人认为它对许多公司而言都比英特尔具有更高的价值。 可能是真的。 特别是在工作量方面,Ryzen远远超过了Intel。 英特尔唯一能够发光的就是游戏。

I tried to find the best deal between used parts. I wasn’t looking for Intel or AMD, just best bang for the buck. I found a pretty good deal for a Intel i5 8400, a 6-core 6-thread CPU with a base clock of 2.8 GHz and boost of 4.0 GHz. Sure, an i7 or Ryzen would certainly be better, but no good deals were present at the time.

我试图找到二手零件之间的最佳交易。 我不是在寻找Intel或AMD,只是想物有所值。 我发现Intel i5 8400是一个相当不错的选择,这是一个6核6线程CPU,基本时钟为2.8 GHz,提升为4.0 GHz。 当然,i7或Ryzen肯定会更好,但是当时还没有很好的交易。

I strongly recommend checking your local sites with second-hand computer parts, i.e. ebay or amazon, since a CPU very rarely breaks down. In terms of physical damage, Intel is probably harder to damage, since the contact pins are on the motherboard, while for AMD the pins are on the CPU.

我强烈建议您使用二手计算机零件(例如ebay或Amazon)检查您的本地站点,因为CPU很少发生故障。 就物理损坏而言,英特尔可能更难损坏,因为接触针位于主板上,而对于AMD而言,针位于CPU上。

As always, the best option when buying second hand is personal handover to avoid fraud or physically damaged parts.

与往常一样,购买二手货时最好的选择是个人交接,以避免欺诈或人为损坏的零件。

主板或MBO (Motherboard or MBO)

When you’ve decided what CPU suits best your needs, it’s time to choose the right MBO for it. Since I don’t need to support for multi GPU or a lot of hard drives, a more basic board will do the job. Since I went with intel, they are offering few different chipsets H, B, Q and Z. H and B chipsets are the basic one, while Z offers more upgrade options and features and is meant for enthusiasts, overclockers and gamers. I couldn’t find a good second hand deal near my city, so I went for a H310M board from Asrock board from the local store. I personally avoid buying second hand motherboards, since it’s pretty easy to damage the pins on Intel boards, if not handled with care. Also, the saving on used ones, is not that great.

当您确定哪种CPU最适合您的需求时,就该选择合适的MBO了。 由于我不需要支持多GPU或大量硬盘,因此可以使用更基本的主板来完成。 自从我使用intel以来,他们几乎没有提供不同的芯片组H,B,Q和Z。 H和B芯片组是基本芯片组,而Z提供更多的升级选项和功能,适合发烧友,超频者和游戏玩家。 我在城市附近找不到很好的二手交易,因此我从当地商店的Asrock主板上购买了H310M主板。 我个人避免购买二手主板,因为如果不小心操作,很容易损坏英特尔主板上的引脚。 另外,在用过的机器上的节省也不是很大。

显卡 (GPU)

深度学习计算机预算_如何在预算有限的情况下为深度学习电脑挑选零件
Photo by Christian Wiediger on Unsplash
Christian WiedigerUnsplash上的 照片

Again I made my homework and started online searches on the best “Bang for the buck” in terms of GPUs for Deep Learning. There are dozens of sources, and some great on medium also. Practically many of them are around a year old, and suggest that by far the most profitable GPU is the RTX 2070 or 2060 Super. I need to mention, that in time when i was building the PC, RTX30XX series was not launched and that the article I’ve linked got updated with the results o the RTX30XX series.

再次,我做了作业,并开始在针对深度学习GPU的最佳“ Bang for the Buck”上进行在线搜索。 资料来源很多,其中一些也很不错。 实际上,它们中的许多都已使用了大约一年,并且表明迄今为止最赚钱的GPU是RTX 2070或2060 Super 。 我需要提及的是,在我构建PC时,RTX30XX系列并未启动,并且我链接的文章已更新了RTX30XX系列的结果。

I couldn’t find a good deal for RTX 2070 neither in the shop, nor second hand, so a brand new Gigabyte RTX 2060 Super Gaming from a forum was chosen. The seller has got the card through RMA process of a older faulty card. GPU’s can be bought second hand, but care has to be taken for warranty. Also, GPUs that were used for crypto mining are not the best choice.

我在商店和二手店都找不到RTX 2070的好货,因此从论坛上选择了全新的技嘉RTX 2060 Super Gaming。 卖方已通过旧有问题的卡的RMA处理获得了卡。 可以二手购买GPU,但必须注意保修。 同样,用于加密挖矿的GPU也不是最佳选择。

There are a lot of topic and articles on how to choose the right GPU for deep learning, so I strongly advise to check them out. There are some good ones on medium also.

关于如何选择合适的GPU进行深度学习,有很多主题和文章,因此我强烈建议您将它们检出。 媒体上也有一些好的。

电源模块 (PSU)

There are three types of PSUs. Non-modular, semi-modular and full-modular ones. If you don’t like much cables, you certainly can go with modular one. I like semi-modular PSUs, because they often have hard-wired 24-pin MBO, 8-pin CPU and often one 6-pin PCI-EX cable for the GPU. Al of those are needed, so such kind of unit is perfectly fine for me. I don’t see the need of paying extra for a fully modular unit, since for sure I will never detach a 24-pin cable.

PSU有三种类型。 非模块化,半模块化和全模块化的。 如果您不喜欢太多电缆,则可以肯定要使用模块化电缆。 我喜欢半模块化PSU,因为它们通常具有硬连线的24针MBO,8针CPU和一根用于GPU的6针PCI-EX电缆。 所有这些都是需要的,所以这种单位对我来说很好。 我认为不需要为完全模块化的设备支付额外的费用,因为可以肯定的是,我永远不会拆下24针电缆。

The RTX 2060 Super needs around 180W at full load, together with the CPU and all “small” users in the system we are around 250–275 W in full load. I am a bit of a silence freak, so an above average PSU which will last several years was a must. Seasonic is probably the most popular PSU maker in the world, and also has a good reputation. I never had problems with their PSUs. Thankfully, I found a good deal at a local store for a Seasonic Core GM-650 with 7 years of warranty.

RTX 2060 Super在满负载下需要大约180W的功率,而CPU和系统中的所有“小型”用户在满负载时大约需要250–275W。 我有点沉默寡言,因此必须要使用要持续数年才能达到的高于平均水平的PSU。 Seasonic可能是全球最受欢迎的PSU制造商,并且也享有良好的声誉。 我从来没有遇到过他们的PSU问题。 值得庆幸的是,我在当地商店找到了带有7年保修的Seasonic Core GM-650的超值优惠。

The PSU is a part which can be bought second hand, if you are certain that it was not used for power crypto mining machines. Also, if going for a second hand one, be sure that it has at least 4–5 years of warranty, since the PSU is not a part which is changed very often.

如果您确定PSU不是用于电力加密采矿机的,则可以二手购买。 另外,如果要二手,请确保它至少有4-5年的保修期,因为PSU并不是经常更换的部件。

SSD(或HDD) (SSD (or HDD))

Since we live in year 2020 one SSD in the system is a must for me, at least a 250 GB unit, for the operating system. It’s very painful to work on a PC or laptop with the operating system on a hard drive, when Windows load time is like 1 minute, or the browser takes 20 seconds to open. On amazon 250 GB SSDs start from like 30$ and by far this is the best 30$ spent when configuring your PC. None other part will give a greater performance boost for 30 $ then a SSD.

由于我们生活在2020年,因此对于我来说,系统中必须有一个SSD,至少250 GB单元。 当Windows加载时间大约为1分钟,或者浏览器需要20秒钟打开时,在操作系统为硬盘的PC或笔记本电脑上工作非常痛苦。 在亚马逊上,250 GB的SSD起价为30美元,到目前为止,这是配置PC时花费的最佳30美元。 没有其他部分比SSD可以提供30美元的更大性能提升。

Modern SSDs support two standards, SATA and m.2. I will not dive into differences, since this would be outside the scope of this article. Read more about it here.

现代SSD支持SATA和m.2两个标准。 我不会深入探讨差异,因为这不在本文讨论范围之内。 在此处了解更多信息

In my case, I found great deal in the second hand market, for a m.2 unit I went with a Intel 660p, and also I found a Kingston A400 sata unit, both 500GB of size. The Intel one serves as system drive, because of better read/write speeds. Before buying, check the space requirements of the machine learning models and any other work you plan to do with your machine. For me having 1 TB of space available, is enough.

以我为例,我在二手市场上发现了很多东西,例如使用Intel 660p的m.2装置,以及金士顿A400 sata装置,两者大小均为500GB。 英特尔1可以用作系统驱动器,因为它具有更好的读/写速度。 购买之前,请检查机器学习模型的空间要求以及您计划对机器进行的任何其他工作。 对我来说,有1 TB的可用空间就足够了。

深度学习计算机预算_如何在预算有限的情况下为深度学习电脑挑选零件
SSD stats after few month of daily usage (Image by author) 每日使用几个月后的SSD统计信息(作者提供)

SSDs can be bought second hand, but be sure the check the amount of written data, since the drawback of an SSD is the “limited” life cycle. As seen in my example, I did some wear on it while using hydrologic models that tend to do a lot of writing to the drive.

SSD可以二手购买,但请确保检查已写入的数据量,因为SSD的缺点是“有限的”生命周期。 从我的示例中可以看出,在使用水文模型时,我对它做了一些磨损,这些模型往往会对驱动器进行大量写入。

案件 (Case)

Here, I looked for a decent case that will not break the bank. For me looks were in second place, build quality and air flow come in 1st place. Sadly, the used market for cases is not great. Often, the cases are not in good shape. Also, since a good case can be found for like 70 $, I went to the local PC parts dealer and got a Antec P6 m-atx case, on discount for 39 $. The case has decent air flow combined with above average looks (at least in my opinion) and enough space for SSDs. I like clean looks, so additional care has been taken when managing the cables.

在这里,我寻找了一个不会破坏银行业务的良好案例。 对我来说,外观排在第二位,建筑质量和空气流量排在第一位。 可悲的是,二手箱市场并不大。 通常情况下,案件情况不佳。 另外,由于可以找到一个好案例,价格为70美元,所以我去了当地的PC零件经销商,买了个Antec P6 m-atx机箱,打折后价格为39美元。 该机箱具有良好的空气流通性,并具有高于平均水平的外观(至少在我看来),并且有足够的空间容纳SSD。 我喜欢干净的外观,因此在管理电缆时要格外小心。

其他部分 (Other parts)

What have we forgotten? As mentioned, airflow through the case is important, therefore be sure that your case some with fans preinstalled, or get some aftermarket ones. I chose Arctic P14 fans, since they are great in terms of price/performance. Also, an aftermarket CPU cooler is a good idea, if you like silence. Here, an Arctic Freezer 34 was used. Its a 20 $ CPU cooler which is great for mid and even high end CPUs (if not overclocking). Water cooling is also an option, if going for a more enthusiast build. For mid range builds, like this one, air cooling is enough.

我们忘记了什么? 如前所述,通过机箱的气流很重要,因此请确保您的机箱中预先装有风扇,或购买一些售后配件。 我选择了Arctic P14风扇,因为它们在性价比方面非常出色。 另外,如果您喜欢沉默,那么售后CPU散热器是个好主意。 在此,使用了北极冷冻机34。 它的20美元CPU散热器非常适合中高端CPU(如果没有超频的话)​​。 如果需要更多的发烧友,也可以选择水冷。 对于像这样的中档版本,空气冷却就足够了。

结论和最后的想法 (Conclusion and final thoughts)

深度学习计算机预算_如何在预算有限的情况下为深度学习电脑挑选零件
The final build (Image by author) 最终版本(作者提供)

Here I presented my thoughts on the topic of building a machine for deep learning with budget in mind. I wanted to give my opinions which parts and why can be bought second hand. The final result can be seen here. I managed to build a decent Deep Learning PC on a budget of less than 1000 $, only on CPU and GPU I saved almost 300 $. All together around like 400 $. A nice saving which delayed my build like 3–4 weeks, and cost me some effort of searching for good deals.

在这里,我提出了关于以预算为基础构建深度学习机器的想法。 我想说一下哪些零件以及为什么可以二手购买。 最终结果可以在这里看到。 我设法用不到1000美元的预算建造了一台不错的深度学习PC,仅在CPU和GPU上我就节省了将近300美元。 大概400美元左右。 一笔可观的节省使我的建造工作延迟了3-4周,并且花了我一些时间寻找良好的交易。

But again, I advise that you only go for second hand for certain components and only if you can be sure that this particular part is not damaged and has proper warranty. Parts with no warranty should be avoided.

但是,我再次提醒您,只有在可以确定该特定零件没有损坏且具有适当保修的情况下,您才可以二手某些零件。 避免使用没有保修的零件。

If you liked my article, feel free to follow me on medium or LinkedIn. Cheers!

如果您喜欢我的文章,请随时在MediumLinkedIn上关注我。 干杯!

翻译自: https://towardsdatascience.com/how-to-pick-parts-for-a-deep-learning-pc-when-on-a-budget-d50457f9fd37

深度学习计算机预算