2

我正在开发一个使用 CNN 的机器人,它需要的内存比我的嵌入式计算机 (Jetson TX1) 所能处理的要多得多。我想知道是否有可能(以极低的延迟连接)将繁重的计算外包给 EC2 并将结果发送回 Python 脚本中使用。如果这是可能的,我将如何处理它以及延迟会是什么样子(不是计算,只是发送和接收)。

4

3 回答 3

1

可能:当然可以。

您可以使用任何类型的 RPC 来实现这一点。HTTPS 请求、xml-rpc、原始 UDP 数据包等等。如果您对延迟和少量数据更感兴趣,那么基于 UDP 的东西可能比 TCP 更好,但是您需要构建额外的逻辑来对消息进行排序并重试丢失的消息。或者类似的东西Zeromq可能会有所帮助。

至于延迟:只有你能回答这个问题,因为它取决于你从哪里连接。在离您最近的区域启动一个实例并运行ping,或mtr针对它找出往返时间。这是您可以达到的绝对最小值。您的处理时间是最重要的。

于 2017-03-30T03:21:35.043 回答
1

我认为这当然是可能的。您需要一些脚本或 Web 服务器来传输数据。以下是我认为您可以实现的方法:

  1. 将所有训练数据发送到 EC2 实例
  2. 训练你的 CNN
  3. 保存您可能需要的权重和/或任何其他生成的参数
  4. 在您的嵌入式系统上构建 CNN 并输入来自 EC2 实例的权重。由于您不需要在这里进行任何训练,也不需要加载训练集,因此内存使用量将是最小的。
  5. 使用您的嵌入式设备预测您可能需要的任何内容

由于您没有提供足够的信息,因此很难给您关于延迟的确切答案。确切的延迟高度取决于您的硬件、互联网连接、您要传输的数据量、软件等。如果您只在初始训练集上训练一次,您只需传输一次权重,因此延迟将微不足道。如果你不断地发送数据和训练,或者在远程服务器上进行预测,延迟会更高。

于 2017-03-30T03:22:02.593 回答
0

I am a former employee of CENAPAD-UFC (National Centre of HPC, Federal University of Ceará), so I have something to say about outsourcing computer power.

CENAPAD has a big cluster, and it provides computational power for academic research. There, professors and students send their computation and their data, defined the output and go drink a coffee or two, while the cluster go on with the hard work. After lots of flops, the operation ended and they retrieve it via ssh and go back to their laptops.

For big chunks of computation, you wish to minimize any work that is not a useful computation. One such thing is commumication over detached computers. If you need to know when the computation has ended, let the HPC machine tell you that.

To compute stuff effectively, you may want to go deeper in the machine and performe some kind of distribution. I use OpenMP to distribute computation inside the same machine/thread distribution. To distribute between physically separated computers, but next (latency speaking), I use MPI. I have installed also another cluster in UFC for another department. There, the researchers used only MPI.

Maybe some read about distributed/grid/clusterized computing helps you:

In my opinion, you wish to use a grid-like computation, with your personal PC working as a master node that may call the EC2 slaves; in this scenario, just use communication from master to slave to send program (if really needed) and data, in such a way that the master will have another thing to do not related with the sent data; also, let the slave tells your master when the computation reached it's end.

于 2017-03-30T03:50:13.997 回答