Parallel Computing กับ Distributed Computing (รออัพเดต)

parallel computing กับ distributed computing ต่างกันยังไง? และใช้ร่วมกันได้ยังไง?

เครดิตรูปภาพจาก https://pediaa.com/what-is-the-difference-between-parallel-and-distributed-computing/?fbclid=IwAR3Doo1-94MSERgty4A0vtFbXaBO0rrVl6rgSDn4OyCXIkEm3hIWN0I8Qvw

parallel computing เน้น performance ช่วยให้ระยะเวลารวมสั้นลง (เร็วขึ้น) แต่ขณะรันจะใช้ทรัพยากรมากกว่าปกติ

เครดิตรูปภาพจาก https://pediaa.com/what-is-the-difference-between-parallel-and-distributed-computing/?fbclid=IwAR3Doo1-94MSERgty4A0vtFbXaBO0rrVl6rgSDn4OyCXIkEm3hIWN0I8Qvw

distributed computing เน้น scalability + availability + performance + modifiability

เครดิตรูปภาพจาก https://pediaa.com/what-is-the-difference-between-parallel-and-distributed-computing/?fbclid=IwAR3Doo1-94MSERgty4A0vtFbXaBO0rrVl6rgSDn4OyCXIkEm3hIWN0I8Qvw

distribute อะไรบ้าง? เช่น distribute computing (ชัวร์), distribute data, distribute object, distribute cache เป็นต้น

ในระบบ Algorithmic Trading System & AI Robot ที่ทำก็มีใช้ทั้ง 2 อย่าง

parallel computing ใช้ในส่วน:

  1. รัน trading robot หลายตัวพร้อมกันแบบ multi-processing แต่ละตัวใช้ data และ memory ของตัวเอง ไม่ใช้ร่วมกัน
  2. เทรน machine learning model ที่ใช้อัลกอริธึม deep learning กับ xgboost ใน GPU (graphic processing unit หรือ การ์ดจอนั่นเอง) ผมใช้การ์ดจอรุ่น GTX1080Ti มีจำนวน CUDA core 3,584 core ตัวล่าสุดที่เพิ่งมาใหม่คือ RTX3090 มีหมื่นกว่า core!!! ซึ่งตอนเทรนโมเดลตัวอัลกอริธึมจะแบ่งข้อมูลเป็นหลายๆ ส่วนแล้วกระจายไปรันในการ์ดจอที่มีหลาย core ทุก core รันคู่ขนานกัน เครื่องผมใส่การ์ดจอไป 2 ตัว ก็รันคู่ขนานกัน 3,584 x 2 = 7,168 core

distributed computing ใช้ในส่วน:

  1. ชุด strategy robot 1 ชุดประกอบด้วย trading robot หลายตัว ซึ่งชุด strategy robot 1 ชุดรันอยู่ใน docker ซึ่งรันใน cloud VM instance อีกที ซึ่งแต่ละชุด strategy robot จะรันแยกกันคนละ cloud VM instance
  2. ระบบ control center ที่ประกอบด้วยระบบต่างๆ เช่น logging & monitoring, anomaly detection, circuit breaker, health check ฯลฯ รันอยู่ใน cloud VM instance แยกออกไปต่างหาก
  3. ชุด strategy robot รัน จะส่ง log & metrics ไปเก็บที่ระบบ control center จะไม่เก็บ log & metrics ไว้ที่เครื่องตัวเอง
  4. กระจายข้อมูลบางส่วนไปเก็บใน Google Cloud Firestore เช่น ข้อมูล robot configuration, price, robot & system vital sign เป็นต้น

อ้างอิงข้อมูลและรูปภาพจาก

Leave a Reply

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading