vLLM-TorchTPU の使い方:Cloud TPU v6e で Qwen3-8B を動かす【実機検証】
Cloud TPU v6e-1 で vLLM-TorchTPU と Qwen3-8B を実機検証。インストール 187 秒、キャッシュありの再起動は中央値 72 秒。OpenAI 互換 API、FP8 KV Cache、コンパイルキャッシュの挙動とトラブル対処を解説。
TPU・GPU・PyTorch・JAX・Apache Iceberg を中心に、公式ドキュメントやリリースノートだけでは分からない挙動を、実際のコード・ベンチマーク・エラーログで検証する技術ブログです。
再現実験、性能比較、ソースコードレベルのデバッグ、失敗原因の分析を、実測結果とともに公開しています。
TPU v6e-4 と A100 80GB×2 で Gemma 4 31B を vLLM で実測 (21 ケース)。スループット勝者は入出力長で逆転、TPOT は TPU が全域で 2.5〜5.8 倍速い結果と、用途別の使い分け基準を解説。
TPU v6e-1 (Trillium) と A100 80GB×1 を Qwen3-8B × vLLM で実測比較 (45 ケース)。同一設定なら $/1M tokens は TPU が全プロファイルで 22〜41% 安く、A100 は並列度を開放すると short/medium で逆転。HBM 32GB の構造制約と TPU で 12B が動かなかった顛末も解説。
2026年の JAX 全リリース (0.9.0 / 0.9.1 / 0.9.2 / 0.10.0 / 0.10.1 / 0.10.2 / 0.11.0 / 0.11.1 / 0.11.2 / 0.12.0) の変更点を1ページに集約した changelog まとめ。破壊的変更の早見表、バージョン別の詳細解説記事へのリンク、複数バージョンをまたぐアップグレードの注意点。新リリースのたびに更新します。
Cloud TPU v6e-1 で vLLM-TorchTPU と Qwen3-8B を実機検証。インストール 187 秒、キャッシュありの再起動は中央値 72 秒。OpenAI 互換 API、FP8 KV Cache、コンパイルキャッシュの挙動とトラブル対処を解説。
TorchTPU と TorchTitan で TPU v6e-4 の分散学習を 4 構成実測。GraphTrainer、per-block torch.compile、optimizer_in_graph の性能差とメモリ使用量、SimpleFSDP の導入・トラブル対策を解説。
PyTorch 2.15の破壊的変更を2.14.1と実測比較。NCCL all_gatherの戻り値変更、complex演算のTypeError、Python 3.10終了、arm64の数値差を再現コード付きで解説。
TorchTPU 0.2.0 を TPU v6e-1 で実測。0.87B Transformer の学習速度を 7 構成で比較し、SingleTraceTrainer で Eager 比 3.4 倍を記録。torch.compile の性能差と 5 つの注意点を検証。
JAX 0.12.0を0.11.2と比較して検証。random.multinomialの出力shapeが静かに1次元増える破壊的変更、custom_remat削除とdefremat移行、vmap×custom_vjpで勾配がバッチ数倍になっていた問題のエラー化、elu/ldexp/hypot/partition(INT_MIN)/Array.sum(initial)など静かに間違っていたバグ修正、no_collectives新機能をコードと検証結果で解説します。
JAX 0.11.2をリリース当日に実測検証。0.11.1との比較でsinc/eigh/choleskyの勾配バグ、GPU irfftn高速化、cumsum、mTLS、shard_alike削除を再現・計測しました。
JAXでTPU v6e×4を使い、Data ParallelとFSDP-like parameter shardingを0.87B・3.27Bモデルで実測比較。0.8BではFSDP-likeが約12%高速、3.2BではDPが約34%高速に逆転。throughput、device memory、JAX/libtpu stack更新による性能差まで検証します。
DeepSpeed ZeRO-1/2/3とPyTorch FSDP2をQwen2.5-3B・4 GPUで実測比較。A100 NVLinkではFSDP2 reshardがZeRO-3の1.83倍のthroughputを記録。L4 PCIeでの通信コスト、GPUメモリ、CPU offload、OOM・NCCL watchdogも検証します。
JAX の TransformedRef エラー (shard_map / jit / scan) の直し方。不可解な safe_zip() / IndexError 変種も扱います。JAX 0.11.0 で修正込みの動作検証つき。
PyTorch 2.14.0 の変更点まとめ。clamp の境界サブグラディエントがエラーなしで 1.0→0.0 に変わる、bfloat16×complex が bcomplex32 になり既存コードが NotImplementedError、torch.cholesky/torch.qr の削除、TorchScript の FutureWarning 開始、Python 3.15 (no-GIL) 対応など。2.13.0/2.14.0 両方での実行検証つき。
GPU (TRL/Colab T4) で 26 分かかった SFT を Google の JAX ネイティブ post-training ライブラリ Tunix + TPU v6e-1 で再現したら学習は 5.5 分 (4.7 倍速)。ただし辿り着くまでにつまづき 10 連発 — Python 3.11 で古い tunix が入る、可変長バッチで毎ステップ再コンパイル、孤児プロセスの TPU 占有など、全エラーを原文つきで記録しました。
Qwen2.5-0.5B base を TRL で SFT (LoRA アダプタに保存) し、valid JSON 率 23%→100%、JSON+カテゴリ正解 0%→96% を無料 Colab T4 1枚・26分で達成した実録。'systemsystem' 連呼などトラップ 7 つのエラーと修正、そして SFT が「停止」を悪化させたという実測まで、before/after で検証します。
JAX 0.11.1 の変更点まとめ。take_along_axis の wrap_negative_indices 既定値変更で mode='promise_in_bounds' の結果がエラーなしで変わる (実測 10→30)、meshgrid/broadcast_arrays がタプルを返すように、jnp.top_k 追加、det/slogdet の数値安定化など。JAX 0.11.0/0.11.1 両方での実行検証つき。
当サイトで実測した LLM 推論ベンチマークを 1 ページに集約する生きたハブ。TPU v6e と A100 の vLLM 実測 (ピークスループット・TTFT/TPOT・$/100万トークン) を、バージョン固定・生データ CSV・再現スクリプトつきで比較できます。新しい実測のたびに更新。
plgpu.inline_mgpu で ValueError: Transform mismatch: got ..., expected ... が出たら、RefType(transforms=...) の宣言と ref が実際に持つ transforms の不一致が原因です。JAX の Mosaic GPU lowering のソースをたどって、チェックの仕組みと 2 方向の直し方を解説します。
Apache Iceberg はデータレイク上のファイル群を「ちゃんとしたテーブル」にするオープンテーブルフォーマット。なぜ Hive 方式では限界だったのか、ACID・タイムトラベル・スキーマ進化・hidden partitioning が何を解決するか、DWH / データレイク / lakehouse の関係、導入すべきケースとしなくていいケースまでを 10 分で整理します。
Apache Iceberg の metadata.json・マニフェストリスト・マニフェストの 3 層構造を図解し、実際のファイルの中身 (フィールド ID、min/max 統計、スナップショットの累積参照) を読んで裏付けます。append で何が起きるか、なぜ Hive 方式のテーブルではダメだったのか、タイムトラベルとファイルスキップの正体まで。
Apache Iceberg を Python だけ・pip install 一発で動かす最短手順。PyIceberg 0.11 + SQLite カタログでテーブル作成、Arrow での書き込み、フィルタ付きスキャン、スナップショットによるタイムトラベルまでを全コード実行済みで解説。Iceberg の 3 層メタデータ構造が実ファイルで見えるところまで。Docker もクラスタも不要。
JAX を GPU で使うと出る Results do not match the reference. This is likely a bug/unexpected loss of precision の原因を XLA ソースから解説。A100/H100 では float32 の matmul が既定で TF32 実行されること、GEMM autotuner が rtol=0.1 で候補カーネルを照合し不一致を失格にするだけで実行は続くこと、jax_default_matmul_precision の正しい使い方をまとめます。
pgvector 0.8.6 と LanceDB 0.36 を同一データ (DBpedia OpenAI 埋め込み 10万件×1536次元) で実測比較。投入は LanceDB が 20 倍速、単独クエリも 2 倍速だが、8 並行では pgvector が逆転。フィルタ併用では pgvector の recall がプランナ次第で 0.07 に崩壊する条件と対策 (ANALYZE / iterative_scan) も検証しました。
jax.pmap の static_broadcasted_argnums に配列やリストを渡すと ValueError: Non-hashable static arguments are not supported になります。エラーの原因、正しい直し方 3 通り、インデックスがゼロベースで in_axes とどう対応するか、0.10.0 以降の pmap の扱いまで JAX 0.11.0 で実測して解説します。
TPU v6e-1 (Trillium) と A100 80GB×1 を Qwen3-8B × vLLM で実測比較 (45 ケース)。同一設定なら $/1M tokens は TPU が全プロファイルで 22〜41% 安く、A100 は並列度を開放すると short/medium で逆転。HBM 32GB の構造制約と TPU で 12B が動かなかった顛末も解説。
Google の Android Bench は LLM の Android 開発能力を測るベンチマーク。2026年7月に評価フレームワークが Harbor に移行。100タスクの選定方法、10回実行による統計処理、スコアの計算方法、最新リーダーボードを解説します。
JAX GPU で発生する XlaRuntimeError: CANCELLED: Contracting dimension is too fragmented の原因を XLA ソースコードから特定。Triton GEMM の split-K 書き換えと縮約次元の断片化が原因。発生条件(JAX 0.10.0 以前・deterministic_ops 等)と 4 つの対処法を解説。
2026年の JAX 全リリース (0.9.0 / 0.9.1 / 0.9.2 / 0.10.0 / 0.10.1 / 0.10.2 / 0.11.0 / 0.11.1 / 0.11.2 / 0.12.0) の変更点を1ページに集約した changelog まとめ。破壊的変更の早見表、バージョン別の詳細解説記事へのリンク、複数バージョンをまたぐアップグレードの注意点。新リリースのたびに更新します。
JAX 0.11.0の変更点まとめ。jnp.empty/empty_likeがゼロ初期化から未初期化配列に変更(要注意)、Python 3.11・NumPy 2.0・SciPy 1.14のサポート終了、jax.custom_rematとjax.Inline追加、checkpoint_policiesのサブモジュール化を解説。
JAX 0.10.2の変更点まとめ。jax.scipy.linalgにinvhilbert・invpascal・fiedler_companionの3関数が追加。jax.ShapeDtypeStruct.likeによる簡潔なスペック構築、トレーシング性能改善も。破壊的変更なしの追加のみのリリース。
JAX 0.10.1の変更点まとめ。with mesh: コンテキストマネージャの廃止とjax.set_mesh()への移行方法、jax.scipy.linalgへの行列構築関数7種追加、pytreeリーフ制限の変更を解説。
TPU v6e-4 と A100 80GB×2 で Gemma 4 31B を vLLM で実測 (21 ケース)。スループット勝者は入出力長で逆転、TPOT は TPU が全域で 2.5〜5.8 倍速い結果と、用途別の使い分け基準を解説。
JAX 0.10.0 で pmap の旧 C++ 実装が削除され、jax.pmap は jit + shard_map ベースの新実装へ完全移行。PartitionSpec の検証厳格化、CPU デバイス名リネームなどの破壊的変更を、Before / After コード例と実務での移行手順つきでひとつずつ解説します。
JAX 0.9.2の変更点まとめ。jax.numpy.arangeがデバイス生成に変更されbfloat16で精度低下する問題と対処法、TypedNdArray型階層の変更を解説。
JAX入門ガイド2026年版。NumPyとの違い、jit・vmapの使い方、よくあるハマりどころを比較コード付きで最短解説。
JAXのjitとベクトル演算で時系列特徴量生成をPandas比10倍以上に高速化。ベンチマーク結果と実装コードを紹介。
JAX 0.9.1 で Explicit モードの shard_map が暗黙の reshard を廃止し、PartitionSpec が一致しないとエラーになるよう変更されました。実例コードでエラー再現と直し方を解説。ソースに出てくる _skip_mesh_check=True の正体と context mesh エラーの対処も補足します。
JAX 0.9.0 で pmap の rank reduction 仕様が固定され、jax.experimental.shard が削除、Layout/Format がリネームされました。さらに新規追加の thread_guard はマルチスレッド環境で静かにエラーを出します。本記事では移行で壊れる 5 つの変更点と、それぞれの対処手順をコード例つきで解説します。
スマートフォンなどで撮影した画像ファイルはそのままだと緯度経度情報が含まれていたり、ダウンロードしたファイルはダウンロード元のデータが入るので Mac 上で削除する方法を記載します
分散 SQL エンジン Trino をローカルで動かして試した記録。Presto から Trino へのリブランドの経緯、Docker での起動手順、クエリ実行までをステップごとにまとめます。ビッグデータ系ツールをまず触ってみたい人向けです。
モデルモニタリング OSS の Whylogs を試した概要と感想。テーブル・画像・テキストデータのプロファイリング、制約 (constraints) によるデータ検証、可視化、無料 SaaS の WhyLabs との関係までをまとめます。
学習済みの機械学習モデルを FastAPI で Web API 化する最小構成を解説。モデルのロードからエンドポイント定義、サーバー起動、リクエストでの推論実行まで、システムに組み込める形にする手順をコードつきでまとめます。
MLOps 勉強会で 2021 年に紹介されたツール・発表資料を一挙に振り返り。Vertex AI / Kubeflow、AWS、実験管理からモニタリングまで、カテゴリ別に GitHub リンクつきで整理した年間まとめです。
BigQuery MLの2値分類 チュートリアルを実施した際に追加で検証したことや気になったことを記載しています。
HugoでTheme(特にhugo-theme-stack)を利用している際にもとのThemeのファイルを修正しなくても、htmlを追加したい場合の対応方法についてまとめます。
BigQuery MLの2値分類のチュートリアルを実施した際に追加で検証したことや、気になったところを記載しています。
『いちばんやさしいアジャイル開発の教本』の読書メモ。どんな人におすすめか、スクラムの型をそのまま導入せず組織に応じて修正する必要性など、実務目線での気づきをまとめます。
GitHub ActionsでHugo extendedを使うテーマを利用している場合、Hugo extendedを指定してset upしないとbuild errorになりますので、そのときのset upする方法を紹介します。
Google Domains で取得したドメインを GCP 上のサーバーに向ける方法を解説。ドメインとサーバーの関係の基礎から、Google Domains の転送設定・DNS レコードの設定手順までをまとめます。
Google Domains でドメインを新規登録する手順を画面つきで解説。ドメイン名の検索から料金確認、購入、登録後の初期設定までを順に説明します。はじめてドメインを取得する人向けの入門記事です。
Firebase Hosting プロジェクトの .gitignore に何を書くべきかを整理。.firebase ディレクトリは除外必須、.firebaserc と firebase.json はコミットしてよい理由と、オープンソースで公開する場合の例外まで、各ファイルの役割から解説します。
Gemma 4 31B on vLLM benchmarked across TPU v6e-4 and A100 80GB×2 over 21 cases. Throughput winner flips with input length; TPU is 2.5–5.8× faster on TPOT.
TPU v6e-1 (Trillium) vs a single A100 80GB serving Qwen3-8B on vLLM, measured across 45 cases. At identical settings the TPU is 22–41% cheaper per 1M tokens; unleashing the A100's concurrency flips short/medium. Includes why Gemma 4 12B is unusable on v6e-1.
Track every JAX release in 2026 — version numbers, release dates, key changes, breaking changes, and migration notes — with links to detailed per-version release analyses. Covers 0.9.0 through 0.12.0, updated with every new release.
A hands-on guide to serving Qwen3-8B with vLLM-TorchTPU on Google Cloud TPU v6e. Measured installation time, compilation cache behavior, 72-second median restarts, and OpenAI-compatible API verification.
Four configurations measured on TPU v6e-4 through TorchTitan's TorchTPU path: eager, per-block torch.compile, GraphTrainer and optimizer_in_graph — their throughput, their memory, and setting up SimpleFSDP.
PyTorch 2.15's breaking changes measured against 2.14.1: the NCCL all_gather future's return value, complex ops raising TypeError, the end of Python 3.10, and arm64 numerical drift — with reproducible code.
Hands-on TPU v6e-1 benchmark of TorchTPU 0.2.0 across 7 configurations on a 0.87B Transformer. SingleTraceTrainer reaches 3.4x over Eager while torch.compile(model) ties DeferAndFuse. Includes 5 implementation notes and fixes.
Hands-on verification of JAX 0.12.0 vs 0.11.2: random.multinomial silently adds an extra dimension to existing calls, custom_remat is removed in favor of defremat, vmap + custom_vjp catches a bug that multiplied gradients by batch size, and 7 silent math/gradient bugs (elu/selu, ldexp, hypot, partition INT_MIN, Array.sum initial, reduceat dtype) are reproduced and verified.
JAX 0.11.2 tested on release day. Comparing against 0.11.1, I reproduced and measured the sinc/eigh/cholesky gradient bugs, GPU irfftn speedup, cumsum, mTLS, and the shard_alike removal.
Benchmarking JAX Data Parallel vs FSDP-like parameter sharding on 4 TPU v6e chips. FSDP-like is 12% faster at 0.87B, while DP is 34% faster at 3.27B. Includes memory use, stack-upgrade regressions, and TPU provisioning notes.
DeepSpeed ZeRO 0-3 vs PyTorch FSDP2 on one shared harness, one model (Qwen2.5-3B), two interconnects. On A100 (NVLink) FSDP2 beats ZeRO-3 by 1.8x; on L4 (PCIe) ZeRO-2/3 die with NCCL watchdog timeouts and are resurrected by a single env var (expandable_segments). Includes the GKE reality that quota is not stock, an autoscaler pattern that plays the GPU lottery for you, and a taxonomy of the three ways distributed training dies.
Fix JAX TransformedRef errors in shard_map, jit, and scan, including cryptic safe_zip() and IndexError variants. Verified on JAX 0.11.0 with working fixes.
What changed in PyTorch 2.14.0: clamp's boundary subgradient silently changes from 1.0 to 0.0, bfloat16-complex promotion moves to bcomplex32 and breaks previously working code with NotImplementedError, torch.cholesky/torch.qr finally removed, TorchScript starts emitting visible FutureWarnings, Python 3.15 (no-GIL) wheels. Every behavior verified by running both 2.13.0 and 2.14.0.
I reproduced the exact SFT run from my TRL/Colab-T4 experiment with Google's JAX-native post-training library Tunix on a TPU v6e-1: training dropped from 26 minutes to 5.5 (4.7×). Getting there took 10 traps — Python 3.11 silently installing an old tunix, variable-length batches recompiling every step, an orphan process holding the TPU — all recorded with verbatim errors.
Fine-tuning Qwen2.5-0.5B with TRL (SFT, stored as a LoRA adapter) on a free Colab T4 took valid-JSON rate from 23% to 100% and valid-JSON-with-correct-category from 0% to 96% in 26 minutes. Includes 7 real failure modes with fixes — and one capability SFT made worse.
What changed in JAX 0.11.1: the take_along_axis wrap_negative_indices default now silently changes results under mode='promise_in_bounds' (measured 10→30), meshgrid/broadcast_arrays return tuples, jnp.top_k lands, det/slogdet gets numerically stable, and cuDNN attention vmap fixes. Verified by running both 0.11.0 and 0.11.1.
A living index of our measured LLM inference benchmarks on TPU and GPU: peak throughput, TTFT/TPOT and $/1M tokens for TPU v6e and A100 on vLLM, with pinned versions, raw CSV data and reproducible scripts. Updated with every new run.
Hitting ValueError: Transform mismatch: got ..., expected ... from plgpu.inline_mgpu? We trace the check in JAX's Mosaic GPU lowering to its source: the transforms declared in RefType must match the transforms your ref actually carries. Here is why, and the fix.
Apache Iceberg is an open table format that turns a pile of files on object storage into a proper table. Why Hive-style tables hit a wall, how Iceberg relates to Parquet (a file format, not a competitor), what ACID, time travel, schema evolution, and hidden partitioning actually solve, how the lakehouse fits in — and when you don't need any of it.
Diagramming Apache Iceberg's metadata.json / manifest list / manifest layers and backing every claim with real file contents — field IDs, per-file min/max stats, cumulative snapshot references. What actually happens on append, why Hive-style tables weren't enough, and what time travel and file skipping really are.
Run Apache Iceberg with nothing but Python and one pip install. PyIceberg 0.11 + a SQLite catalog: create a table, write Arrow data, run filtered scans, time-travel across snapshots — every command executed and verified — and finish by inspecting Iceberg's three-layer metadata structure as real files on disk. No Docker, no cluster, no JVM.
Explaining the JAX GPU error Results do not match the reference. This is likely a bug/unexpected loss of precision from the XLA source: float32 matmuls run in TF32 by default on A100/H100, the GEMM autotuner compares candidate kernels at rtol=0.1 and merely disqualifies mismatches, and how to use jax_default_matmul_precision correctly.
pgvector 0.8.6 vs LanceDB 0.36 on identical data (100k DBpedia OpenAI embeddings, 1536-dim). LanceDB ingests 20x faster and wins single-threaded queries 2x; pgvector flips the result at 8 concurrent clients. Filtered search exposes pgvector's planner-dependent recall collapse (0.07!) and the fixes: ANALYZE and iterative_scan.
Fix JAX's "Non-hashable static arguments are not supported" ValueError and understand how pmap's static_broadcasted_argnums, jit's static_argnums and static_argnames, dicts, arrays, and traced values relate to hashability — the fixes, the zero-based argument index, and the kwargs rules, all verified on JAX 0.11.0.
TPU v6e-1 (Trillium) vs a single A100 80GB serving Qwen3-8B on vLLM, measured across 45 cases. At identical settings the TPU is 22–41% cheaper per 1M tokens; unleashing the A100's concurrency flips short/medium. Includes why Gemma 4 12B is unusable on v6e-1.
Google's Android Bench measures how well LLMs handle Android development tasks. In July 2026 the evaluation framework migrated to Harbor. This article covers how the 100 tasks were curated, the 10-run statistical methodology, how scores are computed, and the latest leaderboard.
Root-causing JAX's XlaRuntimeError: CANCELLED: Contracting dimension is too fragmented from the XLA source: the Triton GEMM split-K rewriter can't split a fused contracting dimension. Affected versions (JAX <= 0.10.0), why deterministic_ops triggers it, and four fixes.
Track every JAX release in 2026 — version numbers, release dates, key changes, breaking changes, and migration notes — with links to detailed per-version release analyses. Covers 0.9.0 through 0.12.0, updated with every new release.
JAX 0.11.0 changes jnp.empty/empty_like from zero-initialized to truly uninitialized arrays (watch out), drops Python 3.11 / NumPy 2.0 / SciPy 1.14 support, adds jax.custom_remat and jax.Inline, and turns checkpoint_policies into a proper submodule.
JAX 0.10.2 adds invhilbert, invpascal, and fiedler_companion to jax.scipy.linalg, introduces the jax.ShapeDtypeStruct.like shortcut, and improves tracing performance. A purely additive release with no breaking changes.
JAX 0.10.1 deprecates the with mesh: context manager in favour of jax.set_mesh(), adds 11 special-matrix constructors to jax.scipy.linalg (including pascal, hadamard, circulant), and tightens pytree leaf rules. Migration checklist included.
Gemma 4 31B on vLLM benchmarked across TPU v6e-4 and A100 80GB×2 over 21 cases. Throughput winner flips with input length; TPU is 2.5–5.8× faster on TPOT.
JAX 0.10.0 removes the legacy C++ pmap implementation — jax.pmap now always runs on jit + shard_map — tightens PartitionSpec validation, renames the CPU device, and more. We walk through every breaking change with before/after code examples and a step-by-step migration plan.
JAX 0.9.2's `jax.numpy.arange` quietly moved on-device, and bfloat16 arrays now lose precision silently. We walk through what changed, why it bites bfloat16 users, and the one-line fix — plus the TypedNdArray type hierarchy update.
JAX beginner guide for 2026. Learn the key differences from NumPy, how to use jit and vmap, and common pitfalls — all with side-by-side code examples.
Speed up time-series feature generation 10x over Pandas using JAX jit and vectorized ops. Benchmark results and implementation code included.
What changed in JAX 0.9.1? Learn how shard_map's implicit resharding change affects existing code, what _skip_mesh_check means, and how to fix common migration errors.
JAX 0.9.0 locks pmap to no-rank-reduction, removes jax.experimental.shard, renames Layout/Format, and adds thread_guard that silently errors on multi-threaded code. We walk through every breaking change and the migration steps for each, with code examples.
A hands-on introduction to Trino, the distributed SQL query engine