C.W.K.
Stream
Lesson 03 of 07 · published

TensorFlow가 실제로 잘하는 다섯 가지

~11 min · deployment, production, tflite, tf-serving

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

TF를 production에 살려두는 다섯 가지

TF의 강점은 종교적이지 않고 구체적이야. 2026년에 TF를 잡는다면 거의 항상 이 다섯 capability 중 하나 때문이야 — 다 10년간 다듬어졌고, PyTorch나 JAX ecosystem에서 비슷한 성숙도가 없는 영역.

  1. End-to-end 배포 — TF Serving (REST + gRPC), LiteRT/TFLite (mobile + 마이크로컨트롤러), TF.js (브라우저), TFX (MLOps pipeline). SavedModel 하나로 다 먹여.
  2. Distributed training 추상화 — multi-GPU는 MirroredStrategy, multi-machine은 MultiWorkerMirroredStrategy, Cloud TPU는 TPUStrategy. 두 줄로 topology 바꾸고, model.fit이 나머지 다 처리.
  3. tf.data pipeline — lazy, 병렬, GPU 친화. AUTOTUNE이 runtime에 throughput 재면서 parallelism 알아서 튜닝. ImageNet급 dataset에선 naive pipeline vs 제대로 튜닝한 거가 training 속도 5–10배 차이.
  4. Keras 전문 라이브러리 — KerasCV (vision), KerasHub (NLP + LLM), TF Probability (Bayesian), TF Decision Forests (GBT), TF Recommenders (retrieval + ranking). 다 같은 Keras API.
  5. TPU access — Cloud TPU는 TF랑 JAX 전용 하드웨어. TPU pod 규모 train 필요하면 TF (특히 Keras 3 + JAX backend)가 가능한 두 선택지 중 하나.
TF가 잘못된 선택일 때: 지난주 paper 구현하기, 최신 HuggingFace LLM fine-tune, 공식 코드가 PyTorch이고 porting 비용이 deployment 이득보다 큰 경우. 솔직하게 trade-off 인정해.

Code

Two-line distribution change — single GPU → 8 GPUs·python
import tensorflow as tf

# Before — single device
model = tf.keras.applications.ResNet50(weights=None, classes=1000)
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy')

# After — 8 GPUs, gradient sync via NCCL all-reduce
strategy = tf.distribute.MirroredStrategy()
with strategy.scope():
    model = tf.keras.applications.ResNet50(weights=None, classes=1000)
    model.compile(optimizer='adam',
                  loss='sparse_categorical_crossentropy')

# Scale the global batch size with the number of replicas.
GLOBAL_BATCH = 64 * strategy.num_replicas_in_sync
model.fit(train_ds.batch(GLOBAL_BATCH), epochs=10)

External links

Exercise

위 다섯 강점 중 하나 골라. tensorflow.org/tutorials에서 해당하는 tutorial 찾고 intro만 읽어 — TF를 선택한 이유로 어떤 trade-off를 강조하는지 적어. production 모양의 TF 문서마다 이 다섯 테마가 반복돼.

Progress

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

댓글 0

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

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