From 7fe4fd68494dc18e2fe0f80141455c5d37055cb1 Mon Sep 17 00:00:00 2001 From: Massimiliano Mantione Date: Fri, 8 Nov 2024 16:37:13 +0100 Subject: [PATCH] Clarified a few things. --- RustLab2024/slides.md | 416 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 408 insertions(+), 8 deletions(-) diff --git a/RustLab2024/slides.md b/RustLab2024/slides.md index 4e8def9..4010ec5 100644 --- a/RustLab2024/slides.md +++ b/RustLab2024/slides.md @@ -89,8 +89,25 @@ My Worlplace Since Sep 2020 ------- +This is Where I start +--- + + +##### I was hired as an algorithm engineer + + +##### to fix performance issues + + +##### make the system scale + + +##### and yes, implement new features + +------- + -Overall Architecture +Routing Engine Architecture --- @@ -318,8 +335,8 @@ OK, this is C++: and Rust? --- -#### initial *experiments* -##### analyzing **instances** +#### my initial *experiments*: +##### analyzing **problems** #### *3 months* of data @@ -352,21 +369,179 @@ We *Really* Need To Scale *Now*! ------- -How to Do It +How the Splitter Works +--- + + + + + +#### a large problem + + + +``` +no_margin + 🏠 🏠 + 🏠 🏠 🏠 + 🏠 🏠 + 🏠 🏠 + 🏠 + 🚚 🚚 🏠 + 🏭 + 🚚 🚚 🏠 + 🏠 🏠 + 🏠 🏠 🏠 + 🏠 + 🏠 🏠 🏠 + 🏠 🏠 +``` + + + +#### a large problem +#### we split it + + + +``` +no_margin + 🏠 ┊ 🏠 + 🏠 🏠 ┊ 🏠 + 🏠 ┊ 🏠 + 🏠 ┊ 🏠 + ┊ 🏠 + 🚚 ┊🚚 🏠 +╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌🏭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 🚚 ┊🚚 🏠 + 🏠 ┊ 🏠 + 🏠 🏠 ┊ 🏠 + ┊ 🏠 + 🏠 🏠 ┊ 🏠 + 🏠 ┊ 🏠 +``` + + + +#### a large problem +#### we split it +#### we solve subproblems + + + +``` +no_margin + ┏━━🏠 ┊ 🏠 + 🏠━━━┓ 🏠 ┊ 🏠 + ┃ 🏠━┛ ┊ 🏠 + ┗🏠 ┊ 🏠 + ┃ ┊ 🏠 + ┗━━━━━━━🚚 ┊🚚 🏠 +╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌🏭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 🚚 ┊🚚 🏠 + 🏠 ┊ 🏠 + 🏠 🏠 ┊ 🏠 + ┊ 🏠 + 🏠 🏠 ┊ 🏠 + 🏠 ┊ 🏠 +``` + + + +#### a large problem +#### we split it +#### we solve subproblems +#### one at a time + + + +``` +no_margin + ┏━━🏠 ┊ ┏━━🏠 + 🏠━━━┓ 🏠 ┊ ┏━🏠 ┃ + ┃ 🏠━┛ ┊ 🏠 ┃ ┃ + ┗🏠 ┊ ┃ ┗━━🏠 + ┃ ┊ 🏠━┓ + ┗━━━━━━━🚚 ┊🚚━━━━🏠 +╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌🏭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 🚚 ┊🚚 🏠 + 🏠 ┊ 🏠 + 🏠 🏠 ┊ 🏠 + ┊ 🏠 + 🏠 🏠 ┊ 🏠 + 🏠 ┊ 🏠 +``` + + + +#### a large problem +#### we split it +#### we solve subproblems +#### one at a time +##### possibly in parallel + + + +``` +no_margin + ┏━━🏠 ┊ ┏━━🏠 + 🏠━━━┓ 🏠 ┊ ┏━🏠 ┃ + ┃ 🏠━┛ ┊ 🏠 ┃ ┃ + ┗🏠 ┊ ┃ ┗━━🏠 + ┃ ┊ 🏠━┓ + ┗━━━━━━━🚚 ┊🚚━━━━🏠 +╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌🏭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 🚚 ┊🚚━┓ 🏠 + ┏━━━🏠━━━━┛ ┊ 🏠 ┃ + 🏠━━━━━🏠━━┓ ┊ ┗━🏠 ┃ + ┃ ┊ ┃ ┗🏠┓ + ┏━━🏠━━━━━━🏠 ┊ ┗━🏠 ┃ + 🏠 ┊ ┗━━━🏠 +``` + + +#### a large problem +#### we split it +#### we solve subproblems +#### one at a time +##### possibly in parallel + +#### **then we merge** +##### **the results** + + + +``` +no_margin + ┏━━🏠 ┏━━🏠 + 🏠━━━┓ 🏠 ┏━🏠 ┃ + ┃ 🏠━┛ 🏠 ┃ ┃ + ┗🏠 ┃ ┗━━🏠 + ┃ 🏠━┓ + ┗━━━━━━━🚚 🚚━━━━🏠 + 🏭 + 🚚 🚚━┓ 🏠 + ┏━━━🏠━━━━┛ 🏠 ┃ + 🏠━━━━━🏠━━┓ ┗━🏠 ┃ + ┃ ┃ ┗🏠┓ + ┏━━🏠━━━━━━🏠 ┗━🏠 ┃ + 🏠 ┗━━━🏠 +``` + +------- + +Different Implementation Approaches --- #### *minimal change* + #### implement a **C++** solver ##### orchestrator **in-process** -#### *use Rust* with *minimal change* +#### use **Rust** with *minimal change* + #### implement a **Rust** solver ##### orchestrator **in-process** -#### *use Rust* with *minimal risk* +#### use *Rust* with **minimal risk** + #### implement a **Rust** solver ##### orchestrator **out-of-process** @@ -377,12 +552,12 @@ A New Component: The Runner #### thanks to the exploratory phase -##### there was Rust code to handle problems +##### there was **Rust code** to handle **problems** #### we had a *head start* to #### implement the orchestrator -##### (we call it `runner`) in Rust +##### (we call it `runner`) in **Rust** #### it mimics the underlying @@ -450,6 +625,231 @@ We Need To Scale! ------- +Scaling Up +--- + + + + + +#### you have a **small** problem + +##### you use a **small** machine + + + +``` + + + + + + + +┏━━━━━━━━━┓ +┃ o o ┃ +┃ ━━━━━━━ ┃ +┗━━━━━━━━━┛ +``` + + + + +#### you have a small problem +##### you use a small machine + +#### you have a **bigger** problem + +##### you use a **bigger** machine + + + + +``` + + + + +┏━━━━━━━━━┓ +┃ o o ┃ +┃ o o ┃ +┃ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┗━━━━━━━━━┛ +``` + + + + +#### you have a small problem +##### you use a small machine + +#### you have a **bigger** problem +##### you use a **bigger** machine + +##### *...and so on...* + + + +``` + + +┏━━━━━━━━━┓ +┃ o o ┃ +┃ o o ┃ +┃ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┗━━━━━━━━━┛ +``` + + + + +#### you have a small problem +##### you use a small machine + +#### you have a **bigger** problem +##### you use a **bigger** machine + +##### *...and so on...* + + + +``` +┏━━━━━━━━━┓ +┃ o o ┃ +┃ o o ┃ +┃ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┃ ━━━━━━━ ┃ +┗━━━━━━━━━┛ +``` + +------- + +Scaling Out +--- + + + + + +#### a **few** problems + +##### a **few** machines + + + +``` + + + + + + + + +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +``` + + + +#### a **few** problems +##### a **few** machines + +#### **more** problems + +#### **more** machines + + + +``` + + + + +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +``` + + + +#### a **few** problems +##### a **few** machines + +#### **more** problems +#### **more** machines + + + +``` +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +``` + + + +``` +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +``` + + + +``` +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +┏━━━━━━━┓ +┃ oo ┃ +┃ ━━━━━ ┃ +┗━━━━━━━┛ +``` + +------- + Logistical Computations at Scale ---