SlideShare a Scribd company logo
1 of 98
Download to read offline
PyCon Korea 2019
머신러닝 및 데이터 과학 연구자를 위한
python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
신정규
+김준기, 박종현
오늘의 발표 주제:
2015년의 발표 연장
+
그 동안의 소회
© Jeongkyu Shin
4년 전…
https://www.slideshare.net/inureyes/pycon-kr-2015
Photo by © Jeongkyu Shin
현대 과학 연구와 개선
• 기술은 21세기, 시스템은 20세기, 학계는 19세기
• 인간이 관여하는 분야의 발전 속도가 그렇지 않은 분야의 발전 속도를 따라가지 못하는 경향
• 학계와 업계, 사회의 간극
PyCon KR 2015 발표 요약
연구말싸미 듕귁에 달아 코드로 서르 사맛띠 아니할쌔 이런 젼차로 어린 학도가
니르고져 홀빼이셔도 마참내 제 뜨들 시러펴디 못할 노미 하니라.
내 이랄 위하야 어엿비 너겨 새로 연구 코드 나누미와 과학 공학 노리터를 맹가노니
사람마다 희여 수비니겨 날로 쑤메 뼈한크이 하고져 할따라미니라.
• 재현 가능한 데이터 연구 플랫폼
• 논문용 코드로부터 실제 서비스까지 확장을 지원하는 클라우드 샌드박스 서비스
현대 과학 연구와 개선 PyCon KR 2015 발표 요약
천릿길도 한 걸음부터.
..설마 진짜 천 리 인건 아니겠지
현대 과학 연구와 개선 PyCon KR 2015 발표 요약
컨테이너 기반의
고밀도
분산처리 플랫폼
및 사용자 편의 기능 구현
2015년 발표 후…
은 한 6개월이면 어떻게 될 것 같은데…
(프로토타입도 만들었으니)
Photo by © Jeongkyu Shin
만화나 영화 보면 보통 프로토타입이 제일 좋던데…
Vector Graphics by Vecteezy.com
4 Years Later
4 년 후
권불10주
우공이산
설상가상
화룡점정
홍익인간
오늘의 이야깃거리
이름이 생겼습니다
• Sorna (2015~) ➜ Backend.AI (2017~)
• 뒤에선 Backend.AI 라고 부를 거에요.
오픈소스가 되었습니다.
• 2016년 11월 (Sorna) 오픈소스 1.0
• 여섯 번 메이저 버전업이 있었고,
• 1.1, 1.2, 1.3, 1.4, 18.12, 19.03
• 상도 몇 개 받았죠!
LTS도 나왔습니다.
• Backend.AI 19.03 (첫 LTS)
들어가기 전에 몇가지
짜 잔
…발표 끝날 때 쯤이면 ‘짜잔’이 ‘짠’하게 보이실 겁니다.
PyCon Korea 2019
권불10주
: 이 바닥은 10주마다 바뀌더라.
뭐든지 빠른 세상!
24개월: Nvidia 하드웨어 generation 주기
18개월: Python의 안정 버전 주기
6개월: Docker Engine의 안정 버전 주기
6주: TensorFlow의 안정(?) 버전 주기
권불10주: 세상의 속도
용어 설명
Bear
Metal Bear Photo by © Bill Ohrmann – Metal Bear Sculpture
Baremetal Photo by © Jeongkyu Shin
Cluster Photo by © Facebook Inc.
Baremetal
Cluster
Baremetal
VM VM
Baremetal
VM VM
• 가상 머신 (Virtual Machine)
• 하드웨어 레벨의 가상화 솔루션
• 독립된 운영체제 및 환경
• 베어메탈의 운영체제에 영향 받지 않음
• 가상화된 하드웨어를 VM 내에 제공
• 장단점
• 완벽하게 격리된 환경 / 여러 OS 실행
• 성능 저하
Cloud
Baremetal
OS
Container layer
Containers
Baremetal
VM VM
OS
Container layer
Containers Containers
OS
Container layer
Baremetal
VM VM
OS
Container layer
Containers Containers
OS
Container layer
Baremetal
OS
Container layer
Containers
Shared Dedicated
Baremetal
VM VM
OS
Container layer
Containers Containers
OS
Container layer
• 컨테이너
• 호스트 운영체제 커널을 공유
• 커널을 제외한 부분들을 격리
• 구현
• Container layer: LXC / runC / Jail…
• Namespace 기반의 가상화
• 보안 정책 및 컨트롤그룹 앨리어싱
• seccomp / cgroup
Cloud
Cloud
클라우드 매니저
• 클러스터에 VM 또는 스토리지를 생성, 삭제, 배치, 관리하는 역할 담당
• IaaS (Infrastructure as a Service) 구축을 위한 소프트웨어
컨테이너 관리 솔루션 (컨테이너 오케스트레이터)
• 컨테이너를 생성, 삭제, 배치, 관리하는 역할 담당
Rootless 컨테이너 및 특화 컨테이너 솔루션의 등장
• Docker ➜ Podman, LXD, Singularity
컨테이너 관리 솔루션의 발전: Borg ➜ Swarm, Kubernetes, Mesos, Backend.AI
권불10주: 컨테이너 기술의 진보
이름 개발사 연도 특징
LXC IBM 2008 리눅스 컨테이너 실증
Docker Docker 2013 컨테이너 대중화
LXD Canonical 2015 데스크탑 어플리케이션 배포용도
Singularity Sylabs 2016 과학 연산 특화
Podman Containers Org. 2017 유저 권한으로 실행됨
마이크로서비스
• 어플리케이션을 작은 단위로 쪼갬
• 서비스 모듈 + 통신
• 빠른 버전업 및 지속적 통합
기반 언어의 변화
• Python + Node.js + GO + C++ + PHP + JAVA…
프로토콜의 확장
• REST ➜ ZeroMQ, GraphQL, Callosum…
권불10주: microservice의 대두
Chart by © Martin Fowler. https://martinfowler.com/bliki/MicroservicePremium.html
Asynchronous Programming
Asynchronous I/O의 도래
• 마이크로서비스: 지연 시간 예측 난도
• 많은 마이크로서비스들이 비동기로 동작
권불10주: 비동기의 시대
언어 구현체 / 문법 버전
Python asyncio 3.5
Node.js Promise / Async 7
JavaScript Promise ECMA6
GO goroutine
Java @Async JDK 1.8
C++ future / promise C++11
프로그래밍 언어의 비동기 I/O 지원.
리스트에 없는 언어의 경우 비동기 지원 라이브러리들이 있음
PyCon Korea 2019
우공이산
: 몰랐으니까 산을 옮길 시도를 시작할 수 있었다.
필요한 것
• 샌드박스 기반의 코드 실행 서비스
• 클라우드 기반 유저 인터페이스
• 소유자 / 그룹 / 커뮤니티 / 노트
• 공유시스템
• 서비스를 사용하기 위한 웹/앱
우공이산: 기본 설계하기
기본 테크스택 (2015 AUG. PyCon KR)
우공이산: 기본 설계하기
Backend.AI Manager
Backend.AI Agent
Scaling Group Scaling Group
Backend.AI Agent
Backend.AI Agent
Backend.AI Agent
Backend.AI Agent
Backend.AI Client
Kernel Kernel
Kernel
Kernel Kernel
Kernel
Kernel
네트워크
스토리지
세션 DB
사용자 DB
설정 서버
Sorna (Backend.AI) 설계 (2016)
우공이산: 기본 설계하기
>_
Backend.AI Client SDK
for Python
HTTPS
WebSocket / REST /
GraphQL
ZeroMQ
etcdRedisPostgreSQL
(DB별 전용 프로토콜)
Backend.AI Client SDK
for Javascript
Tensor
Flow
Backend.AI Jail
R
Backend.AI Jail
Docker
입출력 데이터
Cloud Storage
Backend.AI Agent
Backend.AI Manager
https://api.backend.ai
§ 실시간 터미널 연결
§ 컨테이너 내부 서비스 연결
§ 관리자용 모니터링 기능 연동
§ 멀티미디어 출력 처리
§ 사용자 세션 인증
§ 실시간 사용량 추적
§ 자동 rolling upgrade
§ 시스템콜 기반 샌드박싱
§ CPU/GPU Core, Memory, Storage를 포함한
컨테이너별 자원 제약 강제
§ 사용자별 스토리지 관리
§ 권한 기반 스토리지 폴더 초대 및 공유
§ 예제 데이터 집합 제공
§ 요청 라우팅
§ I/O 릴레이 및 프록시
§ Agent 자동 스케일링
§ 하이브리드 클라우드 지원
Backend.AI component roles (2016)
일거리 산 ➜
이제
여기에
산이 쌓입니다.
목표 (2015년)
• 머신러닝: Caffe와 Theano를 잘 돌려주자!
• 속도가 필요한 연구들: Julia도 돌리자!
• MATLAB 사용자: Octave를 돌리자!
• ABM 기반의 뉴럴넷도 하니까: Repast도 돌리자!
• (생물 뉴런 모델링을 위해) NEURON 도 돌려주자!
이정도면 다가올 딥러닝 시대에 대한 준비는 완벽!
우공이산: TensorFlow의 등장
일거리 산 ➜
완!벽!합니다!
TensorFlow (2015.12~): 머신러닝 편의성 개선에 큰 역할
• GPU 가속 지원 발표
• 초기 버전에서는 CPU 지원
• 버전업에 따라 1GPU ➜ 멀티 GPU 지원 ➜ 멀티 노드 지원이 계속 추가…
• GPU 지원을 추가하자!
• Nvidia GPU 를 컨테이너에 붙이자!
• nvidia-docker
우공이산: TensorFlow의 등장 (1)
GPU 가속 지원 멀티 GPU 지원
일거리 산 ➜
Speed is everything!
• 하위 호환성은 안녕 – 1.3 / 1.4, 1.9 / 1.10, 1.12 / 1.13,4…
• 빌드 체인도 안녕
• 빌드 체인도 매번 바뀌고
• 빌드 방법도 매번 바뀌고
• 빌드 도구도 매번 바뀐다…
• Protobuf, bazel …
우공이산: TensorFlow의 등장 (2)
GPU 가속 지원 멀티 GPU 지원
일거리 산 ➜
빌드 도구 / 공개 이미지 저장소
nvidia-docker
• (당연하게도) 하드웨어 의존성이 큼
• 버전업이 되면서 구현 방법 자체가 바뀜
• V2: runC 기반의 앨리어스 덩어리
• V1 / V2 : 실질적으로 다른 구현체
• CUDA 10은 V2를 요구함
• CUDA-X는 CUDA 10.1을 요구함
• 다중 구현 필요
• 그런데
• Docker 19.03부터 v2와 유사하게 자체 지원
• Docker 하위호환때문에 버릴 수도 없음
우공이산: 왜 슬픈 예감은…
GPU 가속 지원 멀티 GPU 지원
일거리 산 ➜
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch (2017.1)
• Torch + Python 프론트엔드
• 역시 GPU를 지원함
• 멀티 노드 및 멀티 GPU 지원은 이후에 추가
간단하지 않음
• CPU-GPU 메모리 복사: 기존 Python 패키지와의
광범위한 호환성 (이 문제가 됨)
• 버전별 호환성 문제
• PyTorch도 버전 별로 사실상 다른 프레임웍임…
우공이산: PyTorch의 등장
GPU 가속 지원 멀티 GPU 지원
일거리 산 ➜
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
Photo from © bgr.com Steve Jobs (2010)
PyCon Korea 2019
설상가상
: 문제를 해결하면 문제들이 따라온다.
Parallelism
• 데이터 병렬화Data parallelism
• 데이터 파이프라인 및 forward/backward pass 병렬화
• MPI 의 parallelism과 유사
• 모델 병렬화Model parallelism
• 모델을 잘라서 처리함
• 단일 GPU로 커버하기 힘든 경우 사용
설상가상: 병렬화 지원 (1)
GPU 가속 지원 멀티 GPU 지원
일거리 산 ➜
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
데이터 병렬화 지원
• 데이터 파이프라인 구성
• 싱글 노드 – 싱글 GPU
• 싱글 노드 – 멀티 GPU
• tf.distribute.MirroredStrategy,
torch.nn.DataParallel
• 멀티 노드 – 싱글 GPU (X)
• 멀티 노드 – 멀티 GPU
• tf.distribute.CollectiveAllReduceStrategy
설상가상: 병렬화 지원 (2)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
연구분야: 세상의 속도가 다르게 흐르는 곳
• 수치해석 라이브러리들
• Python 2 기반 / 2to3로 3 지원
• Python 3의 장점을 희생함
• NLP: 주요 라이브러리들이 전부 Python 2 기반
• 포트란 기반 라이브러리들도 잊지 말라고!
• TensorFlow Extended: Python 2 의존성
• 6월에 드디어 해결됨!
설상가상: Python 2/3 지원 (1)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
파이썬 래퍼가 처리했으니 안심하라구!
(진짜?)
Photo from © Debra Bardowicks
Backend.AI 구현체
• Python 3.4로 시작 ➜ Python 3.6 요구
• 컨테이너별로 사용하는 Python이 전부 상이함
• Nvidia GPU Cloud 이미지는 Python 3.5
• 제어: 컨테이너 내부와의 통신 필요
• 자원 측정
• 앱 실행
• 어떻게 컨테이너 내부의 다양한 환경을 그대로 놓아두고
내외부 인터페이스를 만들어야 하나?
설상가상: Python 2/3 지원 (2)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
ZeroMQ
• 거의 모든 언어로 구현체가 존재하는 메세지 전달 도구
Unified message queue with ZeroMQ (2016~2017)
• 컨테이너 드라이버용으로 컨테이너 내부 환경에 맞는 구현체를
각자 구현하자
문제점
• ZeroMQ를 사용하는 부분은 해당 언어로 구현해야 함
• 지원 언어가 15가지를 넘어가게 되면서 바벨탑 쇼크가 옴
설상가상: 컨테이너 컨트롤러 구현 (1)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
일거리 산 ➜
pkg load zeromq
...
function clear (varargin)
...
endfunction
function result = execute_code(_sorna_insock, _sorna_outsock, _sorna_code)
...
try
_sorna_stdout = evalc (_sorna_code, '_sorna_stderr = lasterror.message;');
if strfind (_sorna_code, 'plot') || strfind (_sorna_code, 'figure')
gobjs = findall (0, 'type', 'figure');
for i = 1:length(gobjs)
tmpf = tmpname ();
print (gobjs(i), tmpf);
fstr = fileread (tmpf);
...
_sorna_media{i} = {'image/svg+xml', fstr};
unlink (tmpf);
endfor
endif
catch
end_try_catch
...
Endfunction
...
_sorna_insock = zmq_socket (ZMQ_PULL);
_sorna_outsock = zmq_socket (ZMQ_PUSH);
zmq_bind (_sorna_insock, 'tcp://*:2000');
zmq_bind (_sorna_outsock, 'tcp://*:2001'); Octave implementation (2017)
{-# LANGUAGE DeriveGeneric #-}
...
data ExecResult = ExecResult {
...
} deriving (Generic)
instance ToJSON ExecResult
instance FromJSON ExecResult
data ExceptionInfo = ExceptionInfo {
...}
main :: IO ()
main = do
let
runZMQ $ do
skt <- socket Rep
bind skt port
printInZMQ "serving at port 2001..."
loop skt
putStrLn "exit."
where
port = "tcp://*:2001"
loop skt = do
code_id <- receive skt
code <- receive skt
let (out, err, exceptions) = executeCode (show code_id) (U.toString code)
let result = lazyToStrict . encode $ ExecResult out err exceptions
send skt [] result
loop skt
...
Haskell implementation (2016)
Photo by © Junghoon Lee
Kernel Runner: superposed Python controller (2018)
• 컨테이너 환경 언어에 상관 없도록 단일 인터페이스를 이용한 구현
• 컨테이너의 운영체제만 영향을 줌
• Volume mount로 Python 컨트롤러 구현체를 /opt 하위에 탑재
• https://github.com/lablup/backend.ai-kernel-runner
장단점
• 언어별 별도 구현 및 중복 구현이 없어짐
• REPL 지원 ➜ jupyter_client를 우리의 백엔드로 사용
• 컨테이너 내부 언어/프레임워크와 kernel runner 실행환경의 분리가
가능해짐
• kernel runner는 asyncio로 짰지만 사용자는 Python 2 코드도 돌릴 수
있음
설상가상: 컨테이너 컨트롤러 구현 (2)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
from jupyter_client import KernelManager
from jupyter_client.kernelspec import KernelSpecManager
...
kernelspec_mgr = KernelSpecManager()
kernelspec_mgr.ensure_native_kernel = False
kspecs = kernelspec_mgr.get_all_specs()
for kname in kspecs:
if jupyter_kspec_name in kname:
kernel_mgr = KernelManager(kernel_name=kname)
kernel_mgr.start_kernel()
...
kernel_client = kernel_mgr.client()
kernel_client.start_channels(shell=True, iopub=True,
stdin=True, hb=True)
kernel_client.wait_for_ready(timeout=10)
...
async def query(code_text) -> int:
msg_id = kernel_client.execute(code_text, ...)
...
poller = zmq.asyncio.Poller()
iopub_socket = kernel_client.iopub_channel.socket
stdin_socket = kernel_client.stdin_channel.socket
poller.register(iopub_socket, zmq.POLLIN)
poller.register(stdin_socket, zmq.POLLIN)
while True:
events = dict(await poller.poll(timeout_ms))
if iopub_socket in events:
msg = kernel_client.iopub_channel.get_msg(timeout=0)
await output_hook(msg)
...
async def query(code_text) -> int:
ensure_inproc_runner()
await input_queue.async_q.put(code_text)
while True:
try:
msg = await output_queue.async_q.get()
except asyncio.CancelledError:
break
output_queue.async_q.task_done()
if msg is sentinel:
break
outsock.send_multipart(msg)
...
class PythonInprocRunner(threading.Thread):
def run(self):
sys.stdout = ConsoleOutput(...)
sys.stderr = ConsoleOutput(...)
while True:
code_text = self.input_queue.get()
self.input_queue.task_done()
try:
code_obj = code.compile_command(
code_text, symbol='exec')
except ...:
...
모든 언어마다 개별 구현 (컴파일 언어는 대체로 힘듬)
Jupyter 지원 모든 언어 사용 가능
Kernel Runner: superposed Python controller
• 배포의 귀찮음: Kernel Runner 이미지가 항상 필요함
• pip 기반의 인스톨 파이프라인에서 벗어난 설치 과정
Embedded Kernel Runner (2019)
• 아예 파일 시스템을 에이전트에 배포하고 중복마운트하면?
• https://github.com/lablup/backend.ai-krunner-ubuntu
• https://github.com/lablup/backend.ai-krunner-alpine
• https://github.com/lablup/backend.ai-krunner-centos
설상가상: 컨테이너 컨트롤러 구현 (3)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
#! /bin/sh
rm -rf /root/volume/*
tar xJf /root/archive.tar.xz -C /root/volume/
echo "$KRUNNER_VERSION" > /root/volume/VERSION
https://github.com/lablup/backend.ai-kernels
https://github.com/lablup/backend.ai-agent/tree/master/src/ai/backend/runner
https://github.com/lablup/backend.ai-krunner-ubuntu/blob/master/src
krunner-extractor.shkrunner-python.ubuntu16.04.dockerfile
FROM ubuntu:16.04
ARG PREFIX=/opt/backend.ai
ENV PATH=${PREFIX}/bin:$PATH
ENV LANG=C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends 
ca-certificates 
netbase 
&& rm -rf /var/lib/apt/lists/*
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
ENV PYTHON_VERSION 3.6.8
RUN mkdir -p ${PREFIX}; 
echo "${PREFIX}/lib" > /etc/ld.so.conf.d/backendai.conf && 
ldconfig
RUN set -ex 

&& savedAptMark="$(apt-mark showmanual)" 
&& apt-get update && apt-get install -y --no-install-recommends 
dpkg-dev 
gcc 
libbz2-dev 
libc6-dev
PyCon Korea 2019
화룡점정
: 눈 찍는게 의외로 중요한 일이다.
GraphQL
• API를 위한 쿼리 언어 / 페이스북 개발
• JSON 기반: 구현을 위해 별도의 모듈등이 필요하지 않음.
• RESTful API 대체에 용이
화룡점정: 마이크로서비스 API
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
화룡점정: 언어별 SDK 구현
type ComputeSession implements Item {
id: ID
sess_id: String
role: String
image: String
registry: String
domain_name: String
group_id: UUID
user_uuid: UUID
access_key: String
status: String
status_info: String
created_at: DateTime
terminated_at: DateTime
agent: String
container_id: String
service_ports: JSONString
occupied_slots: JSONString
occupied_shares: JSONString
num_queries: BigInt
live_stat: JSONString
last_stat: JSONString
group_name: String
lang: String
mem_slot: Int
cpu_slot: Float
gpu_slot: Float
tpu_slot: Float
cpu_used: BigInt
cpu_using: Float
mem_max_bytes: BigInt
mem_cur_bytes: BigInt
net_rx_bytes: BigInt
net_tx_bytes: BigInt
io_read_bytes: BigInt
io_write_bytes: BigInt
io_max_scratch_size: BigInt
io_cur_scratch_size: BigInt
tag: String
workers(status: String): [ComputeWorker]
}
query: "query($ak:String, $status:String) {
compute_sessions(access_key:$ak, status:$status) {
sess_id lang created_at terminated_at status occupied_slots }}"
variables: {status: "RUNNING", ak: null}
{"compute_sessions": [{
"sess_id": "oKVQNwG4-jsSDK",
"lang": "index.docker.io/lablup/ngc-tensorflow:19.02-py3",
"created_at": "2019-08-16T07:33:19.232425+00:00",
"terminated_at": null,
"status": "RUNNING",
"occupied_slots": "{"cpu": "4", "mem": "12884901888", "cuda.shares": "1"}”
}]}
요청
응답
Python 기반의 서버 어플리케이션 배포
• 오프라인일 때는?
고려할 점
• python 런타임
• 네트워크 억세스를 사용하지 않는 pip
• 설치 환경에 따라 달라지는 설정 변경
• 대규모 설치 요구 환경에서의 자동화
화룡점정: 오프라인 환경 (1)
Photo taken from Error message of Google Chrome
Installer
Builder
Builder 만들기
• Docker 이미지 빌더
• Python 번들
• Python 필요 패키지 ➜ 단일 wheel (wheelset) 빌더
• Binary wheel 이 든 이미지 패키저
패키징
• 각 프로그램별 패키저
• manager, agent, console, console-server, wsproxy,
client, ML runtimes…
• 모든걸 담은 단일 바이너리 설치 파일
화룡점정: 오프라인 환경 (2)
python utils docker cli
bin files context
Packager
agentbootstrap
console client
hub
manager
halfstack
wsproxy
Wheelsets (CentOS) Wheelsets (Ubuntu)
Ansible
• 설치 및 배포과정 자동화 도구
• 설치 노드가 두 자릿수를 넘어가는 경우에 매우 유용
• Playbook 작성 ➜ 실행의 순서
적용
• 다양한 조건에 해당하는 yml 파일 생성
• 해당 yml 에 적용한 변수를 playbook으로 작성
화룡점정: Ansible 기반 배포
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
화룡점정: Ansible 기반 배포
ansible-playbook -i custom_host
install_backend_ai_rolebased.yml -K -e "branch_name=19.03
manager_service_ip=127.0.0.1"
3.배포
1.설치
pip install ansible all:
hosts:
host1:
ansible_host: 192.168.0.10
vars:
project_name: ‘test_distribution’
ansible_user: test_dev
ansible_connection: ssh
branch_name: master
db_port: 5432
redis_port: 6379
etcd_port: 2379
…
db_data_location: ‘{{ target_directory_path }}/data/postgres’
etcd_data_location: '{{target_directory_path }}/data/etcd’
kernels_to_install:
- "lablup/python:3.6-ubuntu18.04"
- "lablup/python-tensorflow:1.14-py36-cuda9"
…
children:
…
2.설정
RestructuredText 기반의 문서화
• 코드 주석 기반 + 문서 고유 설정
• Readthedocs를 통한 배포 파이프라인 구축
폴리글랏 기반의 프로젝트 문서화
• ReST 플러그인들이 다양하게 존재하지만 잘
돌아가는게 없음
• 예) JSDoc support by Mozilla – 2017년 마지막
업데이트
• 결론:
• Python: ReST + Sphinx, JavaScript: JSDoc
화룡점정: 문서화
https://docs.backend.ai
RestructuredText 기반의 문서화
• 코드 주석 기반 + 문서 고유 설정
• Readthedocs를 통한 배포 파이프라인 구축
폴리글랏 기반의 프로젝트 문서화
• ReST 플러그인들이 다양하게 존재하지만 잘
돌아가는게 없음
• 예) JSDoc support by Mozilla – 2017년 마지막
업데이트
• 결론:
• Python: ReST + Sphinx, JavaScript: JSDoc
화룡점정: 문서화
JSDoc 기반의 문서화
화룡점정: GUI (1)
GUI: 빼먹은 조각
• 다들 연구하다 온 사람들이라 필요성을 몰랐음
• 4년 동안 몰랐음…
아는 만큼만 보인다
• 박사들이 모여 만들다 보니: 아니 GUI가 왜 필요해?
• SDK+API 를 완전하게 지원합니다!
• 설치 방법도 다양하게 지원합니다!!
• 그런데 GUI가 필요한가요? ➜ “그래서 있어요 없어요?”
화룡점정: GUI (2)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
GUI 만들기 (2019)
• CLI가 할 수 있는 모든 작업을 직관적으로 제공
필요한 것
• 앱
• 데스크탑에서 편리하게 사용할 수 있음
• 별도의 파이썬 클라이언트를 설치하지 않고 사용 가능
• 웹
• 앱을 설치하거나 관리하기 귀찮은 경우
• 브라우저만 있으면 사용할 수 있도록
화룡점정: GUI (3)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
앱
• Webcomponent 기술 기반
• Node.js + Electron
웹
• 앱의 코드를 거의 그대로 쓸 수 있게 해 보자!
• 문제: 웹은 뭘로 접속해올 지 알 수가 없다…
화룡점정: GUI (4)
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
Backend.AI
ES6 SDK
Console
App component
LitElement
Router
Summary
Redux
Runtime / session
Storage
Maintenance
Settings
Resources
Users
Pipeline
Experiments
Statistics
Pipeline
App component
코어
• Webcomponent 기술 기반
• 언어: JavaScript (ES6) ➜ TypeScript
• Polymer + lit-element
• State 관리: Redux
• 빌드체인: PolymerCLI ➜ rollup.js + Karma
• Polyfill: webcomponentsjs ➜ polyfill.app
메인 앱
• 사용부터 관리까지 모두 담당
• 클러스터 관리는 Django 기반의 전용 프로그램
별도 제작 (hub)
파이프라인 앱
• 별도 개발
• 이후 통합?
사용자
기능
관리기능
Electron
Main processRenderer process
Backend.AI
ES6 SDK
Console
App component
LitElement
Router
Summary
Redux
Runtime / session
Storage
Maintenance
Settings
Resources
Users
Pipeline
Experiments
Statistics
Pipeline
App component
Backend.AI
WebSocket
Proxy
(standalone)
Backend.AI
Node.js SDK
앱
• Electron 기반
• 코어를 그대로 사용
• node.js 기반의 프록시 구현체
• JavaScript ES6 코드 서빙
• Electron 의 File 모드로 JavaScript를
서빙할 수 없다!
• 별도의 프로토콜 (es6)을 정의 후, 해당
프로토콜에 커스텀 파서를 붙여 해결
앱
• Electron 기반
• 코어를 그대로 사용
• node.js 기반의 프록시 구현체
• JavaScript ES6 코드 서빙
• Electron 의 File 모드로 JavaScript를
서빙할 수 없다!
• 별도의 프로토콜 (es6)을 정의 후, 해당
프로토콜에 커스텀 파서를 붙여 해결
protocol.registerSchemesAsPrivileged([
{ scheme: 'es6', privileges: { standard: true,
secure: true, bypassCSP: true } }
]);
protocol.registerBufferProtocol('es6', (req, cb) => {
nfs.readFile(
npjoin(es6Path, req.url.replace('es6://', '')),
(e, b) => { cb({ mimeType: 'text/javascript',
data: b }) }
)
});
임의의 프로토콜 (es6) scheme 등록 (Electron V5/6)
임의의 버퍼 프로토콜 (es6) 의 동작등록 (Electron V5/6)
WebSocket Proxy
Server
Console server
Backend.AI
ES6 SDK
Console
App component
LitElement
Router
Summary
Redux
Runtime / session
Storage
Maintenance
Settings
Resources
Users
Pipeline
Experiments
Statistics
Pipeline
App component
Backend.AI
WebSocket
Proxy
(service)
Backend.AI
Node.js SDK
Backend.AI
Manager
Backend.AI
Manager
Proxy
Redis
웹 콘솔 모드
• Console-server와 결합
• aiohttp 기반의 python
서버
• 세션 기반의 로그인 제공
• Manager 프록시
• 클러스터의 노출을 막음
• 웹소켓 프록시 서버
• 컨테이너 안의 앱 실행
라우팅
허브
• 전체 클러스터 관리용
• Django + lit-element
• Console-server 기반의
Manager 프록시
• 여러 console-server들을
도메인별로 배포
• 클러스터의 Protected
multi-tenancy 지원
Python asyncio 기반의 코드
• 뻗지는 않는데 엄청 잘 뻗는다?
• 수많은 예외
고가용성
• 로드 밸런서 구현
• 매니저 레벨에서의 스케쥴러 및 큐잉
• 관리 모드를 예약한 노드의 큐잉 대상 제외
• Python 어플리케이션의 레플리케이션 모드 구현
• Fleet 운영시 Voting 알고리즘
화룡점정: 고가용성
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
기존
• 클라이언트 (PC쪽)에서 호출하는 REPL 부분 및 Language server를 Backend.AI SDK
기반으로 구현해서 원격 처리
• 컴파일이 필요한 경우 파일을 전송하고, TTY 를 포함한 I/O 포트를 후킹해서 그대로 터널링
화룡점정: 웹소켓 프록시 터널링 (1)
User PC
Jupyter
ipykernel
Backend.AI
Python SDK
Web
Browser
상호작용 방향
HTTP REST/GraphQL API +
Query mode execution API
Computing Node
Backend.AI
Agent
Container
Kernel Runner
User Program
Master Node
Backend.AI
Manager
server-sideclient-side
Backend.AI Jupyter Notebook 구현체 (2017)
앱 프록싱
문제
• 수많은 앱들마다 전부 외부 아답터를 지원해 줄 수가 없다!
• Jupyter랑 JupyterLab은 kernelspec을 맞춰서 아답터를 구현
• IntelliJ (PyCharm), VS Code 및 ATOM은 IDE용 플러그인을
SDK 기반으로 구현
• 근데 끝이 없다 : TensorBoard, TFX, AirFlow, DIGITS…
• 클라이언트를 사용자 쪽에 꼭 깔아야 함
대안
• 웹서비스 UI가 있는 앱들은 컨테이너 안에서 실행, 웹 포트를
사용자에게 제공
• Jupyter REPL을 지원하는 경우, KernelSpec을 맞춰서
REPL 구현체 제공
• 모두 다 아닌 경우 기존처럼 제공
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
화룡점정: 웹소켓 프록시 터널링 (2)
User PC
Web
Browser
Computing Node
Backend.AI
Agent
Container
Kernel Runner
User Program
Jupyter
TensorBoard
Master Node(s)
Web Console
wsproxy
Backend.AI JS SDK
client-side
Backend.AI
Manager
Backend.AI
Console
Server
server-sidemiddleware
화룡점정: 웹소켓 프록시 터널링 (3)
프록시 터널링 설계 (2018)
화룡점정: 웹소켓 프록시 터널링 (4)
API Client
Backend.AI Agent
Backend.AI
Manager
Computing Node
Container
Jupyter(2) 컨테이너 서비스로 첫
패킷 전송
(5) 컨테이너 서비스로 첫 패킷 전송
(1) 세션 생성
(1) 세션 생성
(4) 서비스 시작
(3) 컨테이너 서비스를 위한
스트림 프록시 오픈
(4') 시작됨!
(5') 서비스로 부터 첫 응답 발송
User Client
(e.g., browser)
$ backend.ai start –t mysess ...
$ backend.ai app mysess juypter –p 9000
세션 “mysess”에서 제공되는 "jupyter" 어플리케이션으로의
로컬 프록시를 http://127.0.0.1:9000 에서 제공
Service Proxy
:9000 :443
:6001
:8080
:31023
(6) 컨테이너 서비스로 가는 패킷
(6') 컨테이너 서비스에서 오는 패킷
APIRequest: HTTP/1.1 GET /stream/kernel/mysess/httpproxy?app=jupyter
payload: HTTP/1.1 GET /tree
HTTP/1.1 GET /tree
APIRequest: (other)
프록시 터널링 구현 상세 (2019)
화룡점정: 웹소켓 프록시 터널링 (5)
User PC
Web
Browser
Computing Node
Backend.AI
Agent
Container
Kernel Runner
User Program
Jupyter
TensorBoard
Master Node(s)
Web Console
wsproxy
Backend.AI JS SDK
client-side
User PC
Electron Shell
Chromium
Computing Node
Backend.AI
Agent
Container
Kernel Runner
User Program
Jupyter
TensorBoard
Master Node(s)
HTTP REST/GraphQL API +
WebSocket stream tunneling API
Backend.AI
Manager
Backend.AI
Console
Server
Backend.AI
Manager
Backend.AI
Console
Server
Web Console
Backend.AI JS SDK
wsproxy
server-sidemiddleware
Cloud
폐쇄망
앱 프록싱
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
앱 프록싱
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
…은 한 6개월이면 어떻게 될 것 같은데…
앱 프록싱
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
……
앱 프록싱
그렇게
4년이
흘렀습니다.
GPU 가속 지원 멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up
DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API
오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
PyCon Korea 2019
홍익인간
: 내 고생을 남도 하게 하지는 말자
홍익인간: GPU 가상화 (1)
Backend.AI
GPU
GPUGPU
GPU
GPUGPU
GPU
GPUGPU
GPU
GPUGPU
Backend.AI
GPU
GPU
GPU
GPU
GPU
GPU
GPUGPU
GPU 클러스터 구축 GPU 노드 공유
Backend.AI
GPU
GPUGPU
GPU
GPUGPU
클라우드 동적 확장
Cloud
➜ 이게 항상 골머리를 썩게 만듦.
문제
• GPU 할당이 너무 귀찮다
• GPU 종류가 너무 많다…
• 비싼 GPU를 샀는데 노는 경우가 많다.
GPU를 어떻게 좀 잘 쓸 수 없을까?
• ➜가상화를 해버리자!
홍익인간: GPU 가상화 (1)
Backend.AI
GPU
GPUGPU
GPU
GPUGPU
GPU
GPUGPU
GPU
GPUGPU
Backend.AI
GPU
GPU
GPU
GPU
GPU
GPU
GPUGPU
GPU 클러스터 구축 GPU 노드 공유
Backend.AI
GPU
GPUGPU
GPU
GPUGPU
클라우드 동적 확장
Cloud
with tf.device('/gpu:0'):
...
for d in ['/gpu:2', '/gpu:3']:
with tf.device(d):
...
홍익인간: GPU 가상화 (2)
CUDA 기반 라이브러리
CUDA 런타임
nvidia-docker
CUDA 드라이버
GPU
Backend.AI GPU 가상화 계층
GPU GPU
Container
Host
사용자 Application
NVML
nvidia-docker에서 제공하는 경량
가상화의 혜택을 그대로 유지
사용자 코드 변경 필요없음
모든 NGC 이미지 공식 지원 및
사용자 작성 CUDA 코드 실행 가능
컨테이너 단위 GPU 자원 제한 구현
홍익인간: GPU 가상화 (3)
Container 2
Backend.AI GPU Virtualizer
Container 1 Container 3 Container 4
nvidia-docker + CUDA Driver
PCIE/0 PCIE/1 PCIE/2 PCIE/3 PCIE/4 PCIE/5
PCIE/0PCIE/1PCIE/0 PCIE/0 PCIE/1 PCIE/0 PCIE/1 PCIE/2
/device:GPU:0 /device:GPU:0 /device:GPU:1 /device:GPU:0 /device:GPU:0 /device:GPU:1 /device:GPU:2/device:GPU:1
/device:GPU:0 /device:GPU:1 /device:GPU:2 /device:GPU:3 /device:GPU:4 /device:GPU:5
Host-side
view:
단일 GPU 가상화 구현 및 성능 테스트
어째서 멀쩡한 GPU를 쪼개서 돌렸을 때 통째로 쓰는 것보다 성능이 더 잘 나오는가?
• Bottleneck monitoring
• CPU-BUS-GPU I/O bottleneck 테스트
• GIL이 전체 시스템에 끼치는 영향 테스트
NUMA node 배치를 고려한 리소스 배치를 위한 python 프로그램 구현
• NUMA node 환경 데이터베이스 구축
• CPU / GPU 할당 시 병목 최소화
홍익인간: fGPU 구현 및 테스트
오늘 이야기한 내용들
권불10주: 이 바닥은 10주마다 바뀌더라.
우공이산 : 몰랐으니까 산을 옮길 시도를 시작할 수 있었다.
설상가상 : 문제를 해결하면 문제들이 따라온다.
화룡점정 : 눈 찍는게 의외로 중요한 일이다.
홍익인간 : 내 고생을 남도 하게 하지는 말자
앱 프록싱
GPU 가속 지원
멀티 GPU 지원
빌드 도구 / 공개 이미지 저장소
Nvidia-docker v1/v2 지원
PyTorch Follow-up DataParallel Pipeline I/O
Co-existing in-container
Python adapter
컨테이너 독립적 컨트롤러 구현
GraphQL 기반의 API 오프라인 인스톨러
대규모 배포 시스템
GUI
고가용성 구현
CUDA 드라이버 레이어 추상화
Programmable syscall 필터 구현
앱 관리 콘솔 통합 도구
통곡의 벽. 짠…
오늘 이야기한 내용들
Photo by © Jaepil Koh
권불10주: 이 바닥은 10주마다 바뀌더라.
우공이산 : 몰랐으니까 산을 옮길 시도를 시작할 수 있었다.
설상가상 : 문제를 해결하면 문제들이 따라온다.
화룡점정 : 눈 찍는게 의외로 중요한 일이다.
홍익인간 : 내 고생을 남도 하게 하지는 말자
과기정통부 / NIPA에서 주관하는 공개소프트웨어 컨트리뷰톤에 지원해주세요!
• Backend.AI 의 개선 및 문서화, 테스트를 함께 해보기!
• http://bit.ly/BACKENDAICBT2019
• 저희와 함께 깊게 파이썬 삽을 떠 보실 수 있습니다.
• 물론 얕게도 뜰 수 있습니다. 두려워 말고 컴온…
• 참가 신청: 8월 5일~25일
마지막으로
감사합니다.
재미있으셨나요?
inureyes inureyes
jeongkyu.shininureyes@gmail.com
끝!

More Related Content

What's hot

Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBMariaDB plc
 
Polyglot persistence @ netflix (CDE Meetup)
Polyglot persistence @ netflix (CDE Meetup) Polyglot persistence @ netflix (CDE Meetup)
Polyglot persistence @ netflix (CDE Meetup) Roopa Tangirala
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep InternalEXEM
 
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...Vietnam Open Infrastructure User Group
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA EDB
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsMariaDB plc
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX, Inc.
 
Physical Memory Management.pdf
Physical Memory Management.pdfPhysical Memory Management.pdf
Physical Memory Management.pdfAdrian Huang
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency CephShapeBlue
 
Zookeeper 활용 nifi clustering
Zookeeper 활용 nifi clusteringZookeeper 활용 nifi clustering
Zookeeper 활용 nifi clusteringNoahKIM36
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergWalaa Eldin Moustafa
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPThomas Graf
 
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...GetInData
 
[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영NAVER D2
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringAnne Nicolas
 
[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅NAVER D2
 
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能についてDeep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能についてNTT DATA Technology & Innovation
 
Redis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityRedis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityAbhishekDubey902839
 
Kafka Retry and DLQ
Kafka Retry and DLQKafka Retry and DLQ
Kafka Retry and DLQGeorge Teo
 
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsApache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsDataWorks Summit
 

What's hot (20)

Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
Polyglot persistence @ netflix (CDE Meetup)
Polyglot persistence @ netflix (CDE Meetup) Polyglot persistence @ netflix (CDE Meetup)
Polyglot persistence @ netflix (CDE Meetup)
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write Paths
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
Physical Memory Management.pdf
Physical Memory Management.pdfPhysical Memory Management.pdf
Physical Memory Management.pdf
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency Ceph
 
Zookeeper 활용 nifi clustering
Zookeeper 활용 nifi clusteringZookeeper 활용 nifi clustering
Zookeeper 활용 nifi clustering
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and Iceberg
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
 
[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영[215]네이버콘텐츠통계서비스소개 김기영
[215]네이버콘텐츠통계서비스소개 김기영
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 
[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅
 
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能についてDeep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
 
Redis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityRedis and its Scaling and Obersvability
Redis and its Scaling and Obersvability
 
Kafka Retry and DLQ
Kafka Retry and DLQKafka Retry and DLQ
Kafka Retry and DLQ
 
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsApache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
 

Similar to 머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발

SOSCON 2017 - Backend.AI
SOSCON 2017 - Backend.AISOSCON 2017 - Backend.AI
SOSCON 2017 - Backend.AIJoongi Kim
 
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기Sumin Byeon
 
Machine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AIMachine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AIJeongkyu Shin
 
초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드 초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드 YoungSu Son
 
JMI Techtalk : Backend.AI
JMI Techtalk : Backend.AIJMI Techtalk : Backend.AI
JMI Techtalk : Backend.AILablup Inc.
 
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기Chanwoong Kim
 
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...hoondong kim
 
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크Backend.AI: 오픈소스 머신러닝 인프라 프레임워크
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크Jeongkyu Shin
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축Ji-Woong Choi
 
Lablupconf session8 "Paving the road to AI-powered world"
Lablupconf session8 "Paving the road to AI-powered world"Lablupconf session8 "Paving the road to AI-powered world"
Lablupconf session8 "Paving the road to AI-powered world"Lablup Inc.
 
2020년 10월 24일 개발자 이야기
2020년 10월 24일 개발자 이야기2020년 10월 24일 개발자 이야기
2020년 10월 24일 개발자 이야기Jay Park
 
NetApp AI Control Plane
NetApp AI Control PlaneNetApp AI Control Plane
NetApp AI Control PlaneSeungYong Baek
 
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018devCAT Studio, NEXON
 
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안Jeongsang Baek
 
Open infradays 2019_msa_k8s
Open infradays 2019_msa_k8sOpen infradays 2019_msa_k8s
Open infradays 2019_msa_k8sHyoungjun Kim
 
Meetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsMeetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsminseok kim
 
Oracle linux8 solaris_new_features-suk kim
Oracle linux8 solaris_new_features-suk kimOracle linux8 solaris_new_features-suk kim
Oracle linux8 solaris_new_features-suk kimsuk kim
 
AngularJS In Production
AngularJS In ProductionAngularJS In Production
AngularJS In ProductionMooYeol Lee
 
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기Chris Ohk
 

Similar to 머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발 (20)

SOSCON 2017 - Backend.AI
SOSCON 2017 - Backend.AISOSCON 2017 - Backend.AI
SOSCON 2017 - Backend.AI
 
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
 
Machine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AIMachine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AI
 
초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드 초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드
 
JMI Techtalk : Backend.AI
JMI Techtalk : Backend.AIJMI Techtalk : Backend.AI
JMI Techtalk : Backend.AI
 
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
 
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
 
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크Backend.AI: 오픈소스 머신러닝 인프라 프레임워크
Backend.AI: 오픈소스 머신러닝 인프라 프레임워크
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
 
Lablupconf session8 "Paving the road to AI-powered world"
Lablupconf session8 "Paving the road to AI-powered world"Lablupconf session8 "Paving the road to AI-powered world"
Lablupconf session8 "Paving the road to AI-powered world"
 
2020년 10월 24일 개발자 이야기
2020년 10월 24일 개발자 이야기2020년 10월 24일 개발자 이야기
2020년 10월 24일 개발자 이야기
 
NetApp AI Control Plane
NetApp AI Control PlaneNetApp AI Control Plane
NetApp AI Control Plane
 
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
 
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
 
kt-cloud
kt-cloudkt-cloud
kt-cloud
 
Open infradays 2019_msa_k8s
Open infradays 2019_msa_k8sOpen infradays 2019_msa_k8s
Open infradays 2019_msa_k8s
 
Meetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsMeetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vs
 
Oracle linux8 solaris_new_features-suk kim
Oracle linux8 solaris_new_features-suk kimOracle linux8 solaris_new_features-suk kim
Oracle linux8 solaris_new_features-suk kim
 
AngularJS In Production
AngularJS In ProductionAngularJS In Production
AngularJS In Production
 
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
 

More from Jeongkyu Shin

Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Jeongkyu Shin
 
Machine Learning in Google I/O 19
Machine Learning in Google I/O 19Machine Learning in Google I/O 19
Machine Learning in Google I/O 19Jeongkyu Shin
 
TensorFlow 2: New Era of Developing Deep Learning Models
TensorFlow 2: New Era of Developing Deep Learning ModelsTensorFlow 2: New Era of Developing Deep Learning Models
TensorFlow 2: New Era of Developing Deep Learning ModelsJeongkyu Shin
 
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기Jeongkyu Shin
 
오픈소스 라이선스를 둘러싼 소송들
오픈소스 라이선스를 둘러싼 소송들오픈소스 라이선스를 둘러싼 소송들
오픈소스 라이선스를 둘러싼 소송들Jeongkyu Shin
 
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개Jeongkyu Shin
 
회색지대: 이상과 현실 - 오픈소스 저작권
회색지대: 이상과 현실 - 오픈소스 저작권회색지대: 이상과 현실 - 오픈소스 저작권
회색지대: 이상과 현실 - 오픈소스 저작권Jeongkyu Shin
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubJeongkyu Shin
 
Google Polymer in Action
Google Polymer in ActionGoogle Polymer in Action
Google Polymer in ActionJeongkyu Shin
 
The Flow of TensorFlow
The Flow of TensorFlowThe Flow of TensorFlow
The Flow of TensorFlowJeongkyu Shin
 
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...Jeongkyu Shin
 
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)Jeongkyu Shin
 
Deep-learning based Language Understanding and Emotion extractions
Deep-learning based Language Understanding and Emotion extractionsDeep-learning based Language Understanding and Emotion extractions
Deep-learning based Language Understanding and Emotion extractionsJeongkyu Shin
 
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)Jeongkyu Shin
 
OSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardwareOSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardwareJeongkyu Shin
 
OSS SW Basics Lecture 12: Open source in research fields
OSS SW Basics Lecture 12: Open source in research fieldsOSS SW Basics Lecture 12: Open source in research fields
OSS SW Basics Lecture 12: Open source in research fieldsJeongkyu Shin
 
OSS SW Basics Lecture 10: Setting up term project
OSS SW Basics Lecture 10: Setting up term projectOSS SW Basics Lecture 10: Setting up term project
OSS SW Basics Lecture 10: Setting up term projectJeongkyu Shin
 
OSS SW Basics Lecture 09: Communications in open-source developments
OSS SW Basics Lecture 09: Communications in open-source developmentsOSS SW Basics Lecture 09: Communications in open-source developments
OSS SW Basics Lecture 09: Communications in open-source developmentsJeongkyu Shin
 
OSS SW Basics Lecture 08: Software Configuration Management (2)
OSS SW Basics Lecture 08: Software Configuration Management (2)OSS SW Basics Lecture 08: Software Configuration Management (2)
OSS SW Basics Lecture 08: Software Configuration Management (2)Jeongkyu Shin
 
OSS SW Basics Lecture 06: Software Configuration Management
OSS SW Basics Lecture 06: Software Configuration ManagementOSS SW Basics Lecture 06: Software Configuration Management
OSS SW Basics Lecture 06: Software Configuration ManagementJeongkyu Shin
 

More from Jeongkyu Shin (20)

Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0
 
Machine Learning in Google I/O 19
Machine Learning in Google I/O 19Machine Learning in Google I/O 19
Machine Learning in Google I/O 19
 
TensorFlow 2: New Era of Developing Deep Learning Models
TensorFlow 2: New Era of Developing Deep Learning ModelsTensorFlow 2: New Era of Developing Deep Learning Models
TensorFlow 2: New Era of Developing Deep Learning Models
 
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
 
오픈소스 라이선스를 둘러싼 소송들
오픈소스 라이선스를 둘러싼 소송들오픈소스 라이선스를 둘러싼 소송들
오픈소스 라이선스를 둘러싼 소송들
 
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개
모바일 개발자를 위한 ML Kit: Machine Learning SDK 소개
 
회색지대: 이상과 현실 - 오픈소스 저작권
회색지대: 이상과 현실 - 오픈소스 저작권회색지대: 이상과 현실 - 오픈소스 저작권
회색지대: 이상과 현실 - 오픈소스 저작권
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
 
Google Polymer in Action
Google Polymer in ActionGoogle Polymer in Action
Google Polymer in Action
 
The Flow of TensorFlow
The Flow of TensorFlowThe Flow of TensorFlow
The Flow of TensorFlow
 
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...
Let Android dream electric sheep: Making emotion model for chat-bot with Pyth...
 
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)
구글의 머신러닝 비전: TPU부터 모바일까지 (Google I/O Extended Seoul 2017)
 
Deep-learning based Language Understanding and Emotion extractions
Deep-learning based Language Understanding and Emotion extractionsDeep-learning based Language Understanding and Emotion extractions
Deep-learning based Language Understanding and Emotion extractions
 
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)
기술 관심 갖기: 스타트업 기술 101 (Interested in Tech?: Startup Technology 101)
 
OSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardwareOSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardware
 
OSS SW Basics Lecture 12: Open source in research fields
OSS SW Basics Lecture 12: Open source in research fieldsOSS SW Basics Lecture 12: Open source in research fields
OSS SW Basics Lecture 12: Open source in research fields
 
OSS SW Basics Lecture 10: Setting up term project
OSS SW Basics Lecture 10: Setting up term projectOSS SW Basics Lecture 10: Setting up term project
OSS SW Basics Lecture 10: Setting up term project
 
OSS SW Basics Lecture 09: Communications in open-source developments
OSS SW Basics Lecture 09: Communications in open-source developmentsOSS SW Basics Lecture 09: Communications in open-source developments
OSS SW Basics Lecture 09: Communications in open-source developments
 
OSS SW Basics Lecture 08: Software Configuration Management (2)
OSS SW Basics Lecture 08: Software Configuration Management (2)OSS SW Basics Lecture 08: Software Configuration Management (2)
OSS SW Basics Lecture 08: Software Configuration Management (2)
 
OSS SW Basics Lecture 06: Software Configuration Management
OSS SW Basics Lecture 06: Software Configuration ManagementOSS SW Basics Lecture 06: Software Configuration Management
OSS SW Basics Lecture 06: Software Configuration Management
 

머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발

  • 1. PyCon Korea 2019 머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발 신정규 +김준기, 박종현
  • 2. 오늘의 발표 주제: 2015년의 발표 연장 + 그 동안의 소회 © Jeongkyu Shin
  • 5. 현대 과학 연구와 개선 • 기술은 21세기, 시스템은 20세기, 학계는 19세기 • 인간이 관여하는 분야의 발전 속도가 그렇지 않은 분야의 발전 속도를 따라가지 못하는 경향 • 학계와 업계, 사회의 간극 PyCon KR 2015 발표 요약
  • 6. 연구말싸미 듕귁에 달아 코드로 서르 사맛띠 아니할쌔 이런 젼차로 어린 학도가 니르고져 홀빼이셔도 마참내 제 뜨들 시러펴디 못할 노미 하니라. 내 이랄 위하야 어엿비 너겨 새로 연구 코드 나누미와 과학 공학 노리터를 맹가노니 사람마다 희여 수비니겨 날로 쑤메 뼈한크이 하고져 할따라미니라. • 재현 가능한 데이터 연구 플랫폼 • 논문용 코드로부터 실제 서비스까지 확장을 지원하는 클라우드 샌드박스 서비스 현대 과학 연구와 개선 PyCon KR 2015 발표 요약
  • 7. 천릿길도 한 걸음부터. ..설마 진짜 천 리 인건 아니겠지 현대 과학 연구와 개선 PyCon KR 2015 발표 요약
  • 8. 컨테이너 기반의 고밀도 분산처리 플랫폼 및 사용자 편의 기능 구현 2015년 발표 후… 은 한 6개월이면 어떻게 될 것 같은데… (프로토타입도 만들었으니) Photo by © Jeongkyu Shin
  • 9. 만화나 영화 보면 보통 프로토타입이 제일 좋던데…
  • 10. Vector Graphics by Vecteezy.com
  • 11. 4 Years Later 4 년 후
  • 13. 이름이 생겼습니다 • Sorna (2015~) ➜ Backend.AI (2017~) • 뒤에선 Backend.AI 라고 부를 거에요. 오픈소스가 되었습니다. • 2016년 11월 (Sorna) 오픈소스 1.0 • 여섯 번 메이저 버전업이 있었고, • 1.1, 1.2, 1.3, 1.4, 18.12, 19.03 • 상도 몇 개 받았죠! LTS도 나왔습니다. • Backend.AI 19.03 (첫 LTS) 들어가기 전에 몇가지 짜 잔 …발표 끝날 때 쯤이면 ‘짜잔’이 ‘짠’하게 보이실 겁니다.
  • 14. PyCon Korea 2019 권불10주 : 이 바닥은 10주마다 바뀌더라.
  • 15. 뭐든지 빠른 세상! 24개월: Nvidia 하드웨어 generation 주기 18개월: Python의 안정 버전 주기 6개월: Docker Engine의 안정 버전 주기 6주: TensorFlow의 안정(?) 버전 주기 권불10주: 세상의 속도
  • 17. Bear
  • 18. Metal Bear Photo by © Bill Ohrmann – Metal Bear Sculpture
  • 19. Baremetal Photo by © Jeongkyu Shin
  • 20. Cluster Photo by © Facebook Inc.
  • 24. Baremetal VM VM • 가상 머신 (Virtual Machine) • 하드웨어 레벨의 가상화 솔루션 • 독립된 운영체제 및 환경 • 베어메탈의 운영체제에 영향 받지 않음 • 가상화된 하드웨어를 VM 내에 제공 • 장단점 • 완벽하게 격리된 환경 / 여러 OS 실행 • 성능 저하
  • 25. Cloud
  • 27. Baremetal VM VM OS Container layer Containers Containers OS Container layer
  • 28. Baremetal VM VM OS Container layer Containers Containers OS Container layer Baremetal OS Container layer Containers Shared Dedicated
  • 29. Baremetal VM VM OS Container layer Containers Containers OS Container layer • 컨테이너 • 호스트 운영체제 커널을 공유 • 커널을 제외한 부분들을 격리 • 구현 • Container layer: LXC / runC / Jail… • Namespace 기반의 가상화 • 보안 정책 및 컨트롤그룹 앨리어싱 • seccomp / cgroup
  • 30. Cloud
  • 31. Cloud 클라우드 매니저 • 클러스터에 VM 또는 스토리지를 생성, 삭제, 배치, 관리하는 역할 담당 • IaaS (Infrastructure as a Service) 구축을 위한 소프트웨어 컨테이너 관리 솔루션 (컨테이너 오케스트레이터) • 컨테이너를 생성, 삭제, 배치, 관리하는 역할 담당
  • 32. Rootless 컨테이너 및 특화 컨테이너 솔루션의 등장 • Docker ➜ Podman, LXD, Singularity 컨테이너 관리 솔루션의 발전: Borg ➜ Swarm, Kubernetes, Mesos, Backend.AI 권불10주: 컨테이너 기술의 진보 이름 개발사 연도 특징 LXC IBM 2008 리눅스 컨테이너 실증 Docker Docker 2013 컨테이너 대중화 LXD Canonical 2015 데스크탑 어플리케이션 배포용도 Singularity Sylabs 2016 과학 연산 특화 Podman Containers Org. 2017 유저 권한으로 실행됨
  • 33. 마이크로서비스 • 어플리케이션을 작은 단위로 쪼갬 • 서비스 모듈 + 통신 • 빠른 버전업 및 지속적 통합 기반 언어의 변화 • Python + Node.js + GO + C++ + PHP + JAVA… 프로토콜의 확장 • REST ➜ ZeroMQ, GraphQL, Callosum… 권불10주: microservice의 대두 Chart by © Martin Fowler. https://martinfowler.com/bliki/MicroservicePremium.html
  • 34. Asynchronous Programming Asynchronous I/O의 도래 • 마이크로서비스: 지연 시간 예측 난도 • 많은 마이크로서비스들이 비동기로 동작 권불10주: 비동기의 시대 언어 구현체 / 문법 버전 Python asyncio 3.5 Node.js Promise / Async 7 JavaScript Promise ECMA6 GO goroutine Java @Async JDK 1.8 C++ future / promise C++11 프로그래밍 언어의 비동기 I/O 지원. 리스트에 없는 언어의 경우 비동기 지원 라이브러리들이 있음
  • 35. PyCon Korea 2019 우공이산 : 몰랐으니까 산을 옮길 시도를 시작할 수 있었다.
  • 36. 필요한 것 • 샌드박스 기반의 코드 실행 서비스 • 클라우드 기반 유저 인터페이스 • 소유자 / 그룹 / 커뮤니티 / 노트 • 공유시스템 • 서비스를 사용하기 위한 웹/앱 우공이산: 기본 설계하기 기본 테크스택 (2015 AUG. PyCon KR)
  • 37. 우공이산: 기본 설계하기 Backend.AI Manager Backend.AI Agent Scaling Group Scaling Group Backend.AI Agent Backend.AI Agent Backend.AI Agent Backend.AI Agent Backend.AI Client Kernel Kernel Kernel Kernel Kernel Kernel Kernel 네트워크 스토리지 세션 DB 사용자 DB 설정 서버 Sorna (Backend.AI) 설계 (2016)
  • 38. 우공이산: 기본 설계하기 >_ Backend.AI Client SDK for Python HTTPS WebSocket / REST / GraphQL ZeroMQ etcdRedisPostgreSQL (DB별 전용 프로토콜) Backend.AI Client SDK for Javascript Tensor Flow Backend.AI Jail R Backend.AI Jail Docker 입출력 데이터 Cloud Storage Backend.AI Agent Backend.AI Manager https://api.backend.ai § 실시간 터미널 연결 § 컨테이너 내부 서비스 연결 § 관리자용 모니터링 기능 연동 § 멀티미디어 출력 처리 § 사용자 세션 인증 § 실시간 사용량 추적 § 자동 rolling upgrade § 시스템콜 기반 샌드박싱 § CPU/GPU Core, Memory, Storage를 포함한 컨테이너별 자원 제약 강제 § 사용자별 스토리지 관리 § 권한 기반 스토리지 폴더 초대 및 공유 § 예제 데이터 집합 제공 § 요청 라우팅 § I/O 릴레이 및 프록시 § Agent 자동 스케일링 § 하이브리드 클라우드 지원 Backend.AI component roles (2016)
  • 40. 목표 (2015년) • 머신러닝: Caffe와 Theano를 잘 돌려주자! • 속도가 필요한 연구들: Julia도 돌리자! • MATLAB 사용자: Octave를 돌리자! • ABM 기반의 뉴럴넷도 하니까: Repast도 돌리자! • (생물 뉴런 모델링을 위해) NEURON 도 돌려주자! 이정도면 다가올 딥러닝 시대에 대한 준비는 완벽! 우공이산: TensorFlow의 등장 일거리 산 ➜ 완!벽!합니다!
  • 41. TensorFlow (2015.12~): 머신러닝 편의성 개선에 큰 역할 • GPU 가속 지원 발표 • 초기 버전에서는 CPU 지원 • 버전업에 따라 1GPU ➜ 멀티 GPU 지원 ➜ 멀티 노드 지원이 계속 추가… • GPU 지원을 추가하자! • Nvidia GPU 를 컨테이너에 붙이자! • nvidia-docker 우공이산: TensorFlow의 등장 (1) GPU 가속 지원 멀티 GPU 지원 일거리 산 ➜
  • 42. Speed is everything! • 하위 호환성은 안녕 – 1.3 / 1.4, 1.9 / 1.10, 1.12 / 1.13,4… • 빌드 체인도 안녕 • 빌드 체인도 매번 바뀌고 • 빌드 방법도 매번 바뀌고 • 빌드 도구도 매번 바뀐다… • Protobuf, bazel … 우공이산: TensorFlow의 등장 (2) GPU 가속 지원 멀티 GPU 지원 일거리 산 ➜ 빌드 도구 / 공개 이미지 저장소
  • 43. nvidia-docker • (당연하게도) 하드웨어 의존성이 큼 • 버전업이 되면서 구현 방법 자체가 바뀜 • V2: runC 기반의 앨리어스 덩어리 • V1 / V2 : 실질적으로 다른 구현체 • CUDA 10은 V2를 요구함 • CUDA-X는 CUDA 10.1을 요구함 • 다중 구현 필요 • 그런데 • Docker 19.03부터 v2와 유사하게 자체 지원 • Docker 하위호환때문에 버릴 수도 없음 우공이산: 왜 슬픈 예감은… GPU 가속 지원 멀티 GPU 지원 일거리 산 ➜ 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원
  • 44. PyTorch (2017.1) • Torch + Python 프론트엔드 • 역시 GPU를 지원함 • 멀티 노드 및 멀티 GPU 지원은 이후에 추가 간단하지 않음 • CPU-GPU 메모리 복사: 기존 Python 패키지와의 광범위한 호환성 (이 문제가 됨) • 버전별 호환성 문제 • PyTorch도 버전 별로 사실상 다른 프레임웍임… 우공이산: PyTorch의 등장 GPU 가속 지원 멀티 GPU 지원 일거리 산 ➜ 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up Photo from © bgr.com Steve Jobs (2010)
  • 45. PyCon Korea 2019 설상가상 : 문제를 해결하면 문제들이 따라온다.
  • 46. Parallelism • 데이터 병렬화Data parallelism • 데이터 파이프라인 및 forward/backward pass 병렬화 • MPI 의 parallelism과 유사 • 모델 병렬화Model parallelism • 모델을 잘라서 처리함 • 단일 GPU로 커버하기 힘든 경우 사용 설상가상: 병렬화 지원 (1) GPU 가속 지원 멀티 GPU 지원 일거리 산 ➜ 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up
  • 47. 데이터 병렬화 지원 • 데이터 파이프라인 구성 • 싱글 노드 – 싱글 GPU • 싱글 노드 – 멀티 GPU • tf.distribute.MirroredStrategy, torch.nn.DataParallel • 멀티 노드 – 싱글 GPU (X) • 멀티 노드 – 멀티 GPU • tf.distribute.CollectiveAllReduceStrategy 설상가상: 병렬화 지원 (2) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O
  • 48. 연구분야: 세상의 속도가 다르게 흐르는 곳 • 수치해석 라이브러리들 • Python 2 기반 / 2to3로 3 지원 • Python 3의 장점을 희생함 • NLP: 주요 라이브러리들이 전부 Python 2 기반 • 포트란 기반 라이브러리들도 잊지 말라고! • TensorFlow Extended: Python 2 의존성 • 6월에 드디어 해결됨! 설상가상: Python 2/3 지원 (1) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O 파이썬 래퍼가 처리했으니 안심하라구! (진짜?) Photo from © Debra Bardowicks
  • 49. Backend.AI 구현체 • Python 3.4로 시작 ➜ Python 3.6 요구 • 컨테이너별로 사용하는 Python이 전부 상이함 • Nvidia GPU Cloud 이미지는 Python 3.5 • 제어: 컨테이너 내부와의 통신 필요 • 자원 측정 • 앱 실행 • 어떻게 컨테이너 내부의 다양한 환경을 그대로 놓아두고 내외부 인터페이스를 만들어야 하나? 설상가상: Python 2/3 지원 (2) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter
  • 50. ZeroMQ • 거의 모든 언어로 구현체가 존재하는 메세지 전달 도구 Unified message queue with ZeroMQ (2016~2017) • 컨테이너 드라이버용으로 컨테이너 내부 환경에 맞는 구현체를 각자 구현하자 문제점 • ZeroMQ를 사용하는 부분은 해당 언어로 구현해야 함 • 지원 언어가 15가지를 넘어가게 되면서 바벨탑 쇼크가 옴 설상가상: 컨테이너 컨트롤러 구현 (1) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 일거리 산 ➜
  • 51. pkg load zeromq ... function clear (varargin) ... endfunction function result = execute_code(_sorna_insock, _sorna_outsock, _sorna_code) ... try _sorna_stdout = evalc (_sorna_code, '_sorna_stderr = lasterror.message;'); if strfind (_sorna_code, 'plot') || strfind (_sorna_code, 'figure') gobjs = findall (0, 'type', 'figure'); for i = 1:length(gobjs) tmpf = tmpname (); print (gobjs(i), tmpf); fstr = fileread (tmpf); ... _sorna_media{i} = {'image/svg+xml', fstr}; unlink (tmpf); endfor endif catch end_try_catch ... Endfunction ... _sorna_insock = zmq_socket (ZMQ_PULL); _sorna_outsock = zmq_socket (ZMQ_PUSH); zmq_bind (_sorna_insock, 'tcp://*:2000'); zmq_bind (_sorna_outsock, 'tcp://*:2001'); Octave implementation (2017)
  • 52. {-# LANGUAGE DeriveGeneric #-} ... data ExecResult = ExecResult { ... } deriving (Generic) instance ToJSON ExecResult instance FromJSON ExecResult data ExceptionInfo = ExceptionInfo { ...} main :: IO () main = do let runZMQ $ do skt <- socket Rep bind skt port printInZMQ "serving at port 2001..." loop skt putStrLn "exit." where port = "tcp://*:2001" loop skt = do code_id <- receive skt code <- receive skt let (out, err, exceptions) = executeCode (show code_id) (U.toString code) let result = lazyToStrict . encode $ ExecResult out err exceptions send skt [] result loop skt ... Haskell implementation (2016)
  • 53. Photo by © Junghoon Lee
  • 54. Kernel Runner: superposed Python controller (2018) • 컨테이너 환경 언어에 상관 없도록 단일 인터페이스를 이용한 구현 • 컨테이너의 운영체제만 영향을 줌 • Volume mount로 Python 컨트롤러 구현체를 /opt 하위에 탑재 • https://github.com/lablup/backend.ai-kernel-runner 장단점 • 언어별 별도 구현 및 중복 구현이 없어짐 • REPL 지원 ➜ jupyter_client를 우리의 백엔드로 사용 • 컨테이너 내부 언어/프레임워크와 kernel runner 실행환경의 분리가 가능해짐 • kernel runner는 asyncio로 짰지만 사용자는 Python 2 코드도 돌릴 수 있음 설상가상: 컨테이너 컨트롤러 구현 (2) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현
  • 55. from jupyter_client import KernelManager from jupyter_client.kernelspec import KernelSpecManager ... kernelspec_mgr = KernelSpecManager() kernelspec_mgr.ensure_native_kernel = False kspecs = kernelspec_mgr.get_all_specs() for kname in kspecs: if jupyter_kspec_name in kname: kernel_mgr = KernelManager(kernel_name=kname) kernel_mgr.start_kernel() ... kernel_client = kernel_mgr.client() kernel_client.start_channels(shell=True, iopub=True, stdin=True, hb=True) kernel_client.wait_for_ready(timeout=10) ... async def query(code_text) -> int: msg_id = kernel_client.execute(code_text, ...) ... poller = zmq.asyncio.Poller() iopub_socket = kernel_client.iopub_channel.socket stdin_socket = kernel_client.stdin_channel.socket poller.register(iopub_socket, zmq.POLLIN) poller.register(stdin_socket, zmq.POLLIN) while True: events = dict(await poller.poll(timeout_ms)) if iopub_socket in events: msg = kernel_client.iopub_channel.get_msg(timeout=0) await output_hook(msg) ... async def query(code_text) -> int: ensure_inproc_runner() await input_queue.async_q.put(code_text) while True: try: msg = await output_queue.async_q.get() except asyncio.CancelledError: break output_queue.async_q.task_done() if msg is sentinel: break outsock.send_multipart(msg) ... class PythonInprocRunner(threading.Thread): def run(self): sys.stdout = ConsoleOutput(...) sys.stderr = ConsoleOutput(...) while True: code_text = self.input_queue.get() self.input_queue.task_done() try: code_obj = code.compile_command( code_text, symbol='exec') except ...: ... 모든 언어마다 개별 구현 (컴파일 언어는 대체로 힘듬) Jupyter 지원 모든 언어 사용 가능
  • 56. Kernel Runner: superposed Python controller • 배포의 귀찮음: Kernel Runner 이미지가 항상 필요함 • pip 기반의 인스톨 파이프라인에서 벗어난 설치 과정 Embedded Kernel Runner (2019) • 아예 파일 시스템을 에이전트에 배포하고 중복마운트하면? • https://github.com/lablup/backend.ai-krunner-ubuntu • https://github.com/lablup/backend.ai-krunner-alpine • https://github.com/lablup/backend.ai-krunner-centos 설상가상: 컨테이너 컨트롤러 구현 (3) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현
  • 57. #! /bin/sh rm -rf /root/volume/* tar xJf /root/archive.tar.xz -C /root/volume/ echo "$KRUNNER_VERSION" > /root/volume/VERSION https://github.com/lablup/backend.ai-kernels https://github.com/lablup/backend.ai-agent/tree/master/src/ai/backend/runner https://github.com/lablup/backend.ai-krunner-ubuntu/blob/master/src krunner-extractor.shkrunner-python.ubuntu16.04.dockerfile FROM ubuntu:16.04 ARG PREFIX=/opt/backend.ai ENV PATH=${PREFIX}/bin:$PATH ENV LANG=C.UTF-8 RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates netbase && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.8 RUN mkdir -p ${PREFIX}; echo "${PREFIX}/lib" > /etc/ld.so.conf.d/backendai.conf && ldconfig RUN set -ex && savedAptMark="$(apt-mark showmanual)" && apt-get update && apt-get install -y --no-install-recommends dpkg-dev gcc libbz2-dev libc6-dev
  • 58. PyCon Korea 2019 화룡점정 : 눈 찍는게 의외로 중요한 일이다.
  • 59. GraphQL • API를 위한 쿼리 언어 / 페이스북 개발 • JSON 기반: 구현을 위해 별도의 모듈등이 필요하지 않음. • RESTful API 대체에 용이 화룡점정: 마이크로서비스 API GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API
  • 60. 화룡점정: 언어별 SDK 구현 type ComputeSession implements Item { id: ID sess_id: String role: String image: String registry: String domain_name: String group_id: UUID user_uuid: UUID access_key: String status: String status_info: String created_at: DateTime terminated_at: DateTime agent: String container_id: String service_ports: JSONString occupied_slots: JSONString occupied_shares: JSONString num_queries: BigInt live_stat: JSONString last_stat: JSONString group_name: String lang: String mem_slot: Int cpu_slot: Float gpu_slot: Float tpu_slot: Float cpu_used: BigInt cpu_using: Float mem_max_bytes: BigInt mem_cur_bytes: BigInt net_rx_bytes: BigInt net_tx_bytes: BigInt io_read_bytes: BigInt io_write_bytes: BigInt io_max_scratch_size: BigInt io_cur_scratch_size: BigInt tag: String workers(status: String): [ComputeWorker] } query: "query($ak:String, $status:String) { compute_sessions(access_key:$ak, status:$status) { sess_id lang created_at terminated_at status occupied_slots }}" variables: {status: "RUNNING", ak: null} {"compute_sessions": [{ "sess_id": "oKVQNwG4-jsSDK", "lang": "index.docker.io/lablup/ngc-tensorflow:19.02-py3", "created_at": "2019-08-16T07:33:19.232425+00:00", "terminated_at": null, "status": "RUNNING", "occupied_slots": "{"cpu": "4", "mem": "12884901888", "cuda.shares": "1"}” }]} 요청 응답
  • 61. Python 기반의 서버 어플리케이션 배포 • 오프라인일 때는? 고려할 점 • python 런타임 • 네트워크 억세스를 사용하지 않는 pip • 설치 환경에 따라 달라지는 설정 변경 • 대규모 설치 요구 환경에서의 자동화 화룡점정: 오프라인 환경 (1) Photo taken from Error message of Google Chrome
  • 62. Installer Builder Builder 만들기 • Docker 이미지 빌더 • Python 번들 • Python 필요 패키지 ➜ 단일 wheel (wheelset) 빌더 • Binary wheel 이 든 이미지 패키저 패키징 • 각 프로그램별 패키저 • manager, agent, console, console-server, wsproxy, client, ML runtimes… • 모든걸 담은 단일 바이너리 설치 파일 화룡점정: 오프라인 환경 (2) python utils docker cli bin files context Packager agentbootstrap console client hub manager halfstack wsproxy Wheelsets (CentOS) Wheelsets (Ubuntu)
  • 63. Ansible • 설치 및 배포과정 자동화 도구 • 설치 노드가 두 자릿수를 넘어가는 경우에 매우 유용 • Playbook 작성 ➜ 실행의 순서 적용 • 다양한 조건에 해당하는 yml 파일 생성 • 해당 yml 에 적용한 변수를 playbook으로 작성 화룡점정: Ansible 기반 배포 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템
  • 64. 화룡점정: Ansible 기반 배포 ansible-playbook -i custom_host install_backend_ai_rolebased.yml -K -e "branch_name=19.03 manager_service_ip=127.0.0.1" 3.배포 1.설치 pip install ansible all: hosts: host1: ansible_host: 192.168.0.10 vars: project_name: ‘test_distribution’ ansible_user: test_dev ansible_connection: ssh branch_name: master db_port: 5432 redis_port: 6379 etcd_port: 2379 … db_data_location: ‘{{ target_directory_path }}/data/postgres’ etcd_data_location: '{{target_directory_path }}/data/etcd’ kernels_to_install: - "lablup/python:3.6-ubuntu18.04" - "lablup/python-tensorflow:1.14-py36-cuda9" … children: … 2.설정
  • 65. RestructuredText 기반의 문서화 • 코드 주석 기반 + 문서 고유 설정 • Readthedocs를 통한 배포 파이프라인 구축 폴리글랏 기반의 프로젝트 문서화 • ReST 플러그인들이 다양하게 존재하지만 잘 돌아가는게 없음 • 예) JSDoc support by Mozilla – 2017년 마지막 업데이트 • 결론: • Python: ReST + Sphinx, JavaScript: JSDoc 화룡점정: 문서화 https://docs.backend.ai
  • 66. RestructuredText 기반의 문서화 • 코드 주석 기반 + 문서 고유 설정 • Readthedocs를 통한 배포 파이프라인 구축 폴리글랏 기반의 프로젝트 문서화 • ReST 플러그인들이 다양하게 존재하지만 잘 돌아가는게 없음 • 예) JSDoc support by Mozilla – 2017년 마지막 업데이트 • 결론: • Python: ReST + Sphinx, JavaScript: JSDoc 화룡점정: 문서화 JSDoc 기반의 문서화
  • 68. GUI: 빼먹은 조각 • 다들 연구하다 온 사람들이라 필요성을 몰랐음 • 4년 동안 몰랐음… 아는 만큼만 보인다 • 박사들이 모여 만들다 보니: 아니 GUI가 왜 필요해? • SDK+API 를 완전하게 지원합니다! • 설치 방법도 다양하게 지원합니다!! • 그런데 GUI가 필요한가요? ➜ “그래서 있어요 없어요?” 화룡점정: GUI (2) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI
  • 69. GUI 만들기 (2019) • CLI가 할 수 있는 모든 작업을 직관적으로 제공 필요한 것 • 앱 • 데스크탑에서 편리하게 사용할 수 있음 • 별도의 파이썬 클라이언트를 설치하지 않고 사용 가능 • 웹 • 앱을 설치하거나 관리하기 귀찮은 경우 • 브라우저만 있으면 사용할 수 있도록 화룡점정: GUI (3) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI
  • 70. 앱 • Webcomponent 기술 기반 • Node.js + Electron 웹 • 앱의 코드를 거의 그대로 쓸 수 있게 해 보자! • 문제: 웹은 뭘로 접속해올 지 알 수가 없다… 화룡점정: GUI (4) GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI
  • 71. Backend.AI ES6 SDK Console App component LitElement Router Summary Redux Runtime / session Storage Maintenance Settings Resources Users Pipeline Experiments Statistics Pipeline App component 코어 • Webcomponent 기술 기반 • 언어: JavaScript (ES6) ➜ TypeScript • Polymer + lit-element • State 관리: Redux • 빌드체인: PolymerCLI ➜ rollup.js + Karma • Polyfill: webcomponentsjs ➜ polyfill.app 메인 앱 • 사용부터 관리까지 모두 담당 • 클러스터 관리는 Django 기반의 전용 프로그램 별도 제작 (hub) 파이프라인 앱 • 별도 개발 • 이후 통합? 사용자 기능 관리기능
  • 72. Electron Main processRenderer process Backend.AI ES6 SDK Console App component LitElement Router Summary Redux Runtime / session Storage Maintenance Settings Resources Users Pipeline Experiments Statistics Pipeline App component Backend.AI WebSocket Proxy (standalone) Backend.AI Node.js SDK 앱 • Electron 기반 • 코어를 그대로 사용 • node.js 기반의 프록시 구현체 • JavaScript ES6 코드 서빙 • Electron 의 File 모드로 JavaScript를 서빙할 수 없다! • 별도의 프로토콜 (es6)을 정의 후, 해당 프로토콜에 커스텀 파서를 붙여 해결
  • 73. 앱 • Electron 기반 • 코어를 그대로 사용 • node.js 기반의 프록시 구현체 • JavaScript ES6 코드 서빙 • Electron 의 File 모드로 JavaScript를 서빙할 수 없다! • 별도의 프로토콜 (es6)을 정의 후, 해당 프로토콜에 커스텀 파서를 붙여 해결 protocol.registerSchemesAsPrivileged([ { scheme: 'es6', privileges: { standard: true, secure: true, bypassCSP: true } } ]); protocol.registerBufferProtocol('es6', (req, cb) => { nfs.readFile( npjoin(es6Path, req.url.replace('es6://', '')), (e, b) => { cb({ mimeType: 'text/javascript', data: b }) } ) }); 임의의 프로토콜 (es6) scheme 등록 (Electron V5/6) 임의의 버퍼 프로토콜 (es6) 의 동작등록 (Electron V5/6)
  • 74. WebSocket Proxy Server Console server Backend.AI ES6 SDK Console App component LitElement Router Summary Redux Runtime / session Storage Maintenance Settings Resources Users Pipeline Experiments Statistics Pipeline App component Backend.AI WebSocket Proxy (service) Backend.AI Node.js SDK Backend.AI Manager Backend.AI Manager Proxy Redis 웹 콘솔 모드 • Console-server와 결합 • aiohttp 기반의 python 서버 • 세션 기반의 로그인 제공 • Manager 프록시 • 클러스터의 노출을 막음 • 웹소켓 프록시 서버 • 컨테이너 안의 앱 실행 라우팅
  • 75.
  • 76.
  • 77.
  • 78. 허브 • 전체 클러스터 관리용 • Django + lit-element • Console-server 기반의 Manager 프록시 • 여러 console-server들을 도메인별로 배포 • 클러스터의 Protected multi-tenancy 지원
  • 79. Python asyncio 기반의 코드 • 뻗지는 않는데 엄청 잘 뻗는다? • 수많은 예외 고가용성 • 로드 밸런서 구현 • 매니저 레벨에서의 스케쥴러 및 큐잉 • 관리 모드를 예약한 노드의 큐잉 대상 제외 • Python 어플리케이션의 레플리케이션 모드 구현 • Fleet 운영시 Voting 알고리즘 화룡점정: 고가용성 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현
  • 80. 기존 • 클라이언트 (PC쪽)에서 호출하는 REPL 부분 및 Language server를 Backend.AI SDK 기반으로 구현해서 원격 처리 • 컴파일이 필요한 경우 파일을 전송하고, TTY 를 포함한 I/O 포트를 후킹해서 그대로 터널링 화룡점정: 웹소켓 프록시 터널링 (1) User PC Jupyter ipykernel Backend.AI Python SDK Web Browser 상호작용 방향 HTTP REST/GraphQL API + Query mode execution API Computing Node Backend.AI Agent Container Kernel Runner User Program Master Node Backend.AI Manager server-sideclient-side Backend.AI Jupyter Notebook 구현체 (2017)
  • 81. 앱 프록싱 문제 • 수많은 앱들마다 전부 외부 아답터를 지원해 줄 수가 없다! • Jupyter랑 JupyterLab은 kernelspec을 맞춰서 아답터를 구현 • IntelliJ (PyCharm), VS Code 및 ATOM은 IDE용 플러그인을 SDK 기반으로 구현 • 근데 끝이 없다 : TensorBoard, TFX, AirFlow, DIGITS… • 클라이언트를 사용자 쪽에 꼭 깔아야 함 대안 • 웹서비스 UI가 있는 앱들은 컨테이너 안에서 실행, 웹 포트를 사용자에게 제공 • Jupyter REPL을 지원하는 경우, KernelSpec을 맞춰서 REPL 구현체 제공 • 모두 다 아닌 경우 기존처럼 제공 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현 화룡점정: 웹소켓 프록시 터널링 (2)
  • 82. User PC Web Browser Computing Node Backend.AI Agent Container Kernel Runner User Program Jupyter TensorBoard Master Node(s) Web Console wsproxy Backend.AI JS SDK client-side Backend.AI Manager Backend.AI Console Server server-sidemiddleware 화룡점정: 웹소켓 프록시 터널링 (3) 프록시 터널링 설계 (2018)
  • 83. 화룡점정: 웹소켓 프록시 터널링 (4) API Client Backend.AI Agent Backend.AI Manager Computing Node Container Jupyter(2) 컨테이너 서비스로 첫 패킷 전송 (5) 컨테이너 서비스로 첫 패킷 전송 (1) 세션 생성 (1) 세션 생성 (4) 서비스 시작 (3) 컨테이너 서비스를 위한 스트림 프록시 오픈 (4') 시작됨! (5') 서비스로 부터 첫 응답 발송 User Client (e.g., browser) $ backend.ai start –t mysess ... $ backend.ai app mysess juypter –p 9000 세션 “mysess”에서 제공되는 "jupyter" 어플리케이션으로의 로컬 프록시를 http://127.0.0.1:9000 에서 제공 Service Proxy :9000 :443 :6001 :8080 :31023 (6) 컨테이너 서비스로 가는 패킷 (6') 컨테이너 서비스에서 오는 패킷 APIRequest: HTTP/1.1 GET /stream/kernel/mysess/httpproxy?app=jupyter payload: HTTP/1.1 GET /tree HTTP/1.1 GET /tree APIRequest: (other) 프록시 터널링 구현 상세 (2019)
  • 84. 화룡점정: 웹소켓 프록시 터널링 (5) User PC Web Browser Computing Node Backend.AI Agent Container Kernel Runner User Program Jupyter TensorBoard Master Node(s) Web Console wsproxy Backend.AI JS SDK client-side User PC Electron Shell Chromium Computing Node Backend.AI Agent Container Kernel Runner User Program Jupyter TensorBoard Master Node(s) HTTP REST/GraphQL API + WebSocket stream tunneling API Backend.AI Manager Backend.AI Console Server Backend.AI Manager Backend.AI Console Server Web Console Backend.AI JS SDK wsproxy server-sidemiddleware Cloud 폐쇄망
  • 85. 앱 프록싱 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현
  • 86. 앱 프록싱 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현 …은 한 6개월이면 어떻게 될 것 같은데…
  • 87. 앱 프록싱 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현 ……
  • 88. 앱 프록싱 그렇게 4년이 흘렀습니다. GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현
  • 89. PyCon Korea 2019 홍익인간 : 내 고생을 남도 하게 하지는 말자
  • 90. 홍익인간: GPU 가상화 (1) Backend.AI GPU GPUGPU GPU GPUGPU GPU GPUGPU GPU GPUGPU Backend.AI GPU GPU GPU GPU GPU GPU GPUGPU GPU 클러스터 구축 GPU 노드 공유 Backend.AI GPU GPUGPU GPU GPUGPU 클라우드 동적 확장 Cloud ➜ 이게 항상 골머리를 썩게 만듦.
  • 91. 문제 • GPU 할당이 너무 귀찮다 • GPU 종류가 너무 많다… • 비싼 GPU를 샀는데 노는 경우가 많다. GPU를 어떻게 좀 잘 쓸 수 없을까? • ➜가상화를 해버리자! 홍익인간: GPU 가상화 (1) Backend.AI GPU GPUGPU GPU GPUGPU GPU GPUGPU GPU GPUGPU Backend.AI GPU GPU GPU GPU GPU GPU GPUGPU GPU 클러스터 구축 GPU 노드 공유 Backend.AI GPU GPUGPU GPU GPUGPU 클라우드 동적 확장 Cloud with tf.device('/gpu:0'): ... for d in ['/gpu:2', '/gpu:3']: with tf.device(d): ...
  • 92. 홍익인간: GPU 가상화 (2) CUDA 기반 라이브러리 CUDA 런타임 nvidia-docker CUDA 드라이버 GPU Backend.AI GPU 가상화 계층 GPU GPU Container Host 사용자 Application NVML nvidia-docker에서 제공하는 경량 가상화의 혜택을 그대로 유지 사용자 코드 변경 필요없음 모든 NGC 이미지 공식 지원 및 사용자 작성 CUDA 코드 실행 가능 컨테이너 단위 GPU 자원 제한 구현
  • 93. 홍익인간: GPU 가상화 (3) Container 2 Backend.AI GPU Virtualizer Container 1 Container 3 Container 4 nvidia-docker + CUDA Driver PCIE/0 PCIE/1 PCIE/2 PCIE/3 PCIE/4 PCIE/5 PCIE/0PCIE/1PCIE/0 PCIE/0 PCIE/1 PCIE/0 PCIE/1 PCIE/2 /device:GPU:0 /device:GPU:0 /device:GPU:1 /device:GPU:0 /device:GPU:0 /device:GPU:1 /device:GPU:2/device:GPU:1 /device:GPU:0 /device:GPU:1 /device:GPU:2 /device:GPU:3 /device:GPU:4 /device:GPU:5 Host-side view:
  • 94. 단일 GPU 가상화 구현 및 성능 테스트 어째서 멀쩡한 GPU를 쪼개서 돌렸을 때 통째로 쓰는 것보다 성능이 더 잘 나오는가? • Bottleneck monitoring • CPU-BUS-GPU I/O bottleneck 테스트 • GIL이 전체 시스템에 끼치는 영향 테스트 NUMA node 배치를 고려한 리소스 배치를 위한 python 프로그램 구현 • NUMA node 환경 데이터베이스 구축 • CPU / GPU 할당 시 병목 최소화 홍익인간: fGPU 구현 및 테스트
  • 95. 오늘 이야기한 내용들 권불10주: 이 바닥은 10주마다 바뀌더라. 우공이산 : 몰랐으니까 산을 옮길 시도를 시작할 수 있었다. 설상가상 : 문제를 해결하면 문제들이 따라온다. 화룡점정 : 눈 찍는게 의외로 중요한 일이다. 홍익인간 : 내 고생을 남도 하게 하지는 말자 앱 프록싱 GPU 가속 지원 멀티 GPU 지원 빌드 도구 / 공개 이미지 저장소 Nvidia-docker v1/v2 지원 PyTorch Follow-up DataParallel Pipeline I/O Co-existing in-container Python adapter 컨테이너 독립적 컨트롤러 구현 GraphQL 기반의 API 오프라인 인스톨러 대규모 배포 시스템 GUI 고가용성 구현 CUDA 드라이버 레이어 추상화 Programmable syscall 필터 구현 앱 관리 콘솔 통합 도구 통곡의 벽. 짠…
  • 96. 오늘 이야기한 내용들 Photo by © Jaepil Koh 권불10주: 이 바닥은 10주마다 바뀌더라. 우공이산 : 몰랐으니까 산을 옮길 시도를 시작할 수 있었다. 설상가상 : 문제를 해결하면 문제들이 따라온다. 화룡점정 : 눈 찍는게 의외로 중요한 일이다. 홍익인간 : 내 고생을 남도 하게 하지는 말자
  • 97. 과기정통부 / NIPA에서 주관하는 공개소프트웨어 컨트리뷰톤에 지원해주세요! • Backend.AI 의 개선 및 문서화, 테스트를 함께 해보기! • http://bit.ly/BACKENDAICBT2019 • 저희와 함께 깊게 파이썬 삽을 떠 보실 수 있습니다. • 물론 얕게도 뜰 수 있습니다. 두려워 말고 컴온… • 참가 신청: 8월 5일~25일 마지막으로