What is BentoML?

3 minute read

1. What is BentoML?

๐Ÿ”— https://docs.bentoml.org/en/latest/index.html

BentoML์€ ML๋ชจ๋ธ์„ ์ œ๊ณตํ•˜๊ธฐ ์œ„ํ•œ ์˜คํ”ˆ์†Œ์Šค ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค.

  • ML๋ชจ๋ธ์„ ์ œํ’ˆํ™”ํ•˜๋Š”๊ฒƒ์„ ๊ฐ€์†ํ™”ํ•ฉ๋‹ˆ๋‹ค.
  • ML๋ชจ๋ธ์„ ํ”„๋กœ๋•์…˜ํ•˜๋Š”๊ฒƒ์„ ํ‘œ์ค€ํ™”ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
  • ์•ˆ์ •์ ์ด๊ณ  ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๊ณ ์„ฑ๋Šฅ ๋ชจ๋ธ์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
  • ์œ ์—ฐํ•œ MLOps ํ”Œ๋žซํผ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

๊ฐ„๋‹จํ•œ ์ •์˜

BentoML = ML+ FastAPI + Docker ์ž…๋‹ˆ๋‹ค. ๐Ÿฑ

Getting Started with Docker & Fast API ๐Ÿš€๐Ÿš€ - DEV Community

์šฐ๋ฆฌ๊ฐ€ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋ธ(ML/DL)์„ ์ปจํ…Œ์ด๋„ˆํ™”(Containerize) ํ•ฉ๋‹ˆ๋‹ค. ๊ทผ๋ฐ FastAPI๋กœ Back-end End-point๋ฅผ ๊ณ๋“ค์ธ.

ํœด๋จผ๊ฐ•๋ก์ฒด, ๊ทผ๋ฐ ์ด์ œ ~๋ฅผ ๊ณ๋“ค์ธ

Docker๊ฐ€ ์žˆ์–ด์„œ BentoML์ด ๊ฐ–๋Š” ์žฅ์ 

  • Docker Daemon์ด ์žˆ์œผ๋ฉด ์–ด๋””์„œ๋“  Server๋กœ์„œ ์šด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
  • BentoML์˜ ๋ฐฐํฌ๊ฐ€ ๋นจ๋ผ์ง€๊ณ  ์‰ฝ๊ฒŒ ํ‘œ์ค€ํ™” ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ๊ฐ™์€ ๋ชจ๋ธ์„ ์—ฌ๋Ÿฌ๊ฐœ ๋„์›Œ ํ™•์žฅ์„ฑ์„ ์‰ฝ๊ฒŒ ๋„“ํž ์ˆ˜ ์žˆ๋‹ค. (Scale-Out)
  • ๋ฆฌ์†Œ์Šค ์‚ฌ์šฉ๋Ÿ‰ ์ฒดํฌ๊ฐ€ ์‰ฌ์›€.

FastAPI๊ฐ€ ์žˆ์–ด์„œ BentoML์ด ๊ฐ–๋Š” ์žฅ์ 

  • ์‰ฌ์šด API ์ถ”๊ฐ€
  • ์‰ฌ์šด API ์‚ฌ์šฉ
  • ์‰ฌ์šด ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜
  • ์‰ฌ์šด ๋ณด์•ˆ ์ ์šฉ
  • Customize๊ฐ€ ์‰ฌ์›Œ์ง.

2. BentoML์—์„œ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋ ˆ์ž„์›Œํฌ

BentoML์—์„œ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•œ ML/DL framework๋Š”? ๐Ÿ”— ์ถœ์ฒ˜

  • CatBoost
  • XGBoost
  • LightGBM
  • MLflow
  • ONNX
  • Sklearn

  • Keras
  • Tensorflow
  • Pytorch
  • fast.ai

  • Custom Model
    • Picklable Model (pickle๋กœ ์••์ถ• ๋ฐ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋ธ)

๊ทธ๋ƒฅ ๋„ˆ๊ฐ€ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋Š” ๋ชจ๋ธ์€ ๋‹ค ๋ฐฐํฌ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค„๊ฒŒ!

๋ผ๋Š” ๋งˆ์ธ๋“œ์ธ๊ฒƒ ๊ฐ™๋„ค์š”.

๊ด€๋ จ ์˜ˆ์ œ๋“ค๋“ค๋„ github์„ ํ†ตํ•ด ๊ณต์œ ํ•˜๊ณ  ์žˆ์œผ๋‹ˆ, ๋‹ค๋ค„๋ด…์‹œ๋‹ค.

3. ๋งˆ๋ฌด๋ฆฌ ๊ธ€.

ML๊ธฐ๋ฐ˜์˜ AutoML ํ”„๋ ˆ์ž„์›Œํฌ๋„ ๋‹ค๋ฃจ๊ณ ์žˆ์œผ๋‹ˆ, ์˜ˆ๋ฅผ ๋“ค๋ฉด H2O. (ํ˜„์žฌ ์ •์‹ ์ง€์›์€ ์•ˆํ•ฉ๋‹ˆ๋‹ค.)

์ž˜ ์ •์ œ๋œ ๋ฐ์ดํ„ฐ(Tabluar type)๋งŒ ์žˆ์œผ๋ฉด ์ด๊ฑธ๋กœ ๋ชจ๋ธ์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ† ์ดํ”„๋กœ์ ํŠธ๋ฅผ ํ•ด๋ณผ๊นŒ ํ•ฉ๋‹ˆ๋‹ค. ์žฌ๋ฐŒ์„๊ฒƒ ๊ฐ™์ง€ ์•Š์•„์œ ?

๋ฐฑ์ข…์›์˜ 3๋Œ€ ์ฒœ์™• : ํ•˜๋‹ˆ, ๋ผ๋ฉด ๋จน๋ฐฉํ•˜๋ฉฐ ๊นจ์•Œ ๊ฐ™์€ ๋ฐฑ์ข…์› ํ‰๋‚ด โ€œ์žฌ๋ฐŒ๋„คโ€ : SBS

Kyungseon Park

์ €๋Š” ์—ฌ์˜๋„ ์†Œ์žฌ์˜ AIํ•€ํ…Œํฌ ์Šคํƒ€ํŠธ์—… Aizen์—์„œ ML Engineer๋กœ ๊ทผ๋ฌดํ•˜๊ณ  ์žˆ๊ณ , ์ตœ๊ทผ์—๋Š” MLOps์— ๊ด€์‹ฌ์„ ๊ฐ–๊ณ  ๊ณต๋ถ€ํ•˜๊ณ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์ œ ์ •๋ณด๊ฐ€ ๋” ํ•„์š”ํ•˜๋‹ค๋ฉด ํ”„๋กœํ•„ ์‚ฌ์ง„์„ ํด๋ฆญํ•˜์„ธ์š”.