Skip to content

Commit

Permalink
Win linux mac (#45)
Browse files Browse the repository at this point in the history
* 1

* ubuntu

* Update windows-linux-or-macos.md
  • Loading branch information
ypwhs committed Apr 23, 2024
1 parent 6f22a56 commit bf7009d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/windows-linux-or-macos.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Windows、Ubuntu 还是 macOS?

更新时间:2024 年 4 月

Windows、Ubuntu 和 macOS 这三个操作系统都有不可替代之处,我在工作中大部分情况下都会使用 macOS 作为终端,在使用 office 软件、百度云的时候会用到 Windows。虽然我直接使用的机器是 macOS 的操作系统,但是实际上运行程序的机器是 Ubuntu(Linux)操作系统。

## Ubuntu
Expand All @@ -8,10 +10,17 @@ Windows、Ubuntu 和 macOS 这三个操作系统都有不可替代之处,我

* 易用性强
* 使用人数多,教程多,生态好
* 各个深度学习框架的官方支持,比如 [PyTorch 直到 2022 年都没有支持 NCCL 多卡训练](https://github.com/pytorch/pytorch/issues/42095)
* 各个深度学习框架的官方支持
* 各类最新技术的最先支持平台

从开发环境到部署环境,Linux 系统贯穿始终,选择一款易用的 Linux 操作系统将会缩短开发周期。

建议选择目前最新的 LTS 版本,参考链接:[https://wiki.ubuntu.com/Releases](https://wiki.ubuntu.com/Releases)

比如现在我会选择 Ubuntu 22.04.4 LTS:

![](windows-linux-or-macos/image.png)

## macOS

使用 macOS 的原因有很多,下面我们逐一分析。
Expand Down Expand Up @@ -39,10 +48,16 @@ Windows、Ubuntu 和 macOS 这三个操作系统都有不可替代之处,我
这个操作系统通常是大家最为熟悉的操作系统,所以这里就不再介绍它的优点,这里只提几个缺点:

* 深度学习框架的官方支持不够及时,TensorFlow 于 2015年11月发布,但是一年之后才首次支持 Windows:[TensorFlow now builds and runs on Microsoft Windows](https://github.com/tensorflow/tensorflow/releases/tag/0.12.0-rc0)
* [PyTorch 直到 2024 年都没有支持 Windows 多卡训练](https://github.com/pytorch/pytorch/issues/42095)
* 其他学者开发的新模型的代码通常需要进行修改才能在 Windows 上运行,如果他们的代码涉及 CUDA 编程,自定义算子,这种修改会很困难
* 路径的斜杠与其他操作系统不同,Windows 使用的是 `\`,容易作为转义字符解析成其他字符导致 bug
* 换行符与其他操作系统不同,Windows 使用的不是 `\n`,而是 `\r\n`
* 命令行与其他操作系统不同,许多命令功能一样,但是名字不同,比如 ifconfig 与 ipconfig,rm 与 del 等

**为了能够使用大多数深度学习工程师开源的代码,我们建议使用 Ubuntu 作为运行代码的机器。**
![](windows-linux-or-macos/image1.png)

![](windows-linux-or-macos/image2.png)

[bitsandbytes](https://github.com/TimDettmers/bitsandbytes) 是一个大模型量化的库,它的 8bit Adam 优化器对小显存的训练非常有用,这个库 2021 年 10 月就发布了,但是直到 2024 年 3 月才支持 Windows:[https://github.com/TimDettmers/bitsandbytes/releases/tag/0.43.0](https://github.com/TimDettmers/bitsandbytes/releases/tag/0.43.0)

**为了能够使用大多数深度学习工程师开源的代码,我们建议使用 Ubuntu 作为运行代码的机器。**
Binary file added docs/windows-linux-or-macos/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/windows-linux-or-macos/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/windows-linux-or-macos/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf7009d

Please sign in to comment.