C.W.K.
Stream
Lesson 01 of 06 · published

tf.data가 존재하는 이유

~8 min · tf-data, pipeline, performance

Level 0Level 0
0 XP0/78 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

GPU 놀게 두지 마

Model은 데이터 도착 속도만큼만 train돼. CPU가 다음 batch 로드/전처리하는 동안 GPU가 놀고 있으면 비싼 compute 태우는 거야. tf.data는 데이터 pipeline을 lazy + 병렬 stream으로 만들어서 — 이전 batch 끝나기 전에 GPU에 다음 거 먹여.

tf.data가 주는 다섯 가지:

  • Prefetching — GPU가 batch N 처리하는 동안 batch N+1 준비
  • Parallelism — 여러 CPU 스레드에서 동시 전처리
  • Caching — 매 epoch 비싼 전처리 반복 안 함
  • Memory 효율 — 필요한 만큼만 필요할 때 로드
  • Composability — 읽기 좋게 변환 chain

ImageNet 규모 (1.28M 이미지) dataset에서 naive Python loop는 GPU 굶겨. 제대로 튜닝한 tf.data pipeline은 GPU 100% 가까이 유지. 차이는 training 속도 5–10배.

External links

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.